mirror of
https://github.com/bluekitchen/btstack.git
synced 2025-02-26 09:41:01 +00:00
use #define to get really const int value
This commit is contained in:
parent
b949fa79d9
commit
d6bd2eb2a6
@ -75,7 +75,7 @@ typedef struct {
|
||||
uint8_t packet_type;
|
||||
}
|
||||
hcidump_hdr;
|
||||
const int hcidump_hdr_size = 13;
|
||||
#define HCIDUMP_HDR_SIZE 13
|
||||
|
||||
// APPLE PacketLogger - struct not used directly, but left here as documentation
|
||||
typedef struct {
|
||||
@ -85,13 +85,13 @@ typedef struct {
|
||||
uint8_t type; // 0xfc for note
|
||||
}
|
||||
pktlog_hdr;
|
||||
const int pktlog_hdr_size = 13;
|
||||
#define PKTLOG_HDR_SIZE 13
|
||||
|
||||
static int dump_file = -1;
|
||||
#ifndef EMBEDDED
|
||||
static int dump_format;
|
||||
static uint8_t header_bluez[hcidump_hdr_size];
|
||||
static uint8_t header_packetlogger[pktlog_hdr_size];
|
||||
static uint8_t header_bluez[HCIDUMP_HDR_SIZE];
|
||||
static uint8_t header_packetlogger[PKTLOG_HDR_SIZE];
|
||||
static char time_string[40];
|
||||
static int max_nr_packets = -1;
|
||||
static int nr_packets = 0;
|
||||
@ -197,12 +197,12 @@ void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t
|
||||
bt_store_32( header_bluez, 4, curr_time.tv_sec);
|
||||
bt_store_32( header_bluez, 8, curr_time.tv_usec);
|
||||
header_bluez[12] = packet_type;
|
||||
write (dump_file, header_bluez, hcidump_hdr_size);
|
||||
write (dump_file, header_bluez, HCIDUMP_HDR_SIZE);
|
||||
write (dump_file, packet, len );
|
||||
break;
|
||||
|
||||
case HCI_DUMP_PACKETLOGGER:
|
||||
net_store_32( header_packetlogger, 0, pktlog_hdr_size - 4 + len);
|
||||
net_store_32( header_packetlogger, 0, PKTLOG_HDR_SIZE - 4 + len);
|
||||
net_store_32( header_packetlogger, 4, curr_time.tv_sec);
|
||||
net_store_32( header_packetlogger, 8, curr_time.tv_usec);
|
||||
switch (packet_type){
|
||||
@ -232,7 +232,7 @@ void hci_dump_packet(uint8_t packet_type, uint8_t in, uint8_t *packet, uint16_t
|
||||
default:
|
||||
return;
|
||||
}
|
||||
write (dump_file, &header_packetlogger, pktlog_hdr_size);
|
||||
write (dump_file, &header_packetlogger, PKTLOG_HDR_SIZE);
|
||||
write (dump_file, packet, len );
|
||||
break;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user