Zephyr Project API  3.1.0
A Scalable Open Source RTOS
Bluetooth Audio

Bluetooth Audio. More...

Modules

 Audio Broadcast APIs
 Audio Broadcast APIs.
 
 Audio Client APIs
 
 Audio Server APIs
 
 Codec config parsing APIs
 Audio codec Config 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   0
 Audio Context Type, Generic Audio. More...
 
#define BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED   BIT(0)
 Unspecified type. More...
 
#define BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL   BIT(1)
 Conversational audio. More...
 
#define BT_AUDIO_CONTEXT_TYPE_MEDIA   BIT(2)
 Media. More...
 
#define BT_AUDIO_CONTEXT_TYPE_GAME   BIT(3)
 Game audio. More...
 
#define BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL   BIT(4)
 Instructional audio. More...
 
#define BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS   BIT(5)
 Voice assistant audio. More...
 
#define BT_AUDIO_CONTEXT_TYPE_LIVE   BIT(6)
 Live audio. More...
 
#define BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS   BIT(7)
 Sound effects. More...
 
#define BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS   BIT(8)
 Notification and reminder sounds. More...
 
#define BT_AUDIO_CONTEXT_TYPE_RINGTONE   BIT(9)
 Ringtone as in a call alert. More...
 
#define BT_AUDIO_CONTEXT_TYPE_ALERTS   BIT(10)
 Alarms and timers. More...
 
#define BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM   BIT(11)
 Emergency alarm. More...
 
#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_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
 
#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_audio_meta_type {
  BT_CODEC_META_PREFER_CONTEXT = 0x01 , BT_CODEC_META_CONTEXT = 0x02 , BT_CODEC_META_PROGRAM_INFO = 0x03 , BT_CODEC_META_LANGUAGE = 0x04 ,
  BT_CODEC_META_CCID_LIST = 0x05 , BT_CODEC_META_PARENTAL_RATING = 0x06 , BT_CODEC_META_PROGRAM_INFO_URI = 0x07 , BT_CODEC_META_EXTENDED_METADATA = 0xFE ,
  BT_CODEC_META_VENDOR_SPECIFIC = 0xFF
}
 Meta data type ids used for LTV encoded metadata. More...
 
enum  bt_audio_location {
  BT_AUDIO_LOCATION_FRONT_LEFT = BIT(0) , BT_AUDIO_LOCATION_FRONT_RIGHT = BIT(1) , BT_AUDIO_LOCATION_FRONT_CENTER = BIT(2) , BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 = BIT(3) ,
  BT_AUDIO_LOCATION_BACK_LEFT = BIT(4) , BT_AUDIO_LOCATION_BACK_RIGHT = BIT(5) , BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER = BIT(6) , BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER = BIT(7) ,
  BT_AUDIO_LOCATION_BACK_CENTER = BIT(8) , BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 = BIT(9) , BT_AUDIO_LOCATION_SIDE_LEFT = BIT(10) , BT_AUDIO_LOCATION_SIDE_RIGHT = BIT(11) ,
  BT_AUDIO_LOCATION_TOP_FRONT_LEFT = BIT(12) , BT_AUDIO_LOCATION_TOP_FRONT_RIGHT = BIT(13) , BT_AUDIO_LOCATION_TOP_FRONT_CENTER = BIT(14) , BT_AUDIO_LOCATION_TOP_CENTER = BIT(15) ,
  BT_AUDIO_LOCATION_TOP_BACK_LEFT = BIT(16) , BT_AUDIO_LOCATION_TOP_BECK_RIGHT = BIT(17) , BT_AUDIO_LOCATION_TOP_SIDE_LEFT = BIT(18) , BT_AUDIO_LOCATION_TOP_SIDE_RIGHT = BIT(19) ,
  BT_AUDIO_LOCATION_TOP_BACK_CENTER = BIT(20) , BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER = BIT(21) , BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT = BIT(22) , BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT = BIT(23) ,
  BT_AUDIO_LOCATION_FRONT_LEFT_WIDE = BIT(24) , BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE = BIT(25) , BT_AUDIO_LOCATION_LEFT_SURROUND = BIT(26) , BT_AUDIO_LOCATION_RIGHT_SURROUND = BIT(27)
}
 Location values for BT Audio. More...
 
enum  bt_audio_dir { BT_AUDIO_DIR_SINK = 0x01 , BT_AUDIO_DIR_SOURCE = 0x02 }
 Audio Capability type. 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...
 

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

Detailed Description

Bluetooth Audio.

Macro Definition Documentation

◆ BROADCAST_SNK_STREAM_CNT

#define BROADCAST_SNK_STREAM_CNT   0

◆ BROADCAST_SNK_SUBGROUP_CNT

#define BROADCAST_SNK_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(10)

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

Alarms and timers.

Alarms and timers; immediate alerts, for example, in a critical battery alarm, timer expiry or alarm clock, toaster cooker, kettle, microwave, etc.

◆ BT_AUDIO_CONTEXT_TYPE_ANY

#define BT_AUDIO_CONTEXT_TYPE_ANY

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

Value:
BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \
BT_AUDIO_CONTEXT_TYPE_MEDIA | \
BT_AUDIO_CONTEXT_TYPE_GAME | \
BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL | \
BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS | \
BT_AUDIO_CONTEXT_TYPE_LIVE | \
BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS | \
BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS | \
BT_AUDIO_CONTEXT_TYPE_RINGTONE | \
BT_AUDIO_CONTEXT_TYPE_ALERTS | \
BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM)
#define BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED
Unspecified type.
Definition: audio.h:48

Any known context.

◆ BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL

#define BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL   BIT(1)

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

Conversational audio.

Conversation between humans. as, for example, in telephony or video calls.

◆ BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM

#define BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM   BIT(11)

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

Emergency alarm.

Emergency alerts as, for example, with fire alarms or other urgent alerts.

◆ BT_AUDIO_CONTEXT_TYPE_GAME

#define BT_AUDIO_CONTEXT_TYPE_GAME   BIT(3)

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

Game audio.

Audio assiociated with video gaming as, for example, gaming media, gaming effects; music and in-game voice chat between participants; or a mix of all the above.

◆ BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL

#define BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL   BIT(4)

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

Instructional audio.

Instructional audio as, for example, in navigation, traffic announcements or user guidance.

◆ BT_AUDIO_CONTEXT_TYPE_LIVE

#define BT_AUDIO_CONTEXT_TYPE_LIVE   BIT(6)

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

Live audio.

Live audio, for example, from a microphone where audio is perceived both through a direct acoustic path and through an LE Audio Stream.

◆ BT_AUDIO_CONTEXT_TYPE_MEDIA

#define BT_AUDIO_CONTEXT_TYPE_MEDIA   BIT(2)

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

Media.

Media as, for example, in music, public radio, podcast or video soundtrack. Conversation between humans as, for example, in telephony or video calls.

◆ BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS

#define BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS   BIT(8)

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

Notification and reminder sounds.

Notification and reminder sounds; attention-seeking audio, for example, in beeps signaling the arrival of a message.

◆ BT_AUDIO_CONTEXT_TYPE_PROHIBITED

#define BT_AUDIO_CONTEXT_TYPE_PROHIBITED   0

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

Audio Context Type, Generic Audio.

These values are defined by the Generic Audio Assigned Numbers

Prohibited. Excluded from usage.

◆ BT_AUDIO_CONTEXT_TYPE_RINGTONE

#define BT_AUDIO_CONTEXT_TYPE_RINGTONE   BIT(9)

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

Ringtone as in a call alert.

Alerts the user to an incoming call, for example, an incoming telephony or video call, including traditional cellular as well as VoIP and Push-to-Talk.

◆ BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS

#define BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS   BIT(7)

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

Sound effects.

Sound effects including keyboard and touch feedback; menu and user interface sounds; and other system sounds.

◆ BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED

#define BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED   BIT(0)

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

Unspecified type.

Unspecified, matches any audio content.

◆ BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS

#define BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS   BIT(5)

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

Voice assistant audio.

Man-machine communication, for example, with voice recognition or virtual assistants.

◆ BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1

#define BT_AUDIO_LC3_BROADCAST_PRESET_16_1_1

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

Value:
BT_CODEC_LC3_QOS_7_5_UNFRAMED(30u, 2u, 8u, 40000u) \
)
#define BT_AUDIO_LC3_PRESET(_codec, _qos)
Definition: audio.h:472
#define BT_CODEC_LC3_QOS_7_5_UNFRAMED(_sdu, _rtn, _latency, _pd)
Helper to declare LC3 codec QoS for 7.5ms interval unframed input.
Definition: lc3.h:445
#define BT_CODEC_LC3_CONFIG_16_1
Helper to declare LC3 16.1 codec configuration.
Definition: lc3.h:340

◆ 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/zephyr/bluetooth/audio/audio.h>

Value:
BT_CODEC_LC3_QOS_10_UNFRAMED(40u, 2u, 10u, 40000u) \
)
#define BT_CODEC_LC3_QOS_10_UNFRAMED(_sdu, _rtn, _latency, _pd)
Helper to declare LC3 codec QoS for 10ms interval unframed input.
Definition: lc3.h:456
#define BT_CODEC_LC3_CONFIG_16_2
Helper to declare LC3 16.2 codec configuration.
Definition: lc3.h:347

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/zephyr/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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

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

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/zephyr/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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

Value:
BT_CODEC_QOS_2M, 97u, 4u, 24u, 40000u) \
)
#define BT_CODEC_QOS(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd)
Helper to declare elements of bt_codec_qos.
Definition: audio.h:325
#define BT_CODEC_QOS_FRAMED(_interval, _sdu, _rtn, _latency, _pd)
Helper to declare Input Framed bt_codec_qos.
Definition: audio.h:372
@ BT_CODEC_QOS_2M
Definition: audio.h:346
#define BT_CODEC_LC3_CONFIG_441_1
Helper to declare LC3 441.1 codec configuration.
Definition: lc3.h:383

◆ 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/zephyr/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:390

◆ 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/zephyr/bluetooth/audio/audio.h>

Value:
BT_CODEC_LC3_QOS_7_5_UNFRAMED(75u, 4u, 15u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_1
Helper to declare LC3 48.1 codec configuration.
Definition: lc3.h:397

◆ 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/zephyr/bluetooth/audio/audio.h>

Value:
BT_CODEC_LC3_QOS_10_UNFRAMED(100u, 4u, 20u, 40000u) \
)
#define BT_CODEC_LC3_CONFIG_48_2
Helper to declare LC3 48.2 codec configuration.
Definition: lc3.h:404

◆ 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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/bluetooth/audio/audio.h>

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

◆ 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/zephyr/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/zephyr/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/zephyr/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/zephyr/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:162

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/zephyr/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:358
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88

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_QOS

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

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

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

Helper to declare elements of bt_codec_qos.

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

◆ BT_CODEC_QOS_FRAMED

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

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

Value:
_rtn, _latency, _pd)

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_PREF

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

#include <include/zephyr/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)

◆ BT_CODEC_QOS_UNFRAMED

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

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

Value:
_rtn, _latency, _pd)
#define BT_CODEC_QOS_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd)
Helper to declare Input Unframed bt_codec_qos.
Definition: audio.h:359

Helper to declare Input Unframed bt_codec_qos.

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

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

Codec QoS Framing.

Enumerator
BT_CODEC_QOS_UNFRAMED 
BT_CODEC_QOS_FRAMED 

◆ anonymous enum

anonymous enum

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

Codec QoS Preferred PHY.

Enumerator
BT_CODEC_QOS_1M 
BT_CODEC_QOS_2M 
BT_CODEC_QOS_CODED 

◆ bt_audio_dir

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

Audio Capability type.

Enumerator
BT_AUDIO_DIR_SINK 
BT_AUDIO_DIR_SOURCE 

◆ bt_audio_location

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

Location values for BT Audio.

These values are defined by the Generic Audio Assigned Numbers, bluetooth.com

Enumerator
BT_AUDIO_LOCATION_FRONT_LEFT 
BT_AUDIO_LOCATION_FRONT_RIGHT 
BT_AUDIO_LOCATION_FRONT_CENTER 
BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 
BT_AUDIO_LOCATION_BACK_LEFT 
BT_AUDIO_LOCATION_BACK_RIGHT 
BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER 
BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER 
BT_AUDIO_LOCATION_BACK_CENTER 
BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 
BT_AUDIO_LOCATION_SIDE_LEFT 
BT_AUDIO_LOCATION_SIDE_RIGHT 
BT_AUDIO_LOCATION_TOP_FRONT_LEFT 
BT_AUDIO_LOCATION_TOP_FRONT_RIGHT 
BT_AUDIO_LOCATION_TOP_FRONT_CENTER 
BT_AUDIO_LOCATION_TOP_CENTER 
BT_AUDIO_LOCATION_TOP_BACK_LEFT 
BT_AUDIO_LOCATION_TOP_BECK_RIGHT 
BT_AUDIO_LOCATION_TOP_SIDE_LEFT 
BT_AUDIO_LOCATION_TOP_SIDE_RIGHT 
BT_AUDIO_LOCATION_TOP_BACK_CENTER 
BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER 
BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT 
BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT 
BT_AUDIO_LOCATION_FRONT_LEFT_WIDE 
BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE 
BT_AUDIO_LOCATION_LEFT_SURROUND 
BT_AUDIO_LOCATION_RIGHT_SURROUND 

◆ bt_audio_meta_type

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

Meta data type ids used for LTV encoded metadata.

These values are defined by the Generic Audio Assigned Numbers, bluetooth.com

Enumerator
BT_CODEC_META_PREFER_CONTEXT 
BT_CODEC_META_CONTEXT 
BT_CODEC_META_PROGRAM_INFO 
BT_CODEC_META_LANGUAGE 
BT_CODEC_META_CCID_LIST 
BT_CODEC_META_PARENTAL_RATING 
BT_CODEC_META_PROGRAM_INFO_URI 
BT_CODEC_META_EXTENDED_METADATA 
BT_CODEC_META_VENDOR_SPECIFIC 

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/zephyr/bluetooth/audio/audio.h>

Register Audio callbacks for a stream.

Register Audio callbacks for a stream.

Parameters
streamStream object.
opsStream operations structure.