Diff between c7e4949b63cb3d30d5ecf159b388edd71ca95d25 and 71d6558c19b647e30411d488b3983b4f9f67e149

Changed Files

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

Full Patch

diff --git a/monitor/bt.h b/monitor/bt.h
index f646458..7bb82e7 100644
--- a/monitor/bt.h
+++ b/monitor/bt.h
@@ -786,6 +786,14 @@ struct bt_hci_rsp_le_rand {
 	uint8_t  number[8];
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_LE_START_ENCRYPT		0x2019
+struct bt_hci_cmd_le_start_encrypt {
+	uint16_t handle;
+	uint8_t  number[8];
+	uint16_t diversifier;
+	uint8_t  ltk[16];
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_LE_READ_SUPPORTED_STATES	0x201c
 struct bt_hci_rsp_le_read_supported_states {
 	uint8_t  status;
diff --git a/monitor/packet.c b/monitor/packet.c
index c50d2da..f5d1c17 100644
--- a/monitor/packet.c
+++ b/monitor/packet.c
@@ -2252,6 +2252,18 @@ static void le_rand_rsp(const void *data, uint8_t size)
 	print_random_number(rsp->number);
 }
 
+static void le_start_encrypt(const void *data, uint8_t size)
+{
+	const struct bt_hci_cmd_le_start_encrypt *cmd = data;
+
+	print_handle(cmd->handle);
+	print_random_number(cmd->number);
+	print_field("Encryption diversifier: 0x%4.4x",
+					btohs(cmd->diversifier));
+	print_key("Long term key", cmd->ltk);
+
+}
+
 static void le_read_supported_states_rsp(const void *data, uint8_t size)
 {
 	const struct bt_hci_rsp_le_read_supported_states *rsp = data;
@@ -2679,7 +2691,8 @@ static const struct opcode_data opcode_table[] = {
 	{ 0x2018, "LE Rand",
 				null_cmd, 0, true,
 				le_rand_rsp, 9, true },
-	{ 0x2019, "LE Start Encryption"			},
+	{ 0x2019, "LE Start Encryption",
+				le_start_encrypt, 28, true },
 	{ 0x201a, "LE Long Term Key Request Reply"	},
 	{ 0x201b, "LE Long Term Key Request Neg Reply"	},
 	{ 0x201c, "LE Read Supported States",