From 70e6a4a9064a8debf8881880b04e64ea281ea5f4 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Tue, 2 Mar 2021 14:49:57 -0800 Subject: [PATCH] monitor: Add support for decoding Configure Data Path < 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) --- monitor/bt.h | 9 +++++++++ monitor/packet.c | 17 +++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/monitor/bt.h b/monitor/bt.h index 7d865c9ae..ac4f976fc 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -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; diff --git a/monitor/packet.c b/monitor/packet.c index acec32b72..fb265028c 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -6061,6 +6061,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; @@ -8844,6 +8855,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", -- 2.47.3