12#ifndef ZEPHYR_INCLUDE_BLUETOOTH_ISO_H_
13#define ZEPHYR_INCLUDE_BLUETOOTH_ISO_H_
46#define BT_ISO_CHAN_SEND_RESERVE BT_BUF_ISO_SIZE(0)
56#define BT_ISO_SDU_BUF_SIZE(mtu) BT_BUF_ISO_SIZE(mtu)
66#define BT_ISO_BIS_INDEX_BIT(x) (BIT((x) - 1))
69#define BT_ISO_DATA_PATH_HCI 0x00
72#define BT_ISO_SDU_INTERVAL_UNKNOWN 0x000000U
74#define BT_ISO_SDU_INTERVAL_MIN 0x0000FFU
76#define BT_ISO_SDU_INTERVAL_MAX 0x0FFFFFU
78#define BT_ISO_ISO_INTERVAL_MIN 0x0004U
80#define BT_ISO_ISO_INTERVAL_MAX 0x0C80U
82#define BT_ISO_LATENCY_MIN 0x0005
84#define BT_ISO_LATENCY_MAX 0x0FA0
86#define BT_ISO_PACKING_SEQUENTIAL 0x00
88#define BT_ISO_PACKING_INTERLEAVED 0x01
90#define BT_ISO_FRAMING_UNFRAMED 0x00
92#define BT_ISO_FRAMING_FRAMED 0x01
94#define BT_ISO_MAX_GROUP_ISO_COUNT 0x1F
96#define BT_ISO_MIN_SDU 0x0001
98#define BT_ISO_MAX_SDU 0x0FFF
100#define BT_ISO_CONNECTED_PDU_MIN 0x0000U
102#define BT_ISO_BROADCAST_PDU_MIN 0x0001U
104#define BT_ISO_PDU_MAX 0x00FBU
106#define BT_ISO_BN_MIN 0x01U
108#define BT_ISO_BN_MAX 0x0FU
110#define BT_ISO_FT_MIN 0x01U
112#define BT_ISO_FT_MAX 0xFFU
114#define BT_ISO_NSE_MIN 0x01U
116#define BT_ISO_NSE_MAX 0x1FU
118#define BT_ISO_SYNC_TIMEOUT_MIN 0x000A
120#define BT_ISO_SYNC_TIMEOUT_MAX 0x4000
122#define BT_ISO_SYNC_MSE_ANY 0x00
124#define BT_ISO_SYNC_MSE_MIN 0x01
126#define BT_ISO_SYNC_MSE_MAX 0x1F
128#define BT_ISO_CONNECTED_RTN_MAX 0xFF
130#define BT_ISO_BROADCAST_RTN_MAX 0x1E
132#define BT_ISO_BROADCAST_CODE_SIZE 16
134#define BT_ISO_BIS_INDEX_MIN 0x01
136#define BT_ISO_BIS_INDEX_MAX 0x1F
138#define BT_ISO_IRC_MIN 0x01U
140#define BT_ISO_IRC_MAX 0x0FU
142#define BT_ISO_PTO_MIN 0x00U
144#define BT_ISO_PTO_MAX 0x0FU
146#define BT_ISO_SUBINTERVAL_NONE 0x00000000U
148#define BT_ISO_SUBINTERVAL_UNKNOWN 0xFFFFFFFFU
155#define BT_ISO_VALID_BIS_BITFIELD(_bis_bitfield) \
156 ((_bis_bitfield) != 0U && (_bis_bitfield) <= BIT_MASK(BT_ISO_BIS_INDEX_MAX))
196#if (defined(CONFIG_BT_SMP) && defined(CONFIG_BT_ISO_UNICAST)) || defined(__DOXYGEN__)
241#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
282#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
435#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
538#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
759#if defined(CONFIG_BT_SMP) || defined(__DOXYGEN__)
1084#if defined(CONFIG_BT_ISO_UNICAST) || defined(__DOXYGEN__)
1090#if defined(CONFIG_BT_ISO_BROADCASTER) || defined(__DOXYGEN__)
1096#if defined(CONFIG_BT_ISO_SYNC_RECEIVER) || defined(__DOXYGEN__)
1180 struct bt_iso_big **out_big);
1201 struct bt_iso_big **out_big);
Bluetooth device address definitions and utilities.
Bluetooth subsystem core APIs.
Bluetooth data buffer API.
Bluetooth connection handling.
bt_security_t
Security level.
Definition conn.h:809
int bt_iso_chan_send(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq_num)
Send data to ISO channel without timestamp.
int bt_iso_server_unregister(struct bt_iso_server *server)
Unregister ISO server.
#define BT_ISO_BROADCAST_CODE_SIZE
Broadcast code size.
Definition iso.h:132
int bt_iso_chan_get_info(const struct bt_iso_chan *chan, struct bt_iso_info *info)
Get ISO channel info.
int bt_iso_big_sync(struct bt_le_per_adv_sync *sync, struct bt_iso_big_sync_param *param, struct bt_iso_big **out_big)
Creates a BIG as a receiver.
int bt_iso_big_register_cb(struct bt_iso_big_cb *cb)
Registers callbacks for Broadcast Sources.
int bt_iso_chan_disconnect(struct bt_iso_chan *chan)
Disconnect connected ISO channel.
int bt_iso_chan_connect(const struct bt_iso_connect_param *param, size_t count)
Connect ISO channels on ACL connections.
int bt_iso_cig_reconfigure(struct bt_iso_cig *cig, const struct bt_iso_cig_param *param)
Reconfigure a CIG as a central.
int bt_iso_chan_get_tx_sync(const struct bt_iso_chan *chan, struct bt_iso_tx_info *info)
Get ISO transmission timing info.
int bt_iso_chan_send_ts(struct bt_iso_chan *chan, struct net_buf *buf, uint16_t seq_num, uint32_t ts)
Send data to ISO channel with timestamp.
int bt_iso_big_terminate(struct bt_iso_big *big)
Terminates a BIG as a broadcaster or receiver.
int bt_iso_big_create(struct bt_le_ext_adv *padv, struct bt_iso_big_create_param *param, struct bt_iso_big **out_big)
Creates a BIG as a broadcaster.
int bt_iso_cig_terminate(struct bt_iso_cig *cig)
Terminates a CIG as a central.
int bt_iso_cig_create(const struct bt_iso_cig_param *param, struct bt_iso_cig **out_cig)
Creates a CIG as a central.
bt_iso_state
Life-span states of ISO channel.
Definition iso.h:162
bt_iso_chan_type
ISO Channel Type.
Definition iso.h:179
int bt_iso_server_register(struct bt_iso_server *server)
Register ISO server.
@ BT_ISO_FLAGS_VALID
The ISO packet is valid.
Definition iso.h:315
@ BT_ISO_FLAGS_LOST
The ISO packet was lost.
Definition iso.h:325
@ BT_ISO_FLAGS_ERROR
The ISO packet may possibly contain errors.
Definition iso.h:322
@ BT_ISO_FLAGS_TS
Timestamp is valid.
Definition iso.h:333
@ BT_ISO_STATE_ENCRYPT_PENDING
Channel is pending ACL encryption before connecting.
Definition iso.h:166
@ BT_ISO_STATE_CONNECTING
Channel in connecting state.
Definition iso.h:168
@ BT_ISO_STATE_CONNECTED
Channel ready for upper layer traffic on it.
Definition iso.h:170
@ BT_ISO_STATE_DISCONNECTING
Channel in disconnecting state.
Definition iso.h:172
@ BT_ISO_STATE_DISCONNECTED
Channel disconnected.
Definition iso.h:164
@ BT_ISO_CHAN_TYPE_NONE
No channel type.
Definition iso.h:180
@ BT_ISO_CHAN_TYPE_BROADCASTER
Isochronous broadcaster.
Definition iso.h:182
@ BT_ISO_CHAN_TYPE_SYNC_RECEIVER
Synchronized receiver.
Definition iso.h:183
@ BT_ISO_CHAN_TYPE_CONNECTED
Connected.
Definition iso.h:181
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Bluetooth LE Device Address.
Definition addr.h:49
ISO Accept Info Structure.
Definition iso.h:738
struct bt_conn * acl
The ACL connection that is requesting authorization.
Definition iso.h:740
uint8_t cis_id
The ID of the connected isochronous stream (CIS) on the central.
Definition iso.h:754
uint8_t cig_id
The ID of the connected isochronous group (CIG) on the central.
Definition iso.h:747
Struct to hold the Broadcast Isochronous Group callbacks.
Definition iso.h:1137
void(* stopped)(struct bt_iso_big *big, uint8_t reason)
The BIG has stopped and none of the streams are ready for data.
Definition iso.h:1151
void(* started)(struct bt_iso_big *big)
The BIG has started and all of the streams are ready for data.
Definition iso.h:1143
Broadcast Isochronous Group (BIG) creation parameters.
Definition iso.h:480
bool encryption
Whether or not to encrypt the streams.
Definition iso.h:522
uint16_t iso_interval
ISO interval.
Definition iso.h:564
struct bt_iso_chan ** bis_channels
Array of pointers to BIS channels.
Definition iso.h:482
uint32_t interval
Channel interval in us.
Definition iso.h:496
uint8_t num_bis
Number of channels in bis_channels.
Definition iso.h:489
uint8_t framing
Channel framing mode.
Definition iso.h:519
uint8_t bcode[16]
Broadcast code.
Definition iso.h:536
uint16_t latency
Channel Latency in ms.
Definition iso.h:505
uint8_t packing
Channel packing mode.
Definition iso.h:512
uint8_t irc
Immediate Repetition Count.
Definition iso.h:546
uint8_t pto
Pre-transmission offset.
Definition iso.h:555
Broadcast Isochronous Group (BIG) Sync Parameters.
Definition iso.h:569
uint32_t bis_bitfield
Bitfield of the BISes to sync to.
Definition iso.h:588
uint32_t mse
Maximum subevents.
Definition iso.h:600
uint16_t sync_timeout
Synchronization timeout for the BIG (N * 10 MS)
Definition iso.h:607
bool encryption
Whether or not the streams of the BIG are encrypted.
Definition iso.h:610
uint8_t num_bis
Number channels in bis_channels.
Definition iso.h:578
uint8_t bcode[16]
Broadcast code.
Definition iso.h:624
struct bt_iso_chan ** bis_channels
Array of pointers to BIS channels.
Definition iso.h:571
Broadcast Isochronous Group (BIG) information.
Definition iso.h:628
uint8_t framing
Channel framing mode.
Definition iso.h:666
uint8_t num_bis
Number of BISes in the BIG.
Definition iso.h:636
uint8_t sub_evt_count
Maximum number of subevents in each isochronous event.
Definition iso.h:639
uint8_t phy
Channel PHY.
Definition iso.h:663
uint32_t sdu_interval
The interval, in microseconds, of periodic SDUs.
Definition iso.h:657
uint8_t offset
Offset used for pre-transmissions.
Definition iso.h:648
uint8_t sid
Advertiser SID.
Definition iso.h:633
bool encryption
Whether or not the BIG is encrypted.
Definition iso.h:669
uint8_t rep_count
The number of times a payload is transmitted in a BIS event.
Definition iso.h:651
uint16_t max_sdu
Maximum size of an SDU, in octets.
Definition iso.h:660
const bt_addr_le_t * addr
Address of the advertiser.
Definition iso.h:630
uint8_t burst_number
The number of new payloads in each BIS event.
Definition iso.h:645
uint16_t max_pdu
Maximum size, in octets, of the payload.
Definition iso.h:654
uint16_t iso_interval
Interval between two BIG anchor point (N * 1.25 ms)
Definition iso.h:642
ISO Broadcaster Info Structure.
Definition iso.h:1014
uint8_t phy
The transport PHY
Definition iso.h:1028
uint32_t sync_delay
The maximum time in us for all PDUs of all BIS in a BIG event.
Definition iso.h:1016
uint32_t latency
The transport latency in us.
Definition iso.h:1019
uint32_t pto
Pre-transmission offset (N * 1.25 ms)
Definition iso.h:1022
uint16_t max_pdu
The maximum PDU size in octets.
Definition iso.h:1025
uint8_t bn
The burst number.
Definition iso.h:1031
uint8_t irc
Number of times a payload is transmitted in a BIS event.
Definition iso.h:1034
ISO Channel IO QoS structure.
Definition iso.h:214
uint8_t phy
Channel PHY - See the BT_GAP_LE_PHY_* values.
Definition iso.h:226
uint8_t rtn
Channel Retransmission Number.
Definition iso.h:232
struct bt_iso_chan_path * path
Channel data path reference.
Definition iso.h:239
uint8_t burst_number
Burst number.
Definition iso.h:258
uint16_t sdu
Channel SDU.
Definition iso.h:220
uint16_t max_pdu
Maximum PDU size.
Definition iso.h:251
ISO Channel operations structure.
Definition iso.h:673
void(* sent)(struct bt_iso_chan *chan)
Channel sent callback.
Definition iso.h:734
void(* disconnected)(struct bt_iso_chan *chan, uint8_t reason)
Channel disconnected callback.
Definition iso.h:697
void(* connected)(struct bt_iso_chan *chan)
Channel connected callback.
Definition iso.h:685
void(* recv)(struct bt_iso_chan *chan, const struct bt_iso_recv_info *info, struct net_buf *buf)
Channel recv callback.
Definition iso.h:721
ISO Channel Data Path structure.
Definition iso.h:295
uint8_t cc_len
Codec Configuration length.
Definition iso.h:307
uint8_t format
Coding Format.
Definition iso.h:299
uint8_t pid
Default path ID.
Definition iso.h:297
uint16_t cid
Company ID.
Definition iso.h:301
uint8_t * cc
Pointer to an array containing the Codec Configuration.
Definition iso.h:309
uint32_t delay
Controller Delay.
Definition iso.h:305
uint16_t vid
Vendor-defined Codec ID.
Definition iso.h:303
ISO Channel QoS structure.
Definition iso.h:263
struct bt_iso_chan_io_qos * tx
Channel Transmission QoS.
Definition iso.h:280
uint8_t num_subevents
Number of subevents.
Definition iso.h:290
struct bt_iso_chan_io_qos * rx
Channel Receiving QoS.
Definition iso.h:271
ISO Channel structure.
Definition iso.h:187
struct bt_iso_chan_ops * ops
Channel operations reference.
Definition iso.h:191
enum bt_iso_state state
Channel state.
Definition iso.h:195
bt_security_t required_sec_level
The required security level of the channel.
Definition iso.h:207
struct bt_conn * iso
Channel connection reference.
Definition iso.h:189
sys_snode_t node
Definition iso.h:210
struct bt_iso_chan_qos * qos
Channel QoS reference.
Definition iso.h:193
Connected Isochronous Group (CIG) parameters.
Definition iso.h:369
uint32_t p_to_c_interval
Channel interval in us for SDUs sent from Peripheral to Central.
Definition iso.h:392
uint8_t packing
Channel packing mode.
Definition iso.h:426
uint8_t framing
Channel framing mode.
Definition iso.h:433
uint8_t num_cis
Number of channels in cis_channels.
Definition iso.h:378
uint8_t sca
Channel peripherals sleep clock accuracy Only for CIS.
Definition iso.h:419
struct bt_iso_chan ** cis_channels
Array of pointers to CIS channels.
Definition iso.h:371
uint16_t iso_interval
ISO interval.
Definition iso.h:463
uint8_t c_to_p_ft
Central to Peripheral flush timeout.
Definition iso.h:444
uint8_t p_to_c_ft
Peripheral to Central flush timeout.
Definition iso.h:454
uint16_t p_to_c_latency
Channel Latency in ms for SDUs sent from Peripheral to Central.
Definition iso.h:410
uint32_t c_to_p_interval
Channel interval in us for SDUs sent from Central to Peripheral.
Definition iso.h:385
uint16_t c_to_p_latency
Channel Latency in ms for SDUs sent from Central to Peripheral.
Definition iso.h:401
ISO connection parameters structure.
Definition iso.h:468
struct bt_conn * acl
The ACL connection.
Definition iso.h:473
struct bt_iso_chan * iso_chan
The ISO channel to connect.
Definition iso.h:470
ISO channel Info Structure.
Definition iso.h:1056
uint8_t max_subevent
The maximum number of subevents in each ISO event.
Definition iso.h:1064
struct bt_iso_unicast_info unicast
Unicast specific Info.
Definition iso.h:1088
bool can_send
True if the channel is able to send data.
Definition iso.h:1072
uint16_t iso_interval
The ISO interval (N * 1.25 ms)
Definition iso.h:1061
struct bt_iso_broadcaster_info broadcaster
Broadcaster specific Info.
Definition iso.h:1094
bool can_recv
True if the channel is able to recv data.
Definition iso.h:1080
struct bt_iso_sync_receiver_info sync_receiver
Sync receiver specific Info.
Definition iso.h:1100
enum bt_iso_chan_type type
Channel Type.
Definition iso.h:1058
ISO Meta Data structure for received ISO packets.
Definition iso.h:337
uint8_t flags
ISO packet flags bitfield (BT_ISO_FLAGS_*)
Definition iso.h:349
uint32_t ts
ISO timestamp.
Definition iso.h:343
uint16_t seq_num
ISO packet sequence number of the first fragment in the SDU.
Definition iso.h:346
ISO Server structure.
Definition iso.h:758
bt_security_t sec_level
Required minimum security level.
Definition iso.h:765
int(* accept)(const struct bt_iso_accept_info *info, struct bt_iso_chan **chan)
Server accept callback.
Definition iso.h:778
ISO Synchronized Receiver Info Structure.
Definition iso.h:1038
uint32_t latency
The transport latency in us.
Definition iso.h:1040
uint16_t max_pdu
The maximum PDU size in octets.
Definition iso.h:1046
uint8_t irc
Number of times a payload is transmitted in a BIS event.
Definition iso.h:1052
uint32_t pto
Pre-transmission offset (N * 1.25 ms)
Definition iso.h:1043
uint8_t bn
The burst number.
Definition iso.h:1049
ISO Meta Data structure for transmitted ISO packets.
Definition iso.h:353
uint32_t offset
Time offset, in microseconds.
Definition iso.h:358
uint16_t seq_num
Packet sequence number.
Definition iso.h:361
uint32_t ts
CIG reference point or BIG anchor point of a transmitted SDU, in microseconds.
Definition iso.h:355
ISO Unicast Info Structure.
Definition iso.h:991
uint32_t cig_sync_delay
The maximum time in us for all PDUs of all CIS in a CIG event.
Definition iso.h:993
struct bt_iso_unicast_tx_info peripheral
TX information for the peripheral to central data.
Definition iso.h:1010
uint32_t subinterval
The subinterval in microseconds.
Definition iso.h:1004
struct bt_iso_unicast_tx_info central
TX information for the central to peripheral data path.
Definition iso.h:1007
uint32_t cis_sync_delay
The maximum time in us for all PDUs of this CIS in a CIG event.
Definition iso.h:996
ISO Unicast TX Info Structure.
Definition iso.h:961
uint32_t latency
The transport latency in us.
Definition iso.h:963
uint8_t phy
The transport PHY
Definition iso.h:972
uint16_t max_sdu
The maximum SDU size in octets.
Definition iso.h:981
uint32_t flush_timeout
The flush timeout (N * 1.25 ms)
Definition iso.h:966
uint8_t bn
The burst number.
Definition iso.h:975
uint32_t sdu_interval
The SDU interval in microseconds.
Definition iso.h:987
uint16_t max_pdu
The maximum PDU size in octets.
Definition iso.h:969
Network buffer representation.
Definition net_buf.h:1006