From 81b3f4e6ea84b8563eee84accff9a71f845bbf4a Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Wed, 13 May 2020 14:05:01 -0700 Subject: [PATCH] monitor: Fix parsing of LE Setup ISO Data Path response LE Setup ISO Data Path response actually contains the handle in addition to the status: > HCI Event: Command Complete (0x0e) plen 6 LE Setup Isochronous Data Path (0x08|0x006e) ncmd 1 Status: Success (0x00) Handle: 44 --- monitor/bt.h | 5 +++++ monitor/packet.c | 16 +++++++++++++++- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/monitor/bt.h b/monitor/bt.h index 3f854c3a2..e8a1d93c9 100644 --- a/monitor/bt.h +++ b/monitor/bt.h @@ -2776,6 +2776,11 @@ struct bt_hci_cmd_le_setup_iso_path { uint8_t codec_cfg[0]; } __attribute__ ((packed)); +struct bt_hci_rsp_le_setup_iso_path { + uint8_t status; + uint16_t handle; +} __attribute__ ((packed)); + #define BT_HCI_CMD_LE_REMOVE_ISO_PATH 0x206f #define BT_HCI_BIT_LE_REMOVE_ISO_PATH BT_HCI_CMD_BIT(43, 4) struct bt_hci_cmd_le_remove_iso_path { diff --git a/monitor/packet.c b/monitor/packet.c index 22588a3eb..3b9c06512 100644 --- a/monitor/packet.c +++ b/monitor/packet.c @@ -8125,6 +8125,18 @@ static void le_setup_iso_path_cmd(const void *data, uint8_t size) cmd->codec_cfg_len); } +static void le_setup_iso_path_rsp(const void *data, uint8_t size) +{ + const struct bt_hci_rsp_le_setup_iso_path *rsp = data; + + print_status(rsp->status); + + if (size == 1) + return; + + print_field("Handle: %d", le16_to_cpu(rsp->handle)); +} + static void le_remove_iso_path_cmd(const void *data, uint8_t size) { const struct bt_hci_cmd_le_remove_iso_path *cmd = data; @@ -9050,7 +9062,9 @@ static const struct opcode_data opcode_table[] = { "LE Setup Isochronous Data Path", le_setup_iso_path_cmd, sizeof(struct bt_hci_cmd_le_setup_iso_path), - true, status_rsp, 1, true }, + true, le_setup_iso_path_rsp, + sizeof(struct bt_hci_rsp_le_setup_iso_path), + true }, { BT_HCI_CMD_LE_REMOVE_ISO_PATH, BT_HCI_BIT_LE_REMOVE_ISO_PATH, "LE Remove Isochronous Data Path", le_remove_iso_path_cmd, -- 2.47.3