Zephyr Project API  3.2.0
A Scalable Open Source RTOS
Audio Broadcast APIs

Audio Broadcast APIs. More...

Functions

int bt_audio_broadcast_source_create (struct bt_audio_stream *streams[], size_t num_stream, struct bt_codec *codec, struct bt_codec_qos *qos, struct bt_audio_broadcast_source **source)
 Create audio broadcast source. More...
 
int bt_audio_broadcast_source_reconfig (struct bt_audio_broadcast_source *source, struct bt_codec *codec, struct bt_codec_qos *qos)
 Reconfigure audio broadcast source. More...
 
int bt_audio_broadcast_source_start (struct bt_audio_broadcast_source *source)
 Start audio broadcast source. More...
 
int bt_audio_broadcast_source_stop (struct bt_audio_broadcast_source *source)
 Stop audio broadcast source. More...
 
int bt_audio_broadcast_source_delete (struct bt_audio_broadcast_source *source)
 Delete audio broadcast source. More...
 
void bt_audio_broadcast_sink_register_cb (struct bt_audio_broadcast_sink_cb *cb)
 Register Broadcast sink callbacks *. More...
 
int bt_audio_broadcast_sink_scan_start (const struct bt_le_scan_param *param)
 Start scan for broadcast sources. More...
 
int bt_audio_broadcast_sink_scan_stop (void)
 Stop scan for broadcast sources. More...
 
int bt_audio_broadcast_sink_sync (struct bt_audio_broadcast_sink *sink, uint32_t indexes_bitfield, struct bt_audio_stream *streams[], const uint8_t broadcast_code[16])
 Sync to a broadcaster's audio. More...
 
int bt_audio_broadcast_sink_stop (struct bt_audio_broadcast_sink *sink)
 Stop audio broadcast sink. More...
 
int bt_audio_broadcast_sink_delete (struct bt_audio_broadcast_sink *sink)
 Release a broadcast sink. More...
 

Detailed Description

Audio Broadcast APIs.

Function Documentation

◆ bt_audio_broadcast_sink_delete()

int bt_audio_broadcast_sink_delete ( struct bt_audio_broadcast_sink *  sink)

#include <include/zephyr/bluetooth/audio/audio.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_audio_stream_stop.

Parameters
sinkPointer to the sink object to delete.
Returns
0 in case of success or negative value in case of error.

◆ bt_audio_broadcast_sink_register_cb()

void bt_audio_broadcast_sink_register_cb ( struct bt_audio_broadcast_sink_cb cb)

#include <include/zephyr/bluetooth/audio/audio.h>

Register Broadcast sink callbacks *.

Parameters
cbBroadcast sink callback structure.

◆ bt_audio_broadcast_sink_scan_start()

int bt_audio_broadcast_sink_scan_start ( const struct bt_le_scan_param param)

#include <include/zephyr/bluetooth/audio/audio.h>

Start scan for broadcast sources.

Starts a scan for broadcast sources. Scan results will be received by the scan_recv callback. Only reports from devices advertising broadcast audio support will be sent. Note that a broadcast source may advertise broadcast audio capabilities, but may not be streaming.

Parameters
paramScan parameters.
Returns
Zero on success or (negative) error code otherwise.

◆ bt_audio_broadcast_sink_scan_stop()

int bt_audio_broadcast_sink_scan_stop ( void  )

#include <include/zephyr/bluetooth/audio/audio.h>

Stop scan for broadcast sources.

Stops ongoing scanning for broadcast sources.

Returns
Zero on success or (negative) error code otherwise.

◆ bt_audio_broadcast_sink_stop()

int bt_audio_broadcast_sink_stop ( struct bt_audio_broadcast_sink *  sink)

#include <include/zephyr/bluetooth/audio/audio.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.

Parameters
sinkPointer to the broadcast sink
Returns
Zero on success or (negative) error code otherwise.

◆ bt_audio_broadcast_sink_sync()

int bt_audio_broadcast_sink_sync ( struct bt_audio_broadcast_sink *  sink,
uint32_t  indexes_bitfield,
struct bt_audio_stream streams[],
const uint8_t  broadcast_code[16] 
)

#include <include/zephyr/bluetooth/audio/audio.h>

Sync to a broadcaster's audio.

Parameters
sinkPointer to the sink object from the base_recv callback.
indexes_bitfieldBitfield 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).
streamsStream object pointers to be used for the receiver. If multiple BIS indexes shall be synchronized, multiple streams shall be provided.
broadcast_codeThe 16-octet broadcast code. Shall be supplied if the broadcast is encrypted (see the syncable callback).
Returns
0 in case of success or negative value in case of error.

◆ bt_audio_broadcast_source_create()

int bt_audio_broadcast_source_create ( struct bt_audio_stream streams[],
size_t  num_stream,
struct bt_codec codec,
struct bt_codec_qos qos,
struct bt_audio_broadcast_source **  source 
)

#include <include/zephyr/bluetooth/audio/audio.h>

Create audio broadcast source.

Create a new audio broadcast source with one or more audio streams.

The broadcast source will be visible for scanners once this has been called, and the device will advertise audio announcements.

No audio data can be sent until bt_audio_broadcast_source_start() has been called and no audio information (BIGInfo) will be visible to scanners (see bt_le_per_adv_sync_cb).

Parameters
[in]streamsArray of stream object pointers being used for the broadcaster.
[in]num_streamNumber of streams in streams.
[in]codecCodec configuration.
[in]qosQuality of Service configuration
[out]sourcePointer to the broadcast source created
Returns
Zero on success or (negative) error code otherwise.

◆ bt_audio_broadcast_source_delete()

int bt_audio_broadcast_source_delete ( struct bt_audio_broadcast_source *  source)

#include <include/zephyr/bluetooth/audio/audio.h>

Delete audio broadcast source.

Delete an audio broadcast source. The broadcast source will stop advertising entirely, and the source can no longer be used.

Parameters
sourcePointer to the broadcast source
Returns
Zero on success or (negative) error code otherwise.

◆ bt_audio_broadcast_source_reconfig()

int bt_audio_broadcast_source_reconfig ( struct bt_audio_broadcast_source *  source,
struct bt_codec codec,
struct bt_codec_qos qos 
)

#include <include/zephyr/bluetooth/audio/audio.h>

Reconfigure audio broadcast source.

Reconfigure an audio broadcast source with a new codec and codec quality of service parameters.

Parameters
sourcePointer to the broadcast source
codecCodec configuration.
qosQuality of Service configuration
Returns
Zero on success or (negative) error code otherwise.

◆ bt_audio_broadcast_source_start()

int bt_audio_broadcast_source_start ( struct bt_audio_broadcast_source *  source)

#include <include/zephyr/bluetooth/audio/audio.h>

Start audio broadcast source.

Start an audio broadcast source with one or more audio streams. The broadcast source will start advertising BIGInfo, and audio data can be streamed.

Parameters
sourcePointer to the broadcast source
Returns
Zero on success or (negative) error code otherwise.

◆ bt_audio_broadcast_source_stop()

int bt_audio_broadcast_source_stop ( struct bt_audio_broadcast_source *  source)

#include <include/zephyr/bluetooth/audio/audio.h>

Stop audio broadcast source.

Stop an audio broadcast source. The broadcast source will stop advertising BIGInfo, and audio data can no longer be streamed.

Parameters
sourcePointer to the broadcast source
Returns
Zero on success or (negative) error code otherwise.