Zephyr Project API  3.3.0
A Scalable Open Source RTOS
bt_audio_broadcast_sink_cb Struct Reference

#include <audio.h>

Data Fields

bool(* scan_recv )(const struct bt_le_scan_recv_info *info, struct net_buf_simple *ad, uint32_t broadcast_id)
 Scan receive callback. More...
 
void(* pa_synced )(struct bt_audio_broadcast_sink *sink, struct bt_le_per_adv_sync *sync, uint32_t broadcast_id)
 Periodic advertising sync callback. More...
 
void(* base_recv )(struct bt_audio_broadcast_sink *sink, const struct bt_audio_base *base)
 Broadcast Audio Source Endpoint (BASE) received. More...
 
void(* syncable )(struct bt_audio_broadcast_sink *sink, bool encrypted)
 Broadcast sink is syncable. More...
 
void(* scan_term )(int err)
 Scan terminated callback. More...
 
void(* pa_sync_lost )(struct bt_audio_broadcast_sink *sink)
 Periodic advertising synchronization lost callback. More...
 

Detailed Description

Broadcast Audio Sink callback structure

Field Documentation

◆ base_recv

void(* bt_audio_broadcast_sink_cb::base_recv) (struct bt_audio_broadcast_sink *sink, const struct bt_audio_base *base)

Broadcast Audio Source Endpoint (BASE) received.

Callback for when we receive a BASE from a broadcaster after syncing to the broadcaster's periodic advertising.

Parameters
sinkPointer to the sink structure.
baseBroadcast Audio Source Endpoint (BASE).

◆ pa_sync_lost

void(* bt_audio_broadcast_sink_cb::pa_sync_lost) (struct bt_audio_broadcast_sink *sink)

Periodic advertising synchronization lost callback.

The periodic advertising synchronization lost callback is called if the periodic advertising sync is lost. If this happens, the sink object is deleted. To synchronize to the broadcaster again, bt_audio_broadcast_sink_scan_start() must be called.

Parameters
sinkPointer to the sink structure.

◆ pa_synced

void(* bt_audio_broadcast_sink_cb::pa_synced) (struct bt_audio_broadcast_sink *sink, struct bt_le_per_adv_sync *sync, uint32_t broadcast_id)

Periodic advertising sync callback.

Called when synchronized to a periodic advertising. When synchronized a bt_audio_broadcast_sink structure is allocated for future use.

Parameters
sinkPointer to the allocated sink structure.
syncPointer to the periodic advertising sync.
broadcast_id24-bit broadcast ID previously reported by scan_recv.

◆ scan_recv

bool(* bt_audio_broadcast_sink_cb::scan_recv) (const struct bt_le_scan_recv_info *info, struct net_buf_simple *ad, uint32_t broadcast_id)

Scan receive callback.

Scan receive callback is called whenever a broadcast source has been found.

Parameters
infoAdvertiser packet information.
adBuffer containing advertiser data.
broadcast_id24-bit broadcast ID
Returns
true to sync to the broadcaster, else false. Syncing to the broadcaster will stop the current scan.

◆ scan_term

void(* bt_audio_broadcast_sink_cb::scan_term) (int err)

Scan terminated callback.

Scan terminated callback is called whenever a scan started by bt_audio_broadcast_sink_scan_start() is terminated before bt_audio_broadcast_sink_scan_stop().

Typical reasons for this are that the periodic advertising has synchronized (success criteria) or the scan timed out. It may also be called if the periodic advertising failed to synchronize.

Parameters
err0 in case of success or negative value in case of error.

◆ syncable

void(* bt_audio_broadcast_sink_cb::syncable) (struct bt_audio_broadcast_sink *sink, bool encrypted)

Broadcast sink is syncable.

Called whenever a broadcast sink is not synchronized to audio, but the audio is synchronizable. This is inferred when a BIGInfo report is received.

Once this callback has been called, it is possible to call bt_audio_broadcast_sink_sync() to synchronize to the audio stream(s).

Parameters
sinkPointer to the sink structure.
encryptedWhether or not the broadcast is encrypted

The documentation for this struct was generated from the following file: