Bluetooth: ISO: Add bitmask for retrieving iso header lenght

Add a macro to retrieve the iso data load length (the
length stored in the iso header) with a bit mask that
ensures that we only take the first 14 bits.

This is to remove any RFU bits that may have been set.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2021-11-10 14:45:23 +01:00 committed by Carles Cufí
commit 12decc70d0
8 changed files with 11 additions and 9 deletions

View file

@ -74,6 +74,7 @@ struct bt_hci_acl_hdr {
(((pb) & 0x0003) | (((ts) & 0x0001) << 2))
#define bt_iso_handle_pack(h, pb, ts) \
((h) | (bt_iso_pack_flags(pb, ts) << 12))
#define bt_iso_hdr_len(h) ((h) & BIT_MASK(14))
#define BT_ISO_DATA_VALID 0x00
#define BT_ISO_DATA_INVALID 0x01
@ -96,8 +97,8 @@ struct bt_hci_iso_ts_data_hdr {
#define BT_HCI_ISO_TS_DATA_HDR_SIZE 8
struct bt_hci_iso_hdr {
uint16_t handle;
uint16_t len;
uint16_t handle; /* 12 bit handle, 2 bit PB flags, 1 bit TS_Flag, 1 bit RFU */
uint16_t len; /* 14 bits, 2 bits RFU */
} __packed;
#define BT_HCI_ISO_HDR_SIZE 4