hci_dump.c (eb443d3d86c07c2f7d7973304b0b4dac8f914382) hci_dump.c (f8fbdce0c5067e7e7edd3a29934b1f9b79c8ff2d)
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 174 unchanged lines hidden (view full) ---

183 /* Print the formatted time, in seconds, followed by a decimal point
184 and the milliseconds. */
185 printf ("%s.%03u] ", time_string, milliseconds);
186 printf_packet(packet_type, in, packet, len);
187 break;
188 }
189
190 case HCI_DUMP_BLUEZ:
1/*
2 * Copyright (C) 2014 BlueKitchen GmbH
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * 1. Redistributions of source code must retain the above copyright

--- 174 unchanged lines hidden (view full) ---

183 /* Print the formatted time, in seconds, followed by a decimal point
184 and the milliseconds. */
185 printf ("%s.%03u] ", time_string, milliseconds);
186 printf_packet(packet_type, in, packet, len);
187 break;
188 }
189
190 case HCI_DUMP_BLUEZ:
191 bt_store_16( header_bluez, 0, 1 + len);
191 little_endian_store_16( header_bluez, 0, 1 + len);
192 header_bluez[2] = in;
193 header_bluez[3] = 0;
192 header_bluez[2] = in;
193 header_bluez[3] = 0;
194 bt_store_32( header_bluez, 4, curr_time.tv_sec);
195 bt_store_32( header_bluez, 8, curr_time.tv_usec);
194 little_endian_store_32( header_bluez, 4, curr_time.tv_sec);
195 little_endian_store_32( header_bluez, 8, curr_time.tv_usec);
196 header_bluez[12] = packet_type;
197 write (dump_file, header_bluez, HCIDUMP_HDR_SIZE);
198 write (dump_file, packet, len );
199 break;
200
201 case HCI_DUMP_PACKETLOGGER:
196 header_bluez[12] = packet_type;
197 write (dump_file, header_bluez, HCIDUMP_HDR_SIZE);
198 write (dump_file, packet, len );
199 break;
200
201 case HCI_DUMP_PACKETLOGGER:
202 net_store_32( header_packetlogger, 0, PKTLOG_HDR_SIZE - 4 + len);
203 net_store_32( header_packetlogger, 4, curr_time.tv_sec);
204 net_store_32( header_packetlogger, 8, curr_time.tv_usec);
202 big_endian_store_32( header_packetlogger, 0, PKTLOG_HDR_SIZE - 4 + len);
203 big_endian_store_32( header_packetlogger, 4, curr_time.tv_sec);
204 big_endian_store_32( header_packetlogger, 8, curr_time.tv_usec);
205 switch (packet_type){
206 case HCI_COMMAND_DATA_PACKET:
207 header_packetlogger[12] = 0x00;
208 break;
209 case HCI_ACL_DATA_PACKET:
210 if (in) {
211 header_packetlogger[12] = 0x03;
212 } else {

--- 83 unchanged lines hidden ---
205 switch (packet_type){
206 case HCI_COMMAND_DATA_PACKET:
207 header_packetlogger[12] = 0x00;
208 break;
209 case HCI_ACL_DATA_PACKET:
210 if (in) {
211 header_packetlogger[12] = 0x03;
212 } else {

--- 83 unchanged lines hidden ---