|
Zephyr Project API
3.3.0
A Scalable Open Source RTOS
|
Bluetooth Audio handling. More...
#include <zephyr/sys/atomic.h>#include <zephyr/bluetooth/buf.h>#include <zephyr/bluetooth/conn.h>#include <zephyr/bluetooth/hci.h>#include <zephyr/bluetooth/iso.h>#include <zephyr/bluetooth/gatt.h>#include <zephyr/bluetooth/audio/bap.h>#include <zephyr/bluetooth/audio/lc3.h>Go to the source code of this file.
Data Structures | |
| struct | bt_codec_data |
| Codec configuration structure. More... | |
| struct | bt_codec |
| Codec structure. More... | |
| struct | bt_audio_base_bis_data |
| struct | bt_audio_base_subgroup |
| struct | bt_audio_base |
| struct | bt_codec_qos |
| Codec QoS structure. More... | |
| struct | bt_codec_qos_pref |
| Audio Stream Quality of Service Preference structure. More... | |
| struct | bt_audio_lc3_preset |
| struct | bt_audio_stream |
| Audio stream structure. More... | |
| struct | bt_audio_unicast_client_cb |
| struct | bt_audio_unicast_server_cb |
| struct | bt_audio_broadcast_sink_cb |
| struct | bt_audio_stream_ops |
| Stream operation. More... | |
| struct | bt_audio_discover_params |
| struct | bt_audio_unicast_group_stream_param |
| struct | bt_audio_unicast_group_stream_pair_param |
| Parameter struct for the unicast group functions. More... | |
| struct | bt_audio_unicast_group_param |
| struct | bt_audio_broadcast_source_stream_param |
| struct | bt_audio_broadcast_source_subgroup_param |
| struct | bt_audio_broadcast_source_create_param |
Macros | |
| #define | BT_AUDIO_BROADCAST_ID_SIZE 3 /* octets */ |
| #define | BT_AUDIO_CONTEXT_TYPE_ANY |
| #define | BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL 0x00 |
| #define | BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED 0x01 |
| #define | BROADCAST_SNK_STREAM_CNT 0 |
| #define | BROADCAST_SNK_SUBGROUP_CNT 0 |
| #define | BT_CODEC_DATA(_type, _bytes...) |
| Helper to declare elements of bt_codec_data arrays. More... | |
| #define | BT_CODEC(_id, _cid, _vid, _data, _meta) |
| Helper to declare bt_codec structure. More... | |
| #define | BT_AUDIO_LOCATION_ANY |
| #define | BT_CODEC_QOS(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd) |
| Helper to declare elements of bt_codec_qos. More... | |
| #define | BT_CODEC_QOS_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd) |
| Helper to declare Input Unframed bt_codec_qos. More... | |
| #define | BT_CODEC_QOS_FRAMED(_interval, _sdu, _rtn, _latency, _pd) |
| Helper to declare Input Framed bt_codec_qos. More... | |
| #define | BT_CODEC_QOS_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, _pd_max, _pref_pd_min, _pref_pd_max) |
| Helper to declare elements of bt_codec_qos_pref. More... | |
| #define | BT_AUDIO_LC3_PRESET(_codec, _qos) |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_8_1_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 8_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_8_2_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 8_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_16_1_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 16_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_16_2_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 16_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_24_1_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 24_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_24_2_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 24_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_32_1_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 32_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_32_2_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 32_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_441_1_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 441_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_441_2_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 441_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_1_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_2_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_3_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_3_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_4_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_4_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_5_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 8_5_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_6_1(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_6_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_8_1_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 8_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_8_2_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 8_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_16_1_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 16_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_16_2_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 16_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_24_1_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 24_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_24_2_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 24_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_32_1_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 32_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_32_2_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 32_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_441_1_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 441_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_441_2_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 441_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_1_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_2_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_3_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_3_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_4_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_4_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_5_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_5_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_UNICAST_PRESET_48_6_2(_loc, _stream_context) |
| Helper to declare LC3 Unicast 48_6_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 8_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 8_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 16_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 16_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 24_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 24_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 32_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 32_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 441_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 441_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_1_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_2_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_3_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_4_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_5_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_6_1 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 8_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 8_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 16_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 16_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 24_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 24_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 32_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 32_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 441_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 441_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_1_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_2_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_3_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_4_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_5_2 codec configuration. More... | |
| #define | BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2(_loc, _stream_context) |
| Helper to declare LC3 Broadcast 48_6_2 codec configuration. More... | |
Typedefs | |
| typedef void(* | bt_audio_discover_func_t) (struct bt_conn *conn, struct bt_codec *codec, struct bt_audio_ep *ep, struct bt_audio_discover_params *params) |
| Discover Audio capabilities and endpoints callback function. More... | |
Functions | |
| int | bt_audio_unicast_client_register_cb (const struct bt_audio_unicast_client_cb *cb) |
| Register unicast client callbacks. More... | |
| void | bt_audio_stream_cb_register (struct bt_audio_stream *stream, struct bt_audio_stream_ops *ops) |
| Register Audio callbacks for a stream. More... | |
| int | bt_audio_unicast_server_register_cb (const struct bt_audio_unicast_server_cb *cb) |
| Register unicast server callbacks. More... | |
| int | bt_audio_unicast_server_unregister_cb (const struct bt_audio_unicast_server_cb *cb) |
| Unregister unicast server callbacks. More... | |
| int | bt_audio_discover (struct bt_conn *conn, struct bt_audio_discover_params *params) |
| Discover remote capabilities and endpoints. More... | |
| int | bt_audio_stream_config (struct bt_conn *conn, struct bt_audio_stream *stream, struct bt_audio_ep *ep, struct bt_codec *codec) |
| Configure Audio Stream. More... | |
| int | bt_audio_stream_reconfig (struct bt_audio_stream *stream, struct bt_codec *codec) |
| Reconfigure Audio Stream. More... | |
| int | bt_audio_stream_qos (struct bt_conn *conn, struct bt_audio_unicast_group *group) |
| Configure Audio Stream QoS. More... | |
| int | bt_audio_stream_enable (struct bt_audio_stream *stream, struct bt_codec_data *meta, size_t meta_count) |
| Enable Audio Stream. More... | |
| int | bt_audio_stream_metadata (struct bt_audio_stream *stream, struct bt_codec_data *meta, size_t meta_count) |
| Change Audio Stream Metadata. More... | |
| int | bt_audio_stream_disable (struct bt_audio_stream *stream) |
| Disable Audio Stream. More... | |
| int | bt_audio_stream_start (struct bt_audio_stream *stream) |
| Start Audio Stream. More... | |
| int | bt_audio_stream_stop (struct bt_audio_stream *stream) |
| Stop Audio Stream. More... | |
| int | bt_audio_stream_release (struct bt_audio_stream *stream) |
| Release Audio Stream. More... | |
| int | bt_audio_stream_send (struct bt_audio_stream *stream, struct net_buf *buf, uint16_t seq_num, uint32_t ts) |
| Send data to Audio stream. More... | |
| int | bt_audio_unicast_group_create (struct bt_audio_unicast_group_param *param, struct bt_audio_unicast_group **unicast_group) |
| Create audio unicast group. More... | |
| int | bt_audio_unicast_group_add_streams (struct bt_audio_unicast_group *unicast_group, struct bt_audio_unicast_group_stream_pair_param params[], size_t num_param) |
| Add streams to a unicast group as a unicast client. More... | |
| int | bt_audio_unicast_group_delete (struct bt_audio_unicast_group *unicast_group) |
| Delete audio unicast group. More... | |
| 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... | |
| int | bt_codec_cfg_get_freq (const struct bt_codec *codec) |
| Extract the frequency from a codec configuration. More... | |
| int | bt_codec_cfg_get_frame_duration_us (const struct bt_codec *codec) |
| Extract frame duration from BT codec config. More... | |
| int | bt_codec_cfg_get_chan_allocation_val (const struct bt_codec *codec, uint32_t *chan_allocation) |
| Extract channel allocation from BT codec config. More... | |
| int | bt_codec_cfg_get_octets_per_frame (const struct bt_codec *codec) |
| Extract frame size in octets from BT codec config. More... | |
| int | bt_codec_cfg_get_frame_blocks_per_sdu (const struct bt_codec *codec, bool fallback_to_default) |
| Extract number of audio frame blockss in each SDU from BT codec config. More... | |
| bool | bt_codec_get_val (const struct bt_codec *codec, uint8_t type, const struct bt_codec_data **data) |
| Lookup a specific value based on type. More... | |
Bluetooth Audio handling.