monitor: Add support for decoding Configure Data Path
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Tue, 2 Mar 2021 22:49:57 +0000 (14:49 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
< HCI Command: Configure Data Path (0x03|0x0083) plen 3
        Direction: Input (Host to Controller) (0x00)
        ID: 0
        Vendor Specific Config Length: 0
        Vendor Specific Config:
> HCI Event: Command Complete (0x0e) plen 4
      Configure Data Path (0x03|0x0083) ncmd 1
        Status: Success (0x00)

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 3c62185..53f35c7 100755 (executable)
@@ -1692,6 +1692,15 @@ struct bt_hci_cmd_write_ext_inquiry_length {
        uint16_t interval;
 } __attribute__ ((packed));
 
+#define BT_HCI_CMD_CONFIG_DATA_PATH            0x0c83
+#define BT_HCI_BIT_CONFIG_DATA_PATH            BT_HCI_CMD_BIT(45, 5)
+struct bt_hci_cmd_config_data_path {
+       uint8_t  dir;
+       uint8_t  id;
+       uint8_t  vnd_config_len;
+       uint8_t  vnd_config[0];
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_READ_LOCAL_VERSION          0x1001
 struct bt_hci_rsp_read_local_version {
        uint8_t  status;
index 0ab4a83..d59e0d3 100755 (executable)
@@ -6055,6 +6055,17 @@ static void read_local_ctrl_delay_cmd(const void *data, uint8_t size)
        print_field("Length Codec Configuration: %u", cmd->codec_cfg_len);
 }
 
+static void config_data_path_cmd(const void *data, uint8_t size)
+{
+       const struct bt_hci_cmd_config_data_path *cmd = data;
+
+       print_path_direction("Direction", cmd->dir);
+       print_field("ID: %u", cmd->id);
+       print_field("Vendor Specific Config Length: %u", cmd->vnd_config_len);
+       print_hex_field("Vendor Specific Config", cmd->vnd_config,
+                                               cmd->vnd_config_len);
+}
+
 static void print_usec_interval(const char *prefix, const uint8_t interval[3])
 {
        uint32_t u24 = 0;
@@ -8838,6 +8849,12 @@ static const struct opcode_data opcode_table[] = {
                read_local_ctrl_delay_rsp,
                sizeof(struct bt_hci_rsp_read_local_ctrl_delay), true
        },
+       { BT_HCI_CMD_CONFIG_DATA_PATH, BT_HCI_BIT_CONFIG_DATA_PATH,
+               "Configure Data Path",
+               config_data_path_cmd,
+               sizeof(struct bt_hci_cmd_config_data_path), false,
+               status_rsp, 1, true
+       },
 
        /* OGF 5 - Status Parameter */
        { 0x1401, 122, "Read Failed Contact Counter",