Zephyr Project API
3.4.0
A Scalable Open Source RTOS
|
BAP Broadcast Source APIs. More...
Data Structures | |
struct | bt_bap_broadcast_source_stream_param |
struct | bt_bap_broadcast_source_subgroup_param |
struct | bt_bap_broadcast_source_create_param |
Functions | |
int | bt_bap_broadcast_source_create (struct bt_bap_broadcast_source_create_param *param, struct bt_bap_broadcast_source **source) |
Create audio broadcast source. More... | |
int | bt_bap_broadcast_source_reconfig (struct bt_bap_broadcast_source *source, struct bt_codec *codec, struct bt_codec_qos *qos) |
Reconfigure audio broadcast source. More... | |
int | bt_bap_broadcast_source_update_metadata (struct bt_bap_broadcast_source *source, const struct bt_codec_data meta[], size_t meta_count) |
Modify the metadata of an audio broadcast source. More... | |
int | bt_bap_broadcast_source_start (struct bt_bap_broadcast_source *source, struct bt_le_ext_adv *adv) |
Start audio broadcast source. More... | |
int | bt_bap_broadcast_source_stop (struct bt_bap_broadcast_source *source) |
Stop audio broadcast source. More... | |
int | bt_bap_broadcast_source_delete (struct bt_bap_broadcast_source *source) |
Delete audio broadcast source. More... | |
int | bt_bap_broadcast_source_get_id (const struct bt_bap_broadcast_source *source, uint32_t *const broadcast_id) |
Get the broadcast ID of a broadcast source. More... | |
int | bt_bap_broadcast_source_get_base (struct bt_bap_broadcast_source *source, struct net_buf_simple *base_buf) |
Get the Broadcast Audio Stream Endpoint of a broadcast source. More... | |
BAP Broadcast Source APIs.
int bt_bap_broadcast_source_create | ( | struct bt_bap_broadcast_source_create_param * | param, |
struct bt_bap_broadcast_source ** | source | ||
) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_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_bap_broadcast_source_delete | ( | struct bt_bap_broadcast_source * | source | ) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_broadcast_source_get_base | ( | struct bt_bap_broadcast_source * | source, |
struct net_buf_simple * | base_buf | ||
) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_broadcast_source_get_id | ( | const struct bt_bap_broadcast_source * | source, |
uint32_t *const | broadcast_id | ||
) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_broadcast_source_reconfig | ( | struct bt_bap_broadcast_source * | source, |
struct bt_codec * | codec, | ||
struct bt_codec_qos * | qos | ||
) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_broadcast_source_start | ( | struct bt_bap_broadcast_source * | source, |
struct bt_le_ext_adv * | adv | ||
) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_broadcast_source_stop | ( | struct bt_bap_broadcast_source * | source | ) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_broadcast_source_update_metadata | ( | struct bt_bap_broadcast_source * | source, |
const struct bt_codec_data | meta[], | ||
size_t | meta_count | ||
) |
#include <include/zephyr/bluetooth/audio/bap.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_bap_broadcast_source_reconfig().
source | Pointer to the broadcast source. |
meta | Metadata entries. |
meta_count | Number of metadata entries. |