monitor: Fix BIG Create Sync decoding
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Mon, 1 Mar 2021 22:15:25 +0000 (14:15 -0800)
committerAyush Garg <ayush.garg@samsung.com>
Fri, 11 Mar 2022 13:38:34 +0000 (19:08 +0530)
Number of Bis is actually at the end of the PDU, also avoid prefixing with
big when it is implied by the struct name.

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 31f055d..a875279 100755 (executable)
@@ -2731,13 +2731,13 @@ struct bt_hci_bis_sync {
 } __attribute__ ((packed));
 
 struct bt_hci_cmd_le_big_create_sync {
-       uint8_t  big_id;
+       uint8_t  handle;
        uint16_t sync_handle;
-       uint8_t  num_bis;
        uint8_t  encryption;
        uint8_t  bcode[16];
        uint8_t  mse;
        uint16_t timeout;
+       uint8_t  num_bis;
        struct bt_hci_bis_sync bis[0];
 } __attribute__ ((packed));
 
index c415c9b..518bdcd 100755 (executable)
@@ -8053,13 +8053,16 @@ static void le_big_create_sync_cmd(const void *data, uint8_t size)
 {
        const struct bt_hci_cmd_le_big_create_sync *cmd = data;
 
-       print_field("BIG ID: 0x%2.2x", cmd->big_id);
-       print_field("Number of BIS: %u", cmd->num_bis);
-       print_field("Encryption: 0x%2.2x", cmd->encryption);
+       print_field("BIG Handle: 0x%2.2x", cmd->handle);
+       print_field("BIG Sync Handle: 0x%4.4x", le16_to_cpu(cmd->sync_handle));
+       print_field("Encryption: %s (0x%2.2x)",
+                       cmd->encryption ? "Unencrypted" : "Encrypted",
+                       cmd->encryption);
        print_hex_field("Broadcast Code", cmd->bcode, 16);
-       print_field("Number Subevents: 0x%2.2x", cmd->mse);
+       print_field("Maximum Number Subevents: 0x%2.2x", cmd->mse);
        print_field("Timeout: %d ms (0x%4.4x)", le16_to_cpu(cmd->timeout) * 10,
                                        le16_to_cpu(cmd->timeout));
+       print_field("Number of BIS: %u", cmd->num_bis);
 
        size -= sizeof(*cmd);