diff --git a/android/bluetoothd-snoop.c b/android/bluetoothd-snoop.c
index 035875a..75f58cc 100644
--- a/android/bluetoothd-snoop.c
+++ b/android/bluetoothd-snoop.c
case BTSNOOP_OPCODE_SCO_TX_PKT:
case BTSNOOP_OPCODE_SCO_RX_PKT:
break;
+ case BTSNOOP_OPCODE_OPEN_INDEX:
+ case BTSNOOP_OPCODE_CLOSE_INDEX:
+ break;
}
return 0xff;
diff --git a/monitor/analyze.c b/monitor/analyze.c
index eea3c9e..47ae45f 100644
--- a/monitor/analyze.c
+++ b/monitor/analyze.c
case BTSNOOP_OPCODE_SCO_RX_PKT:
sco_pkt(&tv, index, buf, pktlen);
break;
+ case BTSNOOP_OPCODE_OPEN_INDEX:
+ case BTSNOOP_OPCODE_CLOSE_INDEX:
+ break;
default:
fprintf(stderr, "Wrong opcode %u\n", opcode);
goto done;
diff --git a/monitor/packet.c b/monitor/packet.c
index d6c74e9..3404b75 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
#define COLOR_NEW_INDEX COLOR_GREEN
#define COLOR_DEL_INDEX COLOR_RED
+#define COLOR_OPEN_INDEX COLOR_GREEN
+#define COLOR_CLOSE_INDEX COLOR_RED
#define COLOR_HCI_COMMAND COLOR_BLUE
#define COLOR_HCI_COMMAND_UNKNOWN COLOR_WHITE_BG
case BTSNOOP_OPCODE_SCO_RX_PKT:
packet_hci_scodata(tv, index, true, data, size);
break;
+ case BTSNOOP_OPCODE_OPEN_INDEX:
+ if (index < MAX_INDEX)
+ addr2str(index_list[index].bdaddr, str);
+ else
+ sprintf(str, "00:00:00:00:00:00");
+
+ packet_open_index(tv, index, str);
+ break;
+ case BTSNOOP_OPCODE_CLOSE_INDEX:
+ if (index < MAX_INDEX)
+ addr2str(index_list[index].bdaddr, str);
+ else
+ sprintf(str, "00:00:00:00:00:00");
+
+ packet_close_index(tv, index, str);
+ break;
default:
sprintf(extra_str, "(code %d len %d)", opcode, size);
print_packet(tv, index, '*', COLOR_ERROR,
label, NULL);
}
+void packet_open_index(struct timeval *tv, uint16_t index, const char *label)
+{
+ print_packet(tv, index, '=', COLOR_OPEN_INDEX, "Open Index",
+ label, NULL);
+}
+
+void packet_close_index(struct timeval *tv, uint16_t index, const char *label)
+{
+ print_packet(tv, index, '=', COLOR_CLOSE_INDEX, "Close Index",
+ label, NULL);
+}
+
void packet_hci_command(struct timeval *tv, uint16_t index,
const void *data, uint16_t size)
{
diff --git a/monitor/packet.h b/monitor/packet.h
index c39816b..e142772 100644
--- a/monitor/packet.h
+++ b/monitor/packet.h
void packet_new_index(struct timeval *tv, uint16_t index, const char *label,
uint8_t type, uint8_t bus, const char *name);
void packet_del_index(struct timeval *tv, uint16_t index, const char *label);
+void packet_open_index(struct timeval *tv, uint16_t index, const char *label);
+void packet_close_index(struct timeval *tv, uint16_t index, const char *label);
void packet_hci_command(struct timeval *tv, uint16_t index,
const void *data, uint16_t size);
diff --git a/src/shared/btsnoop.c b/src/shared/btsnoop.c
index 3592c2e..2aa1b8d 100644
--- a/src/shared/btsnoop.c
+++ b/src/shared/btsnoop.c
case BTSNOOP_OPCODE_SCO_TX_PKT:
case BTSNOOP_OPCODE_SCO_RX_PKT:
break;
+ case BTSNOOP_OPCODE_OPEN_INDEX:
+ case BTSNOOP_OPCODE_CLOSE_INDEX:
+ break;
}
return 0xff;
diff --git a/src/shared/btsnoop.h b/src/shared/btsnoop.h
index 9675980..552337b 100644
--- a/src/shared/btsnoop.h
+++ b/src/shared/btsnoop.h
#define BTSNOOP_OPCODE_ACL_RX_PKT 5
#define BTSNOOP_OPCODE_SCO_TX_PKT 6
#define BTSNOOP_OPCODE_SCO_RX_PKT 7
+#define BTSNOOP_OPCODE_OPEN_INDEX 8
+#define BTSNOOP_OPCODE_CLOSE_INDEX 9
#define BTSNOOP_MAX_PACKET_SIZE (1486 + 4)