diff --git a/android/bluetoothd-snoop.c b/android/bluetoothd-snoop.c
index 57f97f4..dc34869 100644
--- a/android/bluetoothd-snoop.c
+++ b/android/bluetoothd-snoop.c
#define DEFAULT_SNOOP_FILE "/sdcard/btsnoop_hci.log"
-#define MAX_PACKET_SIZE (1486 + 4)
-
static struct btsnoop *snoop = NULL;
-static uint8_t monitor_buf[MAX_PACKET_SIZE];
+static uint8_t monitor_buf[BTSNOOP_MAX_PACKET_SIZE];
static int monitor_fd = -1;
static void signal_callback(int signum, void *user_data)
diff --git a/monitor/analyze.c b/monitor/analyze.c
index 5288cf3..b027b3c 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
#include "monitor/bt.h"
#include "analyze.h"
-#define MAX_PACKET_SIZE (1486 + 4)
-
struct hci_dev {
uint16_t index;
uint8_t type;
}
while (1) {
- unsigned char buf[MAX_PACKET_SIZE];
+ unsigned char buf[BTSNOOP_MAX_PACKET_SIZE];
struct timeval tv;
uint16_t index, opcode, pktlen;
diff --git a/monitor/control.c b/monitor/control.c
index 8ee4431..36ebcbc 100644
--- a/monitor/control.c
+++ b/monitor/control.c
static struct btsnoop *btsnoop_file = NULL;
static bool hcidump_fallback = false;
-#define MAX_PACKET_SIZE (1486 + 4)
-
struct control_data {
uint16_t channel;
int fd;
- unsigned char buf[MAX_PACKET_SIZE];
+ unsigned char buf[BTSNOOP_MAX_PACKET_SIZE];
uint16_t offset;
};
void control_reader(const char *path)
{
- unsigned char buf[MAX_PACKET_SIZE];
+ unsigned char buf[BTSNOOP_MAX_PACKET_SIZE];
uint16_t pktlen;
uint32_t type;
struct timeval tv;
diff --git a/src/shared/btsnoop.h b/src/shared/btsnoop.h
index 2c55d02..9675980 100644
--- a/src/shared/btsnoop.h
+++ b/src/shared/btsnoop.h
#define BTSNOOP_OPCODE_SCO_TX_PKT 6
#define BTSNOOP_OPCODE_SCO_RX_PKT 7
+#define BTSNOOP_MAX_PACKET_SIZE (1486 + 4)
+
struct btsnoop_opcode_new_index {
uint8_t type;
uint8_t bus;