Diff between 61850ffc9624d175af2a55b82a37060ea4bfd4d0 and e07c4e5765e65b21d3a9ce16bb28dd9c384b10f4

Changed Files

File Additions Deletions Status
monitor/bt.h +10 -0 modified
monitor/packet.c +42 -1 modified

Full Patch

diff --git a/monitor/bt.h b/monitor/bt.h
index 5914041..2aec950 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -946,6 +946,16 @@ struct bt_hci_cmd_enhanced_flush {
 	uint8_t  type;
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_SEND_KEYPRESS_NOTIFY		0x0c60
+struct bt_hci_cmd_send_keypress_notify {
+	uint8_t  bdaddr[6];
+	uint8_t  type;
+} __attribute__ ((packed));
+struct bt_hci_rsp_send_keypress_notify {
+	uint8_t  status;
+	uint8_t  bdaddr[6];
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_SET_EVENT_MASK_PAGE2		0x0c63
 struct bt_hci_cmd_set_event_mask_page2 {
 	uint8_t  mask[8];
diff --git a/monitor/packet.c b/monitor/packet.c
index 07028e7..5721988 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -4071,6 +4071,45 @@ static void enhanced_flush_cmd(const void *data, uint8_t size)
 	print_field("Type: %s (0x%2.2x)", str, cmd->type);
 }
 
+static void send_keypress_notify_cmd(const void *data, uint8_t size)
+{
+	const struct bt_hci_cmd_send_keypress_notify *cmd = data;
+	const char *str;
+
+	print_bdaddr(cmd->bdaddr);
+
+	switch (cmd->type) {
+	case 0x00:
+		str = "Passkey entry started";
+		break;
+	case 0x01:
+		str = "Passkey digit entered";
+		break;
+	case 0x02:
+		str = "Passkey digit erased";
+		break;
+	case 0x03:
+		str = "Passkey cleared";
+		break;
+	case 0x04:
+		str = "Passkey entry completed";
+		break;
+	default:
+		str = "Reserved";
+		break;
+	}
+
+	print_field("Type: %s (0x%2.2x)", str, cmd->type);
+}
+
+static void send_keypress_notify_rsp(const void *data, uint8_t size)
+{
+	const struct bt_hci_rsp_send_keypress_notify *rsp = data;
+
+	print_status(rsp->status);
+	print_bdaddr(rsp->bdaddr);
+}
+
 static void set_event_mask_page2_cmd(const void *data, uint8_t size)
 {
 	const struct bt_hci_cmd_set_event_mask_page2 *cmd = data;
@@ -5262,7 +5301,9 @@ static const struct opcode_data opcode_table[] = {
 	{ 0x0c5b, 147, "Write Default Erroneous Reporting" },
 	{ 0x0c5f, 158, "Enhanced Flush",
 				enhanced_flush_cmd, 3, true },
-	{ 0x0c60, 162, "Send Keypress Notification" },
+	{ 0x0c60, 162, "Send Keypress Notification",
+				send_keypress_notify_cmd, 7, true,
+				send_keypress_notify_rsp, 7, true },
 	{ 0x0c61, 176, "Read Logical Link Accept Timeout" },
 	{ 0x0c62, 177, "Write Logical Link Accept Timeout" },
 	{ 0x0c63, 178, "Set Event Mask Page 2",