Zephyr API Documentation 4.0.0-rc2
A Scalable Open Source RTOS
|
BAP Broadcast Sink APIs . More...
Data Structures | |
struct | bt_bap_broadcast_sink_cb |
Broadcast Audio Sink callback structure. More... | |
Functions | |
int | bt_bap_broadcast_sink_register_cb (struct bt_bap_broadcast_sink_cb *cb) |
Register Broadcast sink callbacks. | |
int | bt_bap_broadcast_sink_create (struct bt_le_per_adv_sync *pa_sync, uint32_t broadcast_id, struct bt_bap_broadcast_sink **sink) |
Create a Broadcast Sink from a periodic advertising sync. | |
int | bt_bap_broadcast_sink_sync (struct bt_bap_broadcast_sink *sink, uint32_t indexes_bitfield, struct bt_bap_stream *streams[], const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]) |
Sync to a broadcaster's audio. | |
int | bt_bap_broadcast_sink_stop (struct bt_bap_broadcast_sink *sink) |
Stop audio broadcast sink. | |
int | bt_bap_broadcast_sink_delete (struct bt_bap_broadcast_sink *sink) |
Release a broadcast sink. | |
BAP Broadcast Sink APIs .
int bt_bap_broadcast_sink_create | ( | struct bt_le_per_adv_sync * | pa_sync, |
uint32_t | broadcast_id, | ||
struct bt_bap_broadcast_sink ** | sink ) |
#include <zephyr/bluetooth/audio/bap.h>
Create a Broadcast Sink from a periodic advertising sync.
This should only be done after verifying that the periodic advertising sync is from a Broadcast Source.
The created Broadcast Sink will need to be supplied to bt_bap_broadcast_sink_sync() in order to synchronize to the broadcast audio.
bt_bap_broadcast_sink_cb.pa_synced() will be called with the Broadcast Sink object created if this is successful.
pa_sync | Pointer to the periodic advertising sync object. | |
broadcast_id | 24-bit broadcast ID. | |
[out] | sink | Pointer to the Broadcast Sink created. |
int bt_bap_broadcast_sink_delete | ( | struct bt_bap_broadcast_sink * | sink | ) |
#include <zephyr/bluetooth/audio/bap.h>
Release a broadcast sink.
Once a broadcast sink has been allocated after the pa_synced callback, it can be deleted using this function. If the sink has synchronized to any broadcast audio streams, these must first be stopped using bt_bap_stream_stop.
sink | Pointer to the sink object to delete. |
int bt_bap_broadcast_sink_register_cb | ( | struct bt_bap_broadcast_sink_cb * | cb | ) |
#include <zephyr/bluetooth/audio/bap.h>
Register Broadcast sink callbacks.
It is possible to register multiple struct of callbacks, but a single struct can only be registered once. Registering the same callback multiple times is undefined behavior and may break the stack.
cb | Broadcast sink callback structure. |
0 | in case of success |
-EINVAL | if cb is NULL |
int bt_bap_broadcast_sink_stop | ( | struct bt_bap_broadcast_sink * | sink | ) |
#include <zephyr/bluetooth/audio/bap.h>
Stop audio broadcast sink.
Stop an audio broadcast sink. The broadcast sink will stop receiving BIGInfo, and audio data can no longer be streamed.
sink | Pointer to the broadcast sink |
int bt_bap_broadcast_sink_sync | ( | struct bt_bap_broadcast_sink * | sink, |
uint32_t | indexes_bitfield, | ||
struct bt_bap_stream * | streams[], | ||
const uint8_t | broadcast_code[BT_ISO_BROADCAST_CODE_SIZE] ) |
#include <zephyr/bluetooth/audio/bap.h>
Sync to a broadcaster's audio.
sink | Pointer to the sink object from the base_recv callback. |
indexes_bitfield | Bitfield of the BIS index to sync to. To sync to e.g. BIS index 1 and 2, this should have the value of BIT(1) | BIT(2). |
streams | Stream object pointers to be used for the receiver. If multiple BIS indexes shall be synchronized, multiple streams shall be provided. |
broadcast_code | The 16-octet broadcast code. Shall be supplied if the broadcast is encrypted (see bt_bap_broadcast_sink_cb::syncable). If the value is a string or a the value is less than 16 octets, the remaining octets shall be 0. |
Example: The string "Broadcast Code" shall be [42 72 6F 61 64 63 61 73 74 20 43 6F 64 65 00 00]