}
#ifdef TIZEN_FEATURE_BLUEZ_MODIFY
#define BT_SNOOP_TYPE_HCI_PREFIX "btsnoop_type_hci"
+#define MAX_SUPPORTED_ADAPTER 16
static void command_split(const char *input)
{
uint16_t index, max_index = 0;
char write_file_name[255];
struct btsnoop *btsnoop_read_file = NULL;
- struct btsnoop *btsnoop_write_file[16];
+ struct btsnoop *btsnoop_write_file[MAX_SUPPORTED_ADAPTER] = { NULL };
time_t t;
struct tm tm;
unsigned long num_packets = 0;
&pktlen))
goto close_files;
- if (opcode == 0xffff)
+ if (opcode == 0xffff || index >= MAX_SUPPORTED_ADAPTER)
goto next_packet;
switch (opcode) {
btsnoop_unref(btsnoop_write_file[index]);
btsnoop_write_file[index] = NULL;
break;
- default:
+
+ case BTSNOOP_OPCODE_COMMAND_PKT:
+ case BTSNOOP_OPCODE_EVENT_PKT:
+ case BTSNOOP_OPCODE_ACL_TX_PKT:
+ case BTSNOOP_OPCODE_ACL_RX_PKT:
+ case BTSNOOP_OPCODE_SCO_TX_PKT:
+ case BTSNOOP_OPCODE_SCO_RX_PKT:
if (!btsnoop_write_file[index]) {
t = tv.tv_sec;
localtime_r(&t, &tm);
btsnoop_write_hci(btsnoop_write_file[index], &tv, index,
opcode, buf, pktlen);
break;
+ default:
+ printf("skip btmon opcode(%d)\n",opcode);
}
num_packets++;