Zephyr Project API
3.3.0
A Scalable Open Source RTOS
|
Audio Broadcast APIs. More...
Data Structures | |
struct | bt_audio_broadcast_source_stream_param |
struct | bt_audio_broadcast_source_subgroup_param |
struct | bt_audio_broadcast_source_create_param |
Functions | |
int | bt_audio_broadcast_source_create (struct bt_audio_broadcast_source_create_param *param, 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_update_metadata (struct bt_audio_broadcast_source *source, const struct bt_codec_data meta[], size_t meta_count) |
Modify the metadata of an audio broadcast source. More... | |
int | bt_audio_broadcast_source_start (struct bt_audio_broadcast_source *source, struct bt_le_ext_adv *adv) |
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... | |
int | bt_audio_broadcast_source_get_id (const struct bt_audio_broadcast_source *source, uint32_t *const broadcast_id) |
Get the broadcast ID of a broadcast source. More... | |
int | bt_audio_broadcast_source_get_base (struct bt_audio_broadcast_source *source, struct net_buf_simple *base_buf) |
Get the Broadcast Audio Stream Endpoint of a 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... | |
Audio Broadcast APIs.
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.
sink | Pointer to the sink object to delete. |
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 *.
cb | Broadcast sink callback structure. |
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.
param | Scan parameters. |
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.
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.
sink | Pointer to the broadcast sink |
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.
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 the syncable callback). 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]
int bt_audio_broadcast_source_create | ( | struct bt_audio_broadcast_source_create_param * | param, |
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).
[in] | param | Pointer to parameters used to create the broadcast source. |
[out] | source | Pointer to the broadcast source created |
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.
source | Pointer to the broadcast source |
int bt_audio_broadcast_source_get_base | ( | struct bt_audio_broadcast_source * | source, |
struct net_buf_simple * | base_buf | ||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Get the Broadcast Audio Stream Endpoint of a broadcast source.
This will encode the BASE of a broadcast source into a buffer, that can be used for advertisement. The encoded BASE will thus be encoded as little-endian. The BASE shall be put into the periodic advertising data (see bt_le_per_adv_set_data()).
See table 3.15 in the Basic Audio Profile v1.0.1 for the structure.
source | Pointer to the broadcast source. |
base_buf | Pointer to a buffer where the BASE will be inserted. |
int bt_audio_broadcast_source_get_id | ( | const struct bt_audio_broadcast_source * | source, |
uint32_t *const | broadcast_id | ||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Get the broadcast ID of a broadcast source.
This will return the 3-octet broadcast ID that should be advertised in the extended advertising data with BT_UUID_BROADCAST_AUDIO_VAL as BT_DATA_SVC_DATA16.
See table 3.14 in the Basic Audio Profile v1.0.1 for the structure.
[in] | source | Pointer to the broadcast source. |
[out] | broadcast_id | Pointer to the 3-octet broadcast ID. |
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. This can only be done when the source is stopped.
source | Pointer to the broadcast source |
codec | Codec configuration. |
qos | Quality of Service configuration |
int bt_audio_broadcast_source_start | ( | struct bt_audio_broadcast_source * | source, |
struct bt_le_ext_adv * | adv | ||
) |
#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.
source | Pointer to the broadcast source |
adv | Pointer to an extended advertising set with periodic advertising configured. |
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.
source | Pointer to the broadcast source |
int bt_audio_broadcast_source_update_metadata | ( | struct bt_audio_broadcast_source * | source, |
const struct bt_codec_data | meta[], | ||
size_t | meta_count | ||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Modify the metadata of an audio broadcast source.
Modify the metadata an audio broadcast source. This can only be done when the source is started. To update the metadata in the stopped state, use bt_audio_broadcast_source_reconfig().
source | Pointer to the broadcast source. |
meta | Metadata entries. |
meta_count | Number of metadata entries. |