From 6b9566be63dc5c625312af221bffe33a544f71d0 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 7 Jun 2013 12:15:23 +0700 Subject: [PATCH] monitor: Add HCI LTK request reply command decoding --- monitor/bt.h | 6 ++++++ monitor/packet.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/monitor/bt.h b/monitor/bt.h index 7bd439fbb..1de9b8bc9 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -969,6 +969,12 @@ struct bt_hci_cmd_le_start_encrypt { uint8_t ltk[16]; } __attribute__ ((packed)); +#define BT_HCI_CMD_LE_LTK_REQ_REPLY 0x201a +struct bt_hci_cmd_le_ltk_req_reply { + uint16_t handle; + 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 057f3f6c1..7708c3026 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -3716,6 +3716,15 @@ static void le_start_encrypt(const void *data, uint8_t size) } +static void le_ltk_req_reply(const void *data, uint8_t size) +{ + const struct bt_hci_cmd_le_ltk_req_reply *cmd = data; + + print_handle(cmd->handle); + 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; @@ -4221,7 +4230,8 @@ static const struct opcode_data opcode_table[] = { le_rand_rsp, 9, true }, { 0x2019, 224, "LE Start Encryption", le_start_encrypt, 28, true }, - { 0x201a, 225, "LE Long Term Key Request Reply" }, + { 0x201a, 225, "LE Long Term Key Request Reply", + le_ltk_req_reply, 18, true }, { 0x201b, 226, "LE Long Term Key Request Neg Reply" }, { 0x201c, 227, "LE Read Supported States", null_cmd, 0, true, -- 2.47.3