Zephyr API Documentation  3.0.0
A Scalable Open Source RTOS
3.0.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Bluetooth Audio

Bluetooth Audio. More...

Modules

 Audio Client APIs
 

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_server_cb
 
struct  bt_audio_broadcast_sink_cb
 
struct  bt_audio_stream_ops
 Stream operation. More...
 

Macros

#define BT_AUDIO_BROADCAST_ID_SIZE   3 /* octets */
 
#define BT_AUDIO_CONTEXT_TYPE_PROHIBITED   BIT(0)
 
#define BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED   BIT(1)
 
#define BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL   BIT(2)
 
#define BT_AUDIO_CONTEXT_TYPE_MEDIA   BIT(3)
 
#define BT_AUDIO_CONTEXT_TYPE_GAME   BIT(4)
 
#define BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL   BIT(5)
 
#define BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS   BIT(6)
 
#define BT_AUDIO_CONTEXT_TYPE_LIVE   BIT(7)
 
#define BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS   BIT(8)
 
#define BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS   BIT(9)
 
#define BT_AUDIO_CONTEXT_TYPE_RINGTONE   BIT(10)
 
#define BT_AUDIO_CONTEXT_TYPE_ALERTS   BIT(11)
 
#define BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM   BIT(12)
 
#define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL   0x00
 
#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED   0x01
 
#define BROADCAST_SNK_STREAM_CNT   0
 
#define BROADCAST_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_CODEC_META_BASE   0x01
 
#define BT_CODEC_META_PREFER_CONTEXT   (BT_CODEC_META_BASE)
 
#define BT_CODEC_META_CONTEXT   (BT_CODEC_META_BASE + 1)
 
#define BT_CODEC_META_CONTEXT_NONE   BIT(0)
 
#define BT_CODEC_META_CONTEXT_VOICE   BIT(1)
 
#define BT_CODEC_META_CONTEXT_MEDIA   BIT(2)
 
#define BT_CODEC_META_CONTEXT_INSTRUCTION   BIT(3)
 
#define BT_CODEC_META_CONTEXT_ATTENTION   BIT(4)
 
#define BT_CODEC_META_CONTEXT_ALERT   BIT(5)
 
#define BT_CODEC_META_CONTEXT_MAN_MACHINE   BIT(6)
 
#define BT_CODEC_META_CONTEXT_EMERGENCY   BIT(7)
 
#define BT_CODEC_META_CONTEXT_RINGTONE   BIT(8)
 
#define BT_CODEC_META_CONTEXT_TV   BIT(9)
 
#define BT_CODEC_META_CONTEXT_ANY
 
#define BT_CODEC_QOS(_dir, _interval, _framing, _phy, _sdu, _rtn, _latency, _pd)
 Helper to declare elements of bt_codec_qos. More...
 
#define BT_CODEC_QOS_IN_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Input Unframed bt_codec_qos. More...
 
#define BT_CODEC_QOS_OUT_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Output Unframed bt_code *. More...
 
#define BT_CODEC_QOS_INOUT_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Input/Output Unframed bt_codec_qos. More...
 
#define BT_CODEC_QOS_IN_FRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Input Framed bt_codec_qos. More...
 
#define BT_CODEC_QOS_OUT_FRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Output Framed bt_codec_qos. More...
 
#define BT_CODEC_QOS_INOUT_FRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Output 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
 
#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_1
 
#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_2
 
#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2
 
#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2
 

Enumerations

enum  { BT_CODEC_QOS_IN , BT_CODEC_QOS_OUT , BT_CODEC_QOS_INOUT }
 Audio QoS direction. More...
 
enum  { BT_CODEC_QOS_UNFRAMED = 0x00 , BT_CODEC_QOS_FRAMED = 0x01 }
 Codec QoS Framing. More...
 
enum  { BT_CODEC_QOS_1M = BIT(0) , BT_CODEC_QOS_2M = BIT(1) , BT_CODEC_QOS_CODED = BIT(2) }
 Codec QoS Preferred PHY. More...
 
enum  bt_audio_pac_type { BT_AUDIO_SINK = 0x01 , BT_AUDIO_SOURCE = 0x02 }
 Audio Capability type. More...
 

Functions

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...
 

Detailed Description

Bluetooth Audio.

Macro Definition Documentation

◆ BROADCAST_SNK_STREAM_CNT

#define BROADCAST_SNK_STREAM_CNT   0

◆ BROADCAST_SUBGROUP_CNT

#define BROADCAST_SUBGROUP_CNT   0

◆ BT_AUDIO_BROADCAST_ID_SIZE

#define BT_AUDIO_BROADCAST_ID_SIZE   3 /* octets */

◆ BT_AUDIO_CONTEXT_TYPE_ALERTS

#define BT_AUDIO_CONTEXT_TYPE_ALERTS   BIT(11)

◆ BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL

#define BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL   BIT(2)

◆ BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM

#define BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM   BIT(12)

◆ BT_AUDIO_CONTEXT_TYPE_GAME

#define BT_AUDIO_CONTEXT_TYPE_GAME   BIT(4)

◆ BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL

#define BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL   BIT(5)

◆ BT_AUDIO_CONTEXT_TYPE_LIVE

#define BT_AUDIO_CONTEXT_TYPE_LIVE   BIT(7)

◆ BT_AUDIO_CONTEXT_TYPE_MEDIA

#define BT_AUDIO_CONTEXT_TYPE_MEDIA   BIT(3)

◆ BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS

#define BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS   BIT(9)

◆ BT_AUDIO_CONTEXT_TYPE_PROHIBITED

#define BT_AUDIO_CONTEXT_TYPE_PROHIBITED   BIT(0)

◆ BT_AUDIO_CONTEXT_TYPE_RINGTONE

#define BT_AUDIO_CONTEXT_TYPE_RINGTONE   BIT(10)

◆ BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS

#define BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS   BIT(8)

◆ BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED

#define BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED   BIT(1)

◆ BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS

#define BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS   BIT(6)

◆ BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1

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

Value:
BT_CODEC_LC3_QOS_7_5_INOUT_UNFRAMED(30u, 2u, 8u, 40000u) \
)
#define BT_AUDIO_LC3_PRESET(_codec, _qos)
Definition: audio.h:478
#define BT_CODEC_LC3_QOS_7_5_INOUT_UNFRAMED(_sdu, _rtn, _latency, _pd)
Helper to declare LC3 codec QoS for 7.5ms interval unframed in/out.
Definition: lc3.h:391
#define BT_CODEC_LC3_CONFIG_16_1
Helper to declare LC3 16.1 codec configuration.
Definition: lc3.h:276

◆ BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_1

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

Value:
BT_CODEC_LC3_QOS_10_INOUT_UNFRAMED(40u, 2u, 10u, 40000u) \
)
#define BT_CODEC_LC3_QOS_10_INOUT_UNFRAMED(_sdu, _rtn, _latency, _pd)
Helper to declare LC3 codec QoS for 10ms interval unframed in/out.
Definition: lc3.h:412
#define BT_CODEC_LC3_CONFIG_16_2
Helper to declare LC3 16.2 codec configuration.
Definition: lc3.h:283

Mandatory to support as both broadcast source and sink

◆ BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_16_2_2

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

Value:

Mandatory to support as both broadcast source and sink

◆ BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_1

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

Value:
BT_CODEC_LC3_QOS_7_5_INOUT_UNFRAMED(45u, 2u, 8u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_24_1
Helper to declare LC3 24.1 codec configuration.
Definition: lc3.h:291

◆ BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_24_1_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_1

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

Value:
BT_CODEC_LC3_QOS_10_INOUT_UNFRAMED(60u, 2u, 10u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_24_2
Helper to declare LC3 24.2 codec configuration.
Definition: lc3.h:298

Mandatory to support as broadcast sink

◆ BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_24_2_2

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

Value:

Mandatory to support as broadcast sink

◆ BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_1

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

Value:
BT_CODEC_LC3_QOS_7_5_INOUT_UNFRAMED(60u, 2u, 8u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_32_1
Helper to declare LC3 32.1 codec configuration.
Definition: lc3.h:305

◆ BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_32_1_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_1

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

Value:
BT_CODEC_LC3_QOS_10_INOUT_UNFRAMED(80u, 2u, 10u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_32_2
Helper to declare LC3 32.2 codec configuration.
Definition: lc3.h:312

◆ BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_32_2_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_1

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

Value:
BT_CODEC_QOS_2M, 97u, 4u, 24u, 40000u) \
)
#define BT_CODEC_QOS(_dir, _interval, _framing, _phy, _sdu, _rtn, _latency, _pd)
Helper to declare elements of bt_codec_qos.
Definition: audio.h:265
@ BT_CODEC_QOS_2M
Definition: audio.h:294
@ BT_CODEC_QOS_FRAMED
Definition: audio.h:288
@ BT_CODEC_QOS_OUT
Definition: audio.h:281
#define BT_CODEC_LC3_CONFIG_441_1
Helper to declare LC3 441.1 codec configuration.
Definition: lc3.h:319

◆ BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_441_1_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_1

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

Value:
BT_CODEC_QOS_2M, 130u, 4u, 31u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_441_2
Helper to declare LC3 441.2 codec configuration.
Definition: lc3.h:326

◆ BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_441_2_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_1

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

Value:
BT_CODEC_LC3_QOS_7_5_OUT_UNFRAMED(75u, 4u, 15u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_1
Helper to declare LC3 48.1 codec configuration.
Definition: lc3.h:333
#define BT_CODEC_LC3_QOS_7_5_OUT_UNFRAMED(_sdu, _rtn, _latency, _pd)
Helper to declare LC3 codec QoS for 7.5ms interval unframed output.
Definition: lc3.h:386

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_1_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_1

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

Value:
BT_CODEC_LC3_QOS_10_OUT_UNFRAMED(100u, 4u, 20u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_2
Helper to declare LC3 48.2 codec configuration.
Definition: lc3.h:340
#define BT_CODEC_LC3_QOS_10_OUT_UNFRAMED(_sdu, _rtn, _latency, _pd)
Helper to declare LC3 codec QoS for 10ms interval unframed output.
Definition: lc3.h:407

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_2_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_1

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

Value:
BT_CODEC_LC3_QOS_7_5_OUT_UNFRAMED(90u, 4u, 15u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_3
Helper to declare LC3 48.3 codec configuration.
Definition: lc3.h:347

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_3_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_1

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

Value:
BT_CODEC_LC3_QOS_10_OUT_UNFRAMED(120u, 4u, 20u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_4
Helper to declare LC3 48.4 codec configuration.
Definition: lc3.h:354

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_4_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_1

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

Value:
BT_CODEC_LC3_QOS_7_5_OUT_UNFRAMED(117u, 4u, 15u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_5
Helper to declare LC3 48.5 codec configuration.
Definition: lc3.h:361

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_5_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_1

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

Value:
BT_CODEC_LC3_QOS_10_OUT_UNFRAMED(155u, 4u, 20u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_6
Helper to declare LC3 48.6 codec configuration.
Definition: lc3.h:368

◆ BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_48_6_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_1

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

Value:
BT_CODEC_LC3_QOS_7_5_INOUT_UNFRAMED(26u, 2u, 8u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_8_1
Helper to declare LC3 8.1 codec configuration.
Definition: lc3.h:262

◆ BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_8_1_2

◆ BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_1

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

Value:
BT_CODEC_LC3_QOS_10_INOUT_UNFRAMED(30u, 2u, 10u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_8_2
Helper to declare LC3 8.2 codec configuration.
Definition: lc3.h:269

◆ BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2

#define BT_AUDIO_LC3_BROADCAST_PRESET_8_2_2

◆ BT_AUDIO_LC3_PRESET

#define BT_AUDIO_LC3_PRESET (   _codec,
  _qos 
)

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

Value:
{ \
.codec = _codec, \
.qos = _qos, \
}

Helper to declare an LC3 preset structure

◆ BT_AUDIO_LC3_UNICAST_PRESET_16_1_1

#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_16_1_2

#define BT_AUDIO_LC3_UNICAST_PRESET_16_1_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_16_2_1

#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_1

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

Value:

Mandatory to support as both unicast client and server

◆ BT_AUDIO_LC3_UNICAST_PRESET_16_2_2

#define BT_AUDIO_LC3_UNICAST_PRESET_16_2_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_24_1_1

#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_24_1_2

#define BT_AUDIO_LC3_UNICAST_PRESET_24_1_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_24_2_1

#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_1

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

Value:

Mandatory to support as unicast server

◆ BT_AUDIO_LC3_UNICAST_PRESET_24_2_2

#define BT_AUDIO_LC3_UNICAST_PRESET_24_2_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_32_1_1

#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_32_1_2

#define BT_AUDIO_LC3_UNICAST_PRESET_32_1_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_32_2_1

#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_32_2_2

#define BT_AUDIO_LC3_UNICAST_PRESET_32_2_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_441_1_1

#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_441_1_2

#define BT_AUDIO_LC3_UNICAST_PRESET_441_1_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_441_2_1

#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_441_2_2

#define BT_AUDIO_LC3_UNICAST_PRESET_441_2_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_1_1

#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_1_2

#define BT_AUDIO_LC3_UNICAST_PRESET_48_1_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_2_1

#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_2_2

#define BT_AUDIO_LC3_UNICAST_PRESET_48_2_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_3_1

#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_3_2

#define BT_AUDIO_LC3_UNICAST_PRESET_48_3_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_4_1

#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_4_2

#define BT_AUDIO_LC3_UNICAST_PRESET_48_4_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_5_1

#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_5_2

#define BT_AUDIO_LC3_UNICAST_PRESET_48_5_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_6_1

#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_48_6_2

#define BT_AUDIO_LC3_UNICAST_PRESET_48_6_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_8_1_1

#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_8_1_2

#define BT_AUDIO_LC3_UNICAST_PRESET_8_1_2

◆ BT_AUDIO_LC3_UNICAST_PRESET_8_2_1

#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_1

◆ BT_AUDIO_LC3_UNICAST_PRESET_8_2_2

#define BT_AUDIO_LC3_UNICAST_PRESET_8_2_2

◆ BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL

#define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL   0x00

◆ BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED

#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED   0x01

◆ BT_CODEC

#define BT_CODEC (   _id,
  _cid,
  _vid,
  _data,
  _meta 
)

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

Value:
{ \
.id = _id, \
.cid = _cid, \
.vid = _vid, \
.data_count = ARRAY_SIZE(((struct bt_codec_data[]) _data)), \
.data = _data, \
.meta_count = ARRAY_SIZE(((struct bt_codec_data[]) _meta)), \
.meta = _meta, \
}
#define ARRAY_SIZE(array)
Number of elements in the given array.
Definition: util.h:108
Codec configuration structure.
Definition: audio.h:72

Helper to declare bt_codec structure.

Parameters
_idCodec ID
_cidCompany ID
_vidVendor ID
_dataCodec Specific Data in LVT format
_metaCodec Specific Metadata in LVT format

◆ BT_CODEC_DATA

#define BT_CODEC_DATA (   _type,
  _bytes... 
)

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

Value:
{ \
.data = BT_DATA(_type, ((uint8_t []) { _bytes }), \
sizeof((uint8_t []) { _bytes })) \
}
#define BT_DATA(_type, _data, _data_len)
Helper to declare elements of bt_data arrays.
Definition: bluetooth.h:309
__UINT8_TYPE__ uint8_t
Definition: stdint.h:58

Helper to declare elements of bt_codec_data arrays.

This macro is mainly for creating an array of struct bt_codec_data elements inside bt_codec which is then passed to the likes of bt_audio_stream_config or bt_audio_stream_reconfig.

Parameters
_typeType of advertising data field
_bytesVariable number of single-byte parameters

◆ BT_CODEC_META_BASE

#define BT_CODEC_META_BASE   0x01

◆ BT_CODEC_META_CONTEXT

#define BT_CODEC_META_CONTEXT   (BT_CODEC_META_BASE + 1)

◆ BT_CODEC_META_CONTEXT_ALERT

#define BT_CODEC_META_CONTEXT_ALERT   BIT(5)

◆ BT_CODEC_META_CONTEXT_ANY

#define BT_CODEC_META_CONTEXT_ANY

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

Value:
BT_CODEC_META_CONTEXT_VOICE | \
BT_CODEC_META_CONTEXT_MEDIA | \
BT_CODEC_META_CONTEXT_INSTRUCTION | \
BT_CODEC_META_CONTEXT_ATTENTION | \
BT_CODEC_META_CONTEXT_ALERT | \
BT_CODEC_META_CONTEXT_MAN_MACHINE | \
BT_CODEC_META_CONTEXT_EMERGENCY | \
BT_CODEC_META_CONTEXT_RINGTONE | \
BT_CODEC_META_CONTEXT_TV)
#define BT_CODEC_META_CONTEXT_NONE
Definition: audio.h:123

◆ BT_CODEC_META_CONTEXT_ATTENTION

#define BT_CODEC_META_CONTEXT_ATTENTION   BIT(4)

◆ BT_CODEC_META_CONTEXT_EMERGENCY

#define BT_CODEC_META_CONTEXT_EMERGENCY   BIT(7)

◆ BT_CODEC_META_CONTEXT_INSTRUCTION

#define BT_CODEC_META_CONTEXT_INSTRUCTION   BIT(3)

◆ BT_CODEC_META_CONTEXT_MAN_MACHINE

#define BT_CODEC_META_CONTEXT_MAN_MACHINE   BIT(6)

◆ BT_CODEC_META_CONTEXT_MEDIA

#define BT_CODEC_META_CONTEXT_MEDIA   BIT(2)

◆ BT_CODEC_META_CONTEXT_NONE

#define BT_CODEC_META_CONTEXT_NONE   BIT(0)

◆ BT_CODEC_META_CONTEXT_RINGTONE

#define BT_CODEC_META_CONTEXT_RINGTONE   BIT(8)

◆ BT_CODEC_META_CONTEXT_TV

#define BT_CODEC_META_CONTEXT_TV   BIT(9)

◆ BT_CODEC_META_CONTEXT_VOICE

#define BT_CODEC_META_CONTEXT_VOICE   BIT(1)

◆ BT_CODEC_META_PREFER_CONTEXT

#define BT_CODEC_META_PREFER_CONTEXT   (BT_CODEC_META_BASE)

◆ BT_CODEC_QOS

#define BT_CODEC_QOS (   _dir,
  _interval,
  _framing,
  _phy,
  _sdu,
  _rtn,
  _latency,
  _pd 
)

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

Value:
{ \
.dir = _dir, \
.interval = _interval, \
.framing = _framing, \
.phy = _phy, \
.sdu = _sdu, \
.rtn = _rtn, \
.latency = _latency, \
.pd = _pd, \
}

Helper to declare elements of bt_codec_qos.

Parameters
_dirdirection
_intervalSDU interval (usec)
_framingFraming
_phyTarget PHY
_sduMaximum SDU Size
_rtnRetransmission number
_latencyMaximum Transport Latency (msec)
_pdPresentation Delay (usec)

◆ BT_CODEC_QOS_IN_FRAMED

#define BT_CODEC_QOS_IN_FRAMED (   _interval,
  _sdu,
  _rtn,
  _latency,
  _pd 
)

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

Value:
BT_CODEC_QOS_2M, _sdu, _rtn, _latency, _pd)
@ BT_CODEC_QOS_IN
Definition: audio.h:280

Helper to declare Input Framed bt_codec_qos.

Parameters
_intervalSDU interval (usec)
_sduMaximum SDU Size
_rtnRetransmission number
_latencyMaximum Transport Latency (msec)
_pdPresentation Delay (usec)

◆ BT_CODEC_QOS_IN_UNFRAMED

#define BT_CODEC_QOS_IN_UNFRAMED (   _interval,
  _sdu,
  _rtn,
  _latency,
  _pd 
)

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

Value:
BT_CODEC_QOS_2M, _sdu, _rtn, _latency, _pd)
@ BT_CODEC_QOS_UNFRAMED
Definition: audio.h:287

Helper to declare Input Unframed bt_codec_qos.

Parameters
_intervalSDU interval (usec)
_sduMaximum SDU Size
_rtnRetransmission number
_latencyMaximum Transport Latency (msec)
_pdPresentation Delay (usec)

◆ BT_CODEC_QOS_INOUT_FRAMED

#define BT_CODEC_QOS_INOUT_FRAMED (   _interval,
  _sdu,
  _rtn,
  _latency,
  _pd 
)

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

Value:
BT_CODEC_QOS_2M, _sdu, _rtn, _latency, _pd)
@ BT_CODEC_QOS_INOUT
Definition: audio.h:282

Helper to declare Output Framed bt_codec_qos.

Parameters
_intervalSDU interval (usec)
_sduMaximum SDU Size
_rtnRetransmission number
_latencyMaximum Transport Latency (msec)
_pdPresentation Delay (usec)

◆ BT_CODEC_QOS_INOUT_UNFRAMED

#define BT_CODEC_QOS_INOUT_UNFRAMED (   _interval,
  _sdu,
  _rtn,
  _latency,
  _pd 
)

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

Value:
BT_CODEC_QOS_2M, _sdu, _rtn, _latency, _pd)

Helper to declare Input/Output Unframed bt_codec_qos.

Parameters
_intervalSDU interval (usec)
_sduMaximum SDU Size
_rtnRetransmission number
_latencyMaximum Transport Latency (msec)
_pdPresentation Delay (usec)

◆ BT_CODEC_QOS_OUT_FRAMED

#define BT_CODEC_QOS_OUT_FRAMED (   _interval,
  _sdu,
  _rtn,
  _latency,
  _pd 
)

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

Value:
BT_CODEC_QOS_2M, _sdu, _rtn, _latency, _pd)

Helper to declare Output Framed bt_codec_qos.

Parameters
_intervalSDU interval (usec)
_sduMaximum SDU Size
_rtnRetransmission number
_latencyMaximum Transport Latency (msec)
_pdPresentation Delay (usec)

◆ BT_CODEC_QOS_OUT_UNFRAMED

#define BT_CODEC_QOS_OUT_UNFRAMED (   _interval,
  _sdu,
  _rtn,
  _latency,
  _pd 
)

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

Value:
BT_CODEC_QOS_2M, _sdu, _rtn, _latency, _pd)

Helper to declare Output Unframed bt_code *.

Parameters
_intervalSDU interval (usec)
_sduMaximum SDU Size
_rtnRetransmission number
_latencyMaximum Transport Latency (msec)
_pdPresentation Delay (usec)

◆ BT_CODEC_QOS_PREF

#define BT_CODEC_QOS_PREF (   _unframed_supported,
  _phy,
  _rtn,
  _latency,
  _pd_min,
  _pd_max,
  _pref_pd_min,
  _pref_pd_max 
)

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

Value:
{ \
.unframed_supported = _unframed_supported, \
.phy = _phy, \
.rtn = _rtn, \
.latency = _latency, \
.pd_min = _pd_min, \
.pd_max = _pd_max, \
.pref_pd_min = _pref_pd_min, \
.pref_pd_max = _pref_pd_max, \
}

Helper to declare elements of bt_codec_qos_pref.

Parameters
_unframed_supportedUnframed PDUs supported
_phyPreferred Target PHY
_rtnPreferred Retransmission number
_latencyPreferred Maximum Transport Latency (msec)
_pd_minMinimum Presentation Delay (usec)
_pd_maxMaximum Presentation Delay (usec)
_pref_pd_minPreferred Minimum Presentation Delay (usec)
_pref_pd_maxPreferred Maximum Presentation Delay (usec)

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

Audio QoS direction.

Enumerator
BT_CODEC_QOS_IN 
BT_CODEC_QOS_OUT 
BT_CODEC_QOS_INOUT 

◆ anonymous enum

anonymous enum

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

Codec QoS Framing.

Enumerator
BT_CODEC_QOS_UNFRAMED 
BT_CODEC_QOS_FRAMED 

◆ anonymous enum

anonymous enum

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

Codec QoS Preferred PHY.

Enumerator
BT_CODEC_QOS_1M 
BT_CODEC_QOS_2M 
BT_CODEC_QOS_CODED 

◆ bt_audio_pac_type

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

Audio Capability type.

Enumerator
BT_AUDIO_SINK 
BT_AUDIO_SOURCE 

Function Documentation

◆ bt_audio_stream_cb_register()

void bt_audio_stream_cb_register ( struct bt_audio_stream stream,
struct bt_audio_stream_ops ops 
)

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

Register Audio callbacks for a stream.

Register Audio callbacks for a stream.

Parameters
streamStream object.
opsStream operations structure.
Returns
0 in case of success or negative value in case of error.

◆ bt_audio_unicast_server_register_cb()

int bt_audio_unicast_server_register_cb ( const struct bt_audio_unicast_server_cb cb)

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

Register unicast server callbacks.

Only one callback structure can be registered, and attempting to registering more than one will result in an error.

Parameters
cbUnicast server callback structure.
Returns
0 in case of success or negative value in case of error.

◆ bt_audio_unicast_server_unregister_cb()

int bt_audio_unicast_server_unregister_cb ( const struct bt_audio_unicast_server_cb cb)

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

Unregister unicast server callbacks.

May only unregister a callback structure that has previously been registered by bt_audio_unicast_server_register_cb().

Parameters
cbUnicast server callback structure.
Returns
0 in case of success or negative value in case of error.