monitor: Add support for Read Local Simple Pairing Options command
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 30 Mar 2020 18:24:06 +0000 (20:24 +0200)
committerAyush Garg <ayush.garg@samsung.com>
Mon, 12 Apr 2021 09:00:48 +0000 (14:30 +0530)
Signed-off-by: Anuj Jain <anuj01.jain@samsung.com>
Signed-off-by: Ayush Garg <ayush.garg@samsung.com>
monitor/bt.h
monitor/packet.c

index 14d9f70..de8cdf9 100755 (executable)
@@ -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;
index b9acf34..da9a464 100755 (executable)
@@ -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",