From 7ee2a4ba9bcb1ea89440bd0cf5c2227a0d55ac2f Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 30 Mar 2020 20:24:06 +0200 Subject: [PATCH] monitor: Add support for Read Local Simple Pairing Options command Signed-off-by: Anuj Jain Signed-off-by: Ayush Garg --- monitor/bt.h | 7 +++++++ monitor/packet.c | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index 14d9f70..de8cdf9 100755 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -1778,6 +1778,13 @@ struct bt_hci_rsp_read_local_codecs { uint8_t codec[0]; } __attribute__ ((packed)); +#define BT_HCI_CMD_READ_LOCAL_PAIRING_OPTIONS 0x100c +struct bt_hci_rsp_read_local_pairing_options { + uint8_t status; + uint8_t pairing_options; + uint8_t max_key_size; +} __attribute__ ((packed)); + #define BT_HCI_CMD_READ_FAILED_CONTACT_COUNTER 0x1401 struct bt_hci_cmd_read_failed_contact_counter { uint16_t handle; diff --git a/monitor/packet.c b/monitor/packet.c index b9acf34..da9a464 100755 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -5889,6 +5889,15 @@ static void read_local_codecs_rsp(const void *data, uint8_t size) size - rsp->num_codecs - 3); } +static void read_local_pairing_options_rsp(const void *data, uint8_t size) +{ + const struct bt_hci_rsp_read_local_pairing_options *rsp = data; + + print_status(rsp->status); + print_field("Pairing options: 0x%2.2x", rsp->pairing_options); + print_field("Max encryption key size: %u octets", rsp->max_key_size); +} + static void read_failed_contact_counter_cmd(const void *data, uint8_t size) { const struct bt_hci_cmd_read_failed_contact_counter *cmd = data; @@ -8614,6 +8623,9 @@ static const struct opcode_data opcode_table[] = { { 0x100b, 237, "Read Local Supported Codecs", null_cmd, 0, true, read_local_codecs_rsp, 3, false }, + { 0x100c, 331, "Read Local Simple Pairing Options", + null_cmd, 0, true, + read_local_pairing_options_rsp, 3, true }, /* OGF 5 - Status Parameter */ { 0x1401, 122, "Read Failed Contact Counter", -- 2.7.4