monitor: Fix decoding of LE Remove CIG
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Fri, 11 Sep 2020 20:07:57 +0000 (13:07 -0700)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:32 +0000 (19:08 +0530)
HCI_LE_Remove_CIG does actually returns the CIG_ID in addition to the
status.

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 5a99f54..6006635 100755 (executable)
@@ -2667,6 +2667,11 @@ struct bt_hci_cmd_le_remove_cig {
        uint8_t  cig_id;
 } __attribute__ ((packed));
 
+struct bt_hci_rsp_le_remove_cig {
+       uint8_t  status;
+       uint8_t  cig_id;
+} __attribute__ ((packed));
+
 #define BT_HCI_CMD_LE_ACCEPT_CIS               0x2066
 #define BT_HCI_BIT_LE_ACCEPT_CIS               BT_HCI_CMD_BIT(42, 3)
 struct bt_hci_cmd_le_accept_cis {
index a992b2e..6e14bd9 100755 (executable)
@@ -7955,6 +7955,18 @@ static void le_remove_cig_cmd(const void *data, uint8_t size)
        print_field("CIG ID: 0x%02x", cmd->cig_id);
 }
 
+static void le_remove_cig_rsp(const void *data, uint8_t size)
+{
+       const struct bt_hci_rsp_le_remove_cig *rsp = data;
+
+       print_status(rsp->status);
+
+       if (size == 1)
+               return;
+
+       print_field("CIG ID: 0x%2.2x", rsp->cig_id);
+}
+
 static void le_accept_cis_req_cmd(const void *data, uint8_t size)
 {
        const struct bt_hci_cmd_le_accept_cis *cmd = data;
@@ -9018,7 +9030,9 @@ static const struct opcode_data opcode_table[] = {
                                "LE Remove Connected Isochronous Group",
                                le_remove_cig_cmd,
                                sizeof(struct bt_hci_cmd_le_remove_cig), false,
-                               status_rsp, 1, true },
+                               le_remove_cig_rsp,
+                               sizeof(struct bt_hci_rsp_le_remove_cig),
+                               false },
        { BT_HCI_CMD_LE_ACCEPT_CIS, BT_HCI_BIT_LE_ACCEPT_CIS,
                                "LE Accept Connected Isochronous Stream Request",
                                le_accept_cis_req_cmd,