Zephyr API Documentation
3.7.0
A Scalable Open Source RTOS
|
Isochronous channels (ISO) More...
Data Structures | |
struct | bt_iso_chan |
ISO Channel structure. More... | |
struct | bt_iso_chan_io_qos |
ISO Channel IO QoS structure. More... | |
struct | bt_iso_chan_qos |
ISO Channel QoS structure. More... | |
struct | bt_iso_chan_path |
ISO Channel Data Path structure. More... | |
struct | bt_iso_recv_info |
ISO Meta Data structure for received ISO packets. More... | |
struct | bt_iso_tx_info |
ISO Meta Data structure for transmitted ISO packets. More... | |
struct | bt_iso_cig_param |
Connected Isochronous Group (CIG) parameters. More... | |
struct | bt_iso_connect_param |
ISO connection parameters structure. More... | |
struct | bt_iso_big_create_param |
Broadcast Isochronous Group (BIG) creation parameters. More... | |
struct | bt_iso_big_sync_param |
Broadcast Isochronous Group (BIG) Sync Parameters. More... | |
struct | bt_iso_biginfo |
Broadcast Isochronous Group (BIG) information. More... | |
struct | bt_iso_chan_ops |
ISO Channel operations structure. More... | |
struct | bt_iso_accept_info |
ISO Accept Info Structure. More... | |
struct | bt_iso_server |
ISO Server structure. More... | |
struct | bt_iso_unicast_tx_info |
ISO Unicast TX Info Structure. More... | |
struct | bt_iso_unicast_info |
ISO Unicast Info Structure. More... | |
struct | bt_iso_broadcaster_info |
ISO Broadcaster Info Structure. More... | |
struct | bt_iso_sync_receiver_info |
ISO Synchronized Receiver Info Structure. More... | |
struct | bt_iso_info |
ISO channel Info Structure. More... | |
Macros | |
#define | BT_ISO_CHAN_SEND_RESERVE BT_BUF_ISO_SIZE(0) |
Headroom needed for outgoing ISO SDUs. | |
#define | BT_ISO_SDU_BUF_SIZE(mtu) BT_BUF_ISO_SIZE(mtu) |
Helper to calculate needed buffer size for ISO SDUs. | |
#define | BT_ISO_DATA_PATH_HCI 0x00 |
Value to set the ISO data path over HCi. | |
#define | BT_ISO_SDU_INTERVAL_MIN 0x0000FFU |
Minimum interval value in microseconds. | |
#define | BT_ISO_SDU_INTERVAL_MAX 0x0FFFFFU |
Maximum interval value in microseconds. | |
#define | BT_ISO_ISO_INTERVAL_MIN 0x0004U |
Minimum ISO interval (N * 1.25 ms) | |
#define | BT_ISO_ISO_INTERVAL_MAX 0x0C80U |
Maximum ISO interval (N * 1.25 ms) | |
#define | BT_ISO_LATENCY_MIN 0x0005 |
Minimum latency value in milliseconds. | |
#define | BT_ISO_LATENCY_MAX 0x0FA0 |
Maximum latency value in milliseconds. | |
#define | BT_ISO_PACKING_SEQUENTIAL 0x00 |
Packets will be sent sequentially between the channels in the group. | |
#define | BT_ISO_PACKING_INTERLEAVED 0x01 |
Packets will be sent interleaved between the channels in the group. | |
#define | BT_ISO_FRAMING_UNFRAMED 0x00 |
Packets may be framed or unframed. | |
#define | BT_ISO_FRAMING_FRAMED 0x01 |
Packets are always framed. | |
#define | BT_ISO_MAX_GROUP_ISO_COUNT 0x1F |
Maximum number of isochronous channels in a single group. | |
#define | BT_ISO_MIN_SDU 0x0001 |
Minimum SDU size. | |
#define | BT_ISO_MAX_SDU 0x0FFF |
Maximum SDU size. | |
#define | BT_ISO_CONNECTED_PDU_MIN 0x0000U |
Minimum PDU size. | |
#define | BT_ISO_BROADCAST_PDU_MIN 0x0001U |
Minimum PDU size. | |
#define | BT_ISO_PDU_MAX 0x00FBU |
Maximum PDU size. | |
#define | BT_ISO_BN_MIN 0x01U |
Minimum burst number. | |
#define | BT_ISO_BN_MAX 0x0FU |
Maximum burst number. | |
#define | BT_ISO_FT_MIN 0x01U |
Minimum flush timeout. | |
#define | BT_ISO_FT_MAX 0xFFU |
Maximum flush timeout. | |
#define | BT_ISO_NSE_MIN 0x01U |
Minimum number of subevents. | |
#define | BT_ISO_NSE_MAX 0x1FU |
Maximum number of subevents. | |
#define | BT_ISO_SYNC_TIMEOUT_MIN 0x000A |
Minimum BIG sync timeout value (N * 10 ms) | |
#define | BT_ISO_SYNC_TIMEOUT_MAX 0x4000 |
Maximum BIG sync timeout value (N * 10 ms) | |
#define | BT_ISO_SYNC_MSE_ANY 0x00 |
Controller controlled maximum subevent count value. | |
#define | BT_ISO_SYNC_MSE_MIN 0x01 |
Minimum BIG sync maximum subevent count value. | |
#define | BT_ISO_SYNC_MSE_MAX 0x1F |
Maximum BIG sync maximum subevent count value. | |
#define | BT_ISO_CONNECTED_RTN_MAX 0xFF |
Maximum connected ISO retransmission value. | |
#define | BT_ISO_BROADCAST_RTN_MAX 0x1E |
Maximum broadcast ISO retransmission value. | |
#define | BT_ISO_BROADCAST_CODE_SIZE 16 |
Broadcast code size. | |
#define | BT_ISO_BIS_INDEX_MIN 0x01 |
Lowest BIS index. | |
#define | BT_ISO_BIS_INDEX_MAX 0x1F |
Highest BIS index. | |
#define | BT_ISO_IRC_MIN 0x01U |
Minimum Immediate Repetition Count. | |
#define | BT_ISO_IRC_MAX 0x0FU |
Maximum Immediate Repetition Count. | |
#define | BT_ISO_PTO_MIN 0x00U |
Minimum pre-transmission offset. | |
#define | BT_ISO_PTO_MAX 0x0FU |
Maximum pre-transmission offset. | |
Enumerations | |
enum | bt_iso_state { BT_ISO_STATE_DISCONNECTED , BT_ISO_STATE_ENCRYPT_PENDING , BT_ISO_STATE_CONNECTING , BT_ISO_STATE_CONNECTED , BT_ISO_STATE_DISCONNECTING } |
Life-span states of ISO channel. More... | |
enum | bt_iso_chan_type { BT_ISO_CHAN_TYPE_NONE , BT_ISO_CHAN_TYPE_CONNECTED , BT_ISO_CHAN_TYPE_BROADCASTER , BT_ISO_CHAN_TYPE_SYNC_RECEIVER } |
ISO Channel Type. More... | |
enum | { BT_ISO_FLAGS_VALID = BIT(0) , BT_ISO_FLAGS_ERROR = BIT(1) , BT_ISO_FLAGS_LOST = BIT(2) , BT_ISO_FLAGS_TS = BIT(3) } |
ISO packet status flag bits. More... | |
Functions | |
int | bt_iso_server_register (struct bt_iso_server *server) |
Register ISO server. | |
int | bt_iso_server_unregister (struct bt_iso_server *server) |
Unregister ISO server. | |
int | bt_iso_cig_create (const struct bt_iso_cig_param *param, struct bt_iso_cig **out_cig) |
Creates a CIG as a central. | |
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_cig_terminate (struct bt_iso_cig *cig) |
Terminates a CIG as a central. | |
int | bt_iso_chan_connect (const struct bt_iso_connect_param *param, size_t count) |
Connect ISO channels on ACL connections. | |
int | bt_iso_chan_disconnect (struct bt_iso_chan *chan) |
Disconnect connected ISO channel. | |
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_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_chan_get_info (const struct bt_iso_chan *chan, struct bt_iso_info *info) |
Get ISO channel info. | |
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_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_big_terminate (struct bt_iso_big *big) |
Terminates a BIG as a broadcaster or receiver. | |
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. | |
Isochronous channels (ISO)
#define BT_ISO_BIS_INDEX_MAX 0x1F |
#include <zephyr/bluetooth/iso.h>
Highest BIS index.
#define BT_ISO_BIS_INDEX_MIN 0x01 |
#include <zephyr/bluetooth/iso.h>
Lowest BIS index.
#define BT_ISO_BN_MAX 0x0FU |
#include <zephyr/bluetooth/iso.h>
Maximum burst number.
#define BT_ISO_BN_MIN 0x01U |
#include <zephyr/bluetooth/iso.h>
Minimum burst number.
#define BT_ISO_BROADCAST_CODE_SIZE 16 |
#include <zephyr/bluetooth/iso.h>
Broadcast code size.
#define BT_ISO_BROADCAST_PDU_MIN 0x0001U |
#include <zephyr/bluetooth/iso.h>
Minimum PDU size.
#define BT_ISO_BROADCAST_RTN_MAX 0x1E |
#include <zephyr/bluetooth/iso.h>
Maximum broadcast ISO retransmission value.
#define BT_ISO_CHAN_SEND_RESERVE BT_BUF_ISO_SIZE(0) |
#include <zephyr/bluetooth/iso.h>
Headroom needed for outgoing ISO SDUs.
#define BT_ISO_CONNECTED_PDU_MIN 0x0000U |
#include <zephyr/bluetooth/iso.h>
Minimum PDU size.
#define BT_ISO_CONNECTED_RTN_MAX 0xFF |
#include <zephyr/bluetooth/iso.h>
Maximum connected ISO retransmission value.
#define BT_ISO_DATA_PATH_HCI 0x00 |
#include <zephyr/bluetooth/iso.h>
Value to set the ISO data path over HCi.
#define BT_ISO_FRAMING_FRAMED 0x01 |
#include <zephyr/bluetooth/iso.h>
Packets are always framed.
#define BT_ISO_FRAMING_UNFRAMED 0x00 |
#include <zephyr/bluetooth/iso.h>
Packets may be framed or unframed.
#define BT_ISO_FT_MAX 0xFFU |
#include <zephyr/bluetooth/iso.h>
Maximum flush timeout.
#define BT_ISO_FT_MIN 0x01U |
#include <zephyr/bluetooth/iso.h>
Minimum flush timeout.
#define BT_ISO_IRC_MAX 0x0FU |
#include <zephyr/bluetooth/iso.h>
Maximum Immediate Repetition Count.
#define BT_ISO_IRC_MIN 0x01U |
#include <zephyr/bluetooth/iso.h>
Minimum Immediate Repetition Count.
#define BT_ISO_ISO_INTERVAL_MAX 0x0C80U |
#include <zephyr/bluetooth/iso.h>
Maximum ISO interval (N * 1.25 ms)
#define BT_ISO_ISO_INTERVAL_MIN 0x0004U |
#include <zephyr/bluetooth/iso.h>
Minimum ISO interval (N * 1.25 ms)
#define BT_ISO_LATENCY_MAX 0x0FA0 |
#include <zephyr/bluetooth/iso.h>
Maximum latency value in milliseconds.
#define BT_ISO_LATENCY_MIN 0x0005 |
#include <zephyr/bluetooth/iso.h>
Minimum latency value in milliseconds.
#define BT_ISO_MAX_GROUP_ISO_COUNT 0x1F |
#include <zephyr/bluetooth/iso.h>
Maximum number of isochronous channels in a single group.
#define BT_ISO_MAX_SDU 0x0FFF |
#include <zephyr/bluetooth/iso.h>
Maximum SDU size.
#define BT_ISO_MIN_SDU 0x0001 |
#include <zephyr/bluetooth/iso.h>
Minimum SDU size.
#define BT_ISO_NSE_MAX 0x1FU |
#include <zephyr/bluetooth/iso.h>
Maximum number of subevents.
#define BT_ISO_NSE_MIN 0x01U |
#include <zephyr/bluetooth/iso.h>
Minimum number of subevents.
#define BT_ISO_PACKING_INTERLEAVED 0x01 |
#include <zephyr/bluetooth/iso.h>
Packets will be sent interleaved between the channels in the group.
#define BT_ISO_PACKING_SEQUENTIAL 0x00 |
#include <zephyr/bluetooth/iso.h>
Packets will be sent sequentially between the channels in the group.
#define BT_ISO_PDU_MAX 0x00FBU |
#include <zephyr/bluetooth/iso.h>
Maximum PDU size.
#define BT_ISO_PTO_MAX 0x0FU |
#include <zephyr/bluetooth/iso.h>
Maximum pre-transmission offset.
#define BT_ISO_PTO_MIN 0x00U |
#include <zephyr/bluetooth/iso.h>
Minimum pre-transmission offset.
#define BT_ISO_SDU_BUF_SIZE | ( | mtu | ) | BT_BUF_ISO_SIZE(mtu) |
#include <zephyr/bluetooth/iso.h>
Helper to calculate needed buffer size for ISO SDUs.
Useful for creating buffer pools.
mtu | Required ISO SDU size |
#define BT_ISO_SDU_INTERVAL_MAX 0x0FFFFFU |
#include <zephyr/bluetooth/iso.h>
Maximum interval value in microseconds.
#define BT_ISO_SDU_INTERVAL_MIN 0x0000FFU |
#include <zephyr/bluetooth/iso.h>
Minimum interval value in microseconds.
#define BT_ISO_SYNC_MSE_ANY 0x00 |
#include <zephyr/bluetooth/iso.h>
Controller controlled maximum subevent count value.
#define BT_ISO_SYNC_MSE_MAX 0x1F |
#include <zephyr/bluetooth/iso.h>
Maximum BIG sync maximum subevent count value.
#define BT_ISO_SYNC_MSE_MIN 0x01 |
#include <zephyr/bluetooth/iso.h>
Minimum BIG sync maximum subevent count value.
#define BT_ISO_SYNC_TIMEOUT_MAX 0x4000 |
#include <zephyr/bluetooth/iso.h>
Maximum BIG sync timeout value (N * 10 ms)
#define BT_ISO_SYNC_TIMEOUT_MIN 0x000A |
#include <zephyr/bluetooth/iso.h>
Minimum BIG sync timeout value (N * 10 ms)
anonymous enum |
#include <zephyr/bluetooth/iso.h>
ISO packet status flag bits.
Enumerator | |
---|---|
BT_ISO_FLAGS_VALID | The ISO packet is valid. |
BT_ISO_FLAGS_ERROR | The ISO packet may possibly contain errors. May be caused by a failed CRC check or if missing a part of the SDU. |
BT_ISO_FLAGS_LOST | The ISO packet was lost. |
BT_ISO_FLAGS_TS | Timestamp is valid. If not set, then the bt_iso_recv_info.ts value is not valid, and should not be used. |
enum bt_iso_chan_type |
#include <zephyr/bluetooth/iso.h>
ISO Channel Type.
Enumerator | |
---|---|
BT_ISO_CHAN_TYPE_NONE | No channel type. |
BT_ISO_CHAN_TYPE_CONNECTED | Connected. |
BT_ISO_CHAN_TYPE_BROADCASTER | Isochronous broadcaster. |
BT_ISO_CHAN_TYPE_SYNC_RECEIVER | Synchronized receiver. |
enum bt_iso_state |
#include <zephyr/bluetooth/iso.h>
Life-span states of ISO channel.
Used only by internal APIs dealing with setting channel to proper state depending on operational context.
int bt_iso_big_create | ( | struct bt_le_ext_adv * | padv, |
struct bt_iso_big_create_param * | param, | ||
struct bt_iso_big ** | out_big | ||
) |
#include <zephyr/bluetooth/iso.h>
Creates a BIG as a broadcaster.
[in] | padv | Pointer to the periodic advertising object the BIGInfo shall be sent on. |
[in] | param | The parameters used to create and enable the BIG. The QOS parameters are determined by the QOS field of the first BIS in the BIS list of this parameter. |
[out] | out_big | Broadcast Isochronous Group object on success. |
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 | ||
) |
#include <zephyr/bluetooth/iso.h>
Creates a BIG as a receiver.
[in] | sync | Pointer to the periodic advertising sync object the BIGInfo was received on. |
[in] | param | The parameters used to create and enable the BIG sync. |
[out] | out_big | Broadcast Isochronous Group object on success. |
int bt_iso_big_terminate | ( | struct bt_iso_big * | big | ) |
#include <zephyr/bluetooth/iso.h>
Terminates a BIG as a broadcaster or receiver.
big | Pointer to the BIG structure. |
int bt_iso_chan_connect | ( | const struct bt_iso_connect_param * | param, |
size_t | count | ||
) |
#include <zephyr/bluetooth/iso.h>
Connect ISO channels on ACL connections.
Connect ISO channels. The ISO channels must have been initialized in a CIG first by calling bt_iso_cig_create().
Once the connection is completed the channels' connected() callback will be called. If the connection is rejected disconnected() callback is called instead.
This function will also setup the ISO data path based on the path
parameter of the bt_iso_chan_io_qos for each channel.
param | Pointer to a connect parameter array with the ISO and ACL pointers. |
count | Number of connect parameters. |
0 | Successfully started the connecting procedure. |
-EINVAL | Invalid parameters were supplied. |
-EBUSY | Some ISO channels are already being connected. It is not possible to have multiple outstanding connection requests. May also be returned if CONFIG_BT_SMP is enabled and a pairing procedure is already in progress. |
-ENOBUFS | Not buffers available to send request to controller or if CONFIG_BT_SMP is enabled and no more keys could be stored. |
-ENOMEM | If CONFIG_BT_SMP is enabled and no more keys could be stored. |
-EIO | Controller rejected the request or if CONFIG_BT_SMP is enabled and pairing has timed out. |
-ENOTCONN | If CONFIG_BT_SMP is enabled the ACL is not connected. |
int bt_iso_chan_disconnect | ( | struct bt_iso_chan * | chan | ) |
#include <zephyr/bluetooth/iso.h>
Disconnect connected ISO channel.
Disconnect connected ISO channel.
If the device is a central and the connection is pending it will be canceled and as a result the channel bt_iso_chan_ops.disconnected() callback is called.
If the device is a peripheral and the connection is pending it will be rejected, as a peripheral shall wait for a CIS Established event (which may trigger a bt_iso_chan_ops.disconnected() callback in case of an error).
Regarding to input parameter, to get details see reference description to bt_iso_chan_connect() API.
chan | Channel object. |
int bt_iso_chan_get_info | ( | const struct bt_iso_chan * | chan, |
struct bt_iso_info * | info | ||
) |
#include <zephyr/bluetooth/iso.h>
Get ISO channel info.
chan | Channel object. |
info | Channel info object. |
int bt_iso_chan_get_tx_sync | ( | const struct bt_iso_chan * | chan, |
struct bt_iso_tx_info * | info | ||
) |
#include <zephyr/bluetooth/iso.h>
Get ISO transmission timing info.
Reads timing information for transmitted ISO packet on an ISO channel. The HCI_LE_Read_ISO_TX_Sync HCI command is used to retrieve this information from the controller.
[in] | chan | Channel object. |
[out] | info | Transmit info object. |
int bt_iso_chan_send | ( | struct bt_iso_chan * | chan, |
struct net_buf * | buf, | ||
uint16_t | seq_num | ||
) |
#include <zephyr/bluetooth/iso.h>
Send data to ISO channel without timestamp.
Send data from buffer to the channel. If credits are not available, buf will be queued and sent as and when credits are received from peer. Regarding to first input parameter, to get details see reference description to bt_iso_chan_connect() API.
chan | Channel object. |
buf | Buffer containing data to be sent. |
seq_num | Packet Sequence number. This value shall be incremented for each call to this function and at least once per SDU interval for a specific channel. |
int bt_iso_chan_send_ts | ( | struct bt_iso_chan * | chan, |
struct net_buf * | buf, | ||
uint16_t | seq_num, | ||
uint32_t | ts | ||
) |
#include <zephyr/bluetooth/iso.h>
Send data to ISO channel with timestamp.
Send data from buffer to the channel. If credits are not available, buf will be queued and sent as and when credits are received from peer. Regarding to first input parameter, to get details see reference description to bt_iso_chan_connect() API.
chan | Channel object. |
buf | Buffer containing data to be sent. |
seq_num | Packet Sequence number. This value shall be incremented for each call to this function and at least once per SDU interval for a specific channel. |
ts | Timestamp of the SDU in microseconds (us). This value can be used to transmit multiple SDUs in the same SDU interval in a CIG or BIG. |
int bt_iso_cig_create | ( | const struct bt_iso_cig_param * | param, |
struct bt_iso_cig ** | out_cig | ||
) |
#include <zephyr/bluetooth/iso.h>
Creates a CIG as a central.
This can called at any time, even before connecting to a remote device. This must be called before any connected isochronous stream (CIS) channel can be connected.
Once a CIG is created, the channels supplied in the param
can be connected using bt_iso_chan_connect().
[in] | param | The parameters used to create and enable the CIG. |
[out] | out_cig | Connected Isochronous Group object on success. |
int bt_iso_cig_reconfigure | ( | struct bt_iso_cig * | cig, |
const struct bt_iso_cig_param * | param | ||
) |
#include <zephyr/bluetooth/iso.h>
Reconfigure a CIG as a central.
This function can be used to update a CIG. It will update the group specific parameters, and, if supplied, change the QoS parameters of the individual CIS. If the cis_channels in param
contains CIS that was not originally in the call to bt_iso_cig_create(), these will be added to the group. It is not possible to remove any CIS from the group after creation.
This can be called at any time before connecting an ISO to a remote device. Once any CIS in the group has connected, the group cannot be changed.
Once a CIG is created, the channels supplied in the param
can be connected using bt_iso_chan_connect().
cig | Connected Isochronous Group object. |
param | The parameters used to reconfigure the CIG. |
int bt_iso_cig_terminate | ( | struct bt_iso_cig * | cig | ) |
#include <zephyr/bluetooth/iso.h>
Terminates a CIG as a central.
All the CIS in the CIG shall be disconnected first.
cig | Pointer to the CIG structure. |
int bt_iso_server_register | ( | struct bt_iso_server * | server | ) |
#include <zephyr/bluetooth/iso.h>
Register ISO server.
Register ISO server, each new connection is authorized using the accept() callback which in case of success shall allocate the channel structure to be used by the new connection.
server | Server structure. |
int bt_iso_server_unregister | ( | struct bt_iso_server * | server | ) |
#include <zephyr/bluetooth/iso.h>
Unregister ISO server.
Unregister previously registered ISO server.
server | Server structure. |