From 1284446b5fba6e8a809155611b8a1e673ad7d486 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 --- monitor/bt.h | 7 +++++++ monitor/packet.c | 12 ++++++++++++ 2 files changed, 19 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index d989f5b94..60939650e 100644 --- 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 994ae6341..97ae58e69 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -5895,6 +5895,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; @@ -8620,6 +8629,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.47.3