Zephyr API Documentation  3.7.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
Bluetooth Audio

Bluetooth Audio. More...

Modules

 Codec capability parsing APIs
 Audio codec capabilities APIs.
 
 Codec config parsing APIs
 Audio codec Config APIs.
 

Data Structures

struct  bt_audio_codec_octets_per_codec_frame
 struct to hold minimum and maximum supported codec frame sizes More...
 
struct  bt_audio_codec_cap
 Codec capability structure. More...
 
struct  bt_audio_codec_cfg
 Codec specific configuration structure. More...
 
struct  bt_audio_codec_qos
 Codec QoS structure. More...
 
struct  bt_audio_codec_qos_pref
 Audio Stream Quality of Service Preference structure. More...
 

Macros

#define BT_AUDIO_BROADCAST_ID_SIZE   3
 Size of the broadcast ID in octets.
 
#define BT_AUDIO_BROADCAST_ID_MAX   0xFFFFFFU
 Maximum broadcast ID value.
 
#define BT_AUDIO_PD_PREF_NONE   0x000000U
 Indicates that the server have no preference for the presentation delay.
 
#define BT_AUDIO_PD_MAX   0xFFFFFFU
 Maximum presentation delay in microseconds.
 
#define BT_AUDIO_BROADCAST_CODE_SIZE   16
 Maximum size of the broadcast code in octets.
 
#define BT_AUDIO_BROADCAST_NAME_LEN_MIN   4
 The minimum size of a Broadcast Name as defined by Bluetooth Assigned Numbers.
 
#define BT_AUDIO_BROADCAST_NAME_LEN_MAX   128
 The maximum size of a Broadcast Name as defined by Bluetooth Assigned Numbers.
 
#define BT_AUDIO_LANG_SIZE   3
 Size of the stream language value, e.g.
 
#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN   1
 Minimum supported channel counts.
 
#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX   8
 Maximum supported channel counts.
 
#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(...)    ((enum bt_audio_codec_cap_chan_count)((FOR_EACH(BIT, (|), __VA_ARGS__)) >> 1))
 Channel count support capability.
 
#define BT_AUDIO_CONTEXT_TYPE_ANY
 Any known context.
 
#define BT_AUDIO_METADATA_TYPE_IS_KNOWN(_type)
 Helper to check whether metadata type is known by the stack.
 
#define BT_AUDIO_CODEC_DATA(_type, _bytes...)    (sizeof((uint8_t)_type) + sizeof((uint8_t[]){_bytes})), (_type), _bytes
 Helper to declare elements of bt_audio_codec_cap arrays.
 
#define BT_AUDIO_CODEC_CFG(_id, _cid, _vid, _data, _meta)
 Helper to declare Codec config parsing APIs.
 
#define BT_AUDIO_CODEC_CAP(_id, _cid, _vid, _data, _meta)
 Helper to declare Codec capability parsing APIs structure.
 
#define BT_AUDIO_LOCATION_ANY
 Any known location.
 
#define BT_AUDIO_CODEC_QOS(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd)
 Helper to declare elements of bt_audio_codec_qos.
 
#define BT_AUDIO_CODEC_QOS_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Input Unframed bt_audio_codec_qos.
 
#define BT_AUDIO_CODEC_QOS_FRAMED(_interval, _sdu, _rtn, _latency, _pd)
 Helper to declare Input Framed bt_audio_codec_qos.
 
#define BT_AUDIO_CODEC_QOS_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, _pd_max, _pref_pd_min, _pref_pd_max)
 Helper to declare elements of bt_audio_codec_qos_pref.
 

Enumerations

enum  bt_audio_codec_cap_type {
  BT_AUDIO_CODEC_CAP_TYPE_FREQ = 0x01 , BT_AUDIO_CODEC_CAP_TYPE_DURATION = 0x02 , BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT = 0x03 , BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN = 0x04 ,
  BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT = 0x05
}
 Codec capability types. More...
 
enum  bt_audio_codec_cap_freq {
  BT_AUDIO_CODEC_CAP_FREQ_8KHZ = BIT(0) , BT_AUDIO_CODEC_CAP_FREQ_11KHZ = BIT(1) , BT_AUDIO_CODEC_CAP_FREQ_16KHZ = BIT(2) , BT_AUDIO_CODEC_CAP_FREQ_22KHZ = BIT(3) ,
  BT_AUDIO_CODEC_CAP_FREQ_24KHZ = BIT(4) , BT_AUDIO_CODEC_CAP_FREQ_32KHZ = BIT(5) , BT_AUDIO_CODEC_CAP_FREQ_44KHZ = BIT(6) , BT_AUDIO_CODEC_CAP_FREQ_48KHZ = BIT(7) ,
  BT_AUDIO_CODEC_CAP_FREQ_88KHZ = BIT(8) , BT_AUDIO_CODEC_CAP_FREQ_96KHZ = BIT(9) , BT_AUDIO_CODEC_CAP_FREQ_176KHZ = BIT(10) , BT_AUDIO_CODEC_CAP_FREQ_192KHZ = BIT(11) ,
  BT_AUDIO_CODEC_CAP_FREQ_384KHZ = BIT(12) , BT_AUDIO_CODEC_CAP_FREQ_ANY
}
 Supported frequencies bitfield. More...
 
enum  bt_audio_codec_cap_frame_dur {
  BT_AUDIO_CODEC_CAP_DURATION_7_5 = BIT(0) , BT_AUDIO_CODEC_CAP_DURATION_10 = BIT(1) , BT_AUDIO_CODEC_CAP_DURATION_ANY , BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 = BIT(4) ,
  BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 = BIT(5)
}
 Supported frame durations bitfield. More...
 
enum  bt_audio_codec_cap_chan_count {
  BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 = BIT(0) , BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 = BIT(1) , BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 = BIT(2) , BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 = BIT(3) ,
  BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 = BIT(4) , BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 = BIT(5) , BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 = BIT(6) , BT_AUDIO_CODEC_CAP_CHAN_COUNT_8 = BIT(7) ,
  BT_AUDIO_CODEC_CAP_CHAN_COUNT_ANY
}
 Supported audio capabilities channel count bitfield. More...
 
enum  bt_audio_codec_cfg_type {
  BT_AUDIO_CODEC_CFG_FREQ = 0x01 , BT_AUDIO_CODEC_CFG_DURATION = 0x02 , BT_AUDIO_CODEC_CFG_CHAN_ALLOC = 0x03 , BT_AUDIO_CODEC_CFG_FRAME_LEN = 0x04 ,
  BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU = 0x05
}
 Codec configuration types. More...
 
enum  bt_audio_codec_cfg_freq {
  BT_AUDIO_CODEC_CFG_FREQ_8KHZ = 0x01 , BT_AUDIO_CODEC_CFG_FREQ_11KHZ = 0x02 , BT_AUDIO_CODEC_CFG_FREQ_16KHZ = 0x03 , BT_AUDIO_CODEC_CFG_FREQ_22KHZ = 0x04 ,
  BT_AUDIO_CODEC_CFG_FREQ_24KHZ = 0x05 , BT_AUDIO_CODEC_CFG_FREQ_32KHZ = 0x06 , BT_AUDIO_CODEC_CFG_FREQ_44KHZ = 0x07 , BT_AUDIO_CODEC_CFG_FREQ_48KHZ = 0x08 ,
  BT_AUDIO_CODEC_CFG_FREQ_88KHZ = 0x09 , BT_AUDIO_CODEC_CFG_FREQ_96KHZ = 0x0a , BT_AUDIO_CODEC_CFG_FREQ_176KHZ = 0x0b , BT_AUDIO_CODEC_CFG_FREQ_192KHZ = 0x0c ,
  BT_AUDIO_CODEC_CFG_FREQ_384KHZ = 0x0d
}
 Codec configuration sampling freqency. More...
 
enum  bt_audio_codec_cfg_frame_dur { BT_AUDIO_CODEC_CFG_DURATION_7_5 = 0x00 , BT_AUDIO_CODEC_CFG_DURATION_10 = 0x01 }
 Codec configuration frame duration. More...
 
enum  bt_audio_context {
  BT_AUDIO_CONTEXT_TYPE_PROHIBITED = 0 , BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED = BIT(0) , BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL = BIT(1) , BT_AUDIO_CONTEXT_TYPE_MEDIA = BIT(2) ,
  BT_AUDIO_CONTEXT_TYPE_GAME = BIT(3) , BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL = BIT(4) , BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS = BIT(5) , BT_AUDIO_CONTEXT_TYPE_LIVE = BIT(6) ,
  BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS = BIT(7) , BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS = BIT(8) , BT_AUDIO_CONTEXT_TYPE_RINGTONE = BIT(9) , BT_AUDIO_CONTEXT_TYPE_ALERTS = BIT(10) ,
  BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM = BIT(11)
}
 Audio Context Type for Generic Audio. More...
 
enum  bt_audio_parental_rating {
  BT_AUDIO_PARENTAL_RATING_NO_RATING = 0x00 , BT_AUDIO_PARENTAL_RATING_AGE_ANY = 0x01 , BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE = 0x02 , BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE = 0x03 ,
  BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE = 0x04 , BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE = 0x05 , BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE = 0x06 , BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE = 0x07 ,
  BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE = 0x08 , BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE = 0x09 , BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE = 0x0A , BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE = 0x0B ,
  BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE = 0x0C , BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE = 0x0D , BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE = 0x0E , BT_AUDIO_PARENTAL_RATING_AGE_18_OR_ABOVE = 0x0F
}
 Parental rating defined by the Generic Audio assigned numbers (bluetooth.com). More...
 
enum  bt_audio_active_state { BT_AUDIO_ACTIVE_STATE_DISABLED = 0x00 , BT_AUDIO_ACTIVE_STATE_ENABLED = 0x01 }
 Audio Active State defined by the Generic Audio assigned numbers (bluetooth.com). More...
 
enum  bt_audio_metadata_type {
  BT_AUDIO_METADATA_TYPE_PREF_CONTEXT = 0x01 , BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT = 0x02 , BT_AUDIO_METADATA_TYPE_PROGRAM_INFO = 0x03 , BT_AUDIO_METADATA_TYPE_LANG = 0x04 ,
  BT_AUDIO_METADATA_TYPE_CCID_LIST = 0x05 , BT_AUDIO_METADATA_TYPE_PARENTAL_RATING = 0x06 , BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI = 0x07 , BT_AUDIO_METADATA_TYPE_AUDIO_STATE = 0x08 ,
  BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE = 0x09 , BT_AUDIO_METADATA_TYPE_EXTENDED = 0xFE , BT_AUDIO_METADATA_TYPE_VENDOR = 0xFF
}
 Codec metadata type IDs. More...
 
enum  bt_audio_location {
  BT_AUDIO_LOCATION_MONO_AUDIO = 0 , 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_BACK_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 direction from the perspective of the BAP Unicast Server / BAP Broadcast Sink. More...
 
enum  bt_audio_codec_qos_framing { BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED = 0x00 , BT_AUDIO_CODEC_QOS_FRAMING_FRAMED = 0x01 }
 Codec QoS Framing. More...
 
enum  { BT_AUDIO_CODEC_QOS_1M = BIT(0) , BT_AUDIO_CODEC_QOS_2M = BIT(1) , BT_AUDIO_CODEC_QOS_CODED = BIT(2) }
 Codec QoS Preferred PHY. More...
 

Functions

int bt_audio_data_parse (const uint8_t ltv[], size_t size, bool(*func)(struct bt_data *data, void *user_data), void *user_data)
 Helper for parsing length-type-value data.
 
uint8_t bt_audio_get_chan_count (enum bt_audio_location chan_allocation)
 Function to get the number of channels from the channel allocation.
 

Unicast Announcement Type

#define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL   0x00
 Unicast Server is connectable and is requesting a connection.
 
#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED   0x01
 Unicast Server is connectable but is not requesting a connection.
 

Detailed Description

Bluetooth Audio.

Macro Definition Documentation

◆ BT_AUDIO_BROADCAST_CODE_SIZE

#define BT_AUDIO_BROADCAST_CODE_SIZE   16

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

Maximum size of the broadcast code in octets.

◆ BT_AUDIO_BROADCAST_ID_MAX

#define BT_AUDIO_BROADCAST_ID_MAX   0xFFFFFFU

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

Maximum broadcast ID value.

◆ BT_AUDIO_BROADCAST_ID_SIZE

#define BT_AUDIO_BROADCAST_ID_SIZE   3

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

Size of the broadcast ID in octets.

◆ BT_AUDIO_BROADCAST_NAME_LEN_MAX

#define BT_AUDIO_BROADCAST_NAME_LEN_MAX   128

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

The maximum size of a Broadcast Name as defined by Bluetooth Assigned Numbers.

◆ BT_AUDIO_BROADCAST_NAME_LEN_MIN

#define BT_AUDIO_BROADCAST_NAME_LEN_MIN   4

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

The minimum size of a Broadcast Name as defined by Bluetooth Assigned Numbers.

◆ BT_AUDIO_CODEC_CAP

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

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

Value:
((struct bt_audio_codec_cap){ \
/* Use HCI data path as default, can be overwritten by application */ \
.path_id = BT_ISO_DATA_PATH_HCI, \
.ctlr_transcode = false, \
.id = (_id), \
.cid = (_cid), \
.vid = (_vid), \
.data_len = sizeof((uint8_t[])_data), \
.data = _data, \
.meta_len = sizeof((uint8_t[])_meta), \
.meta = _meta, \
})
#define BT_ISO_DATA_PATH_HCI
Value to set the ISO data path over HCi.
Definition: iso.h:51
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Codec capability structure.
Definition: audio.h:669
uint8_t data[CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE]
Codec Specific Capabilities Data.
Definition: audio.h:692
uint16_t cid
Codec Company ID.
Definition: audio.h:685
uint8_t meta[CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE]
Codec Specific Capabilities Metadata.
Definition: audio.h:698
size_t data_len
Codec Specific Capabilities Data count.
Definition: audio.h:690
size_t meta_len
Codec Specific Capabilities Metadata count.
Definition: audio.h:696

Helper to declare Codec capability parsing APIs structure.

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

◆ BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX

#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX   8

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

Maximum supported channel counts.

◆ BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN

#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN   1

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

Minimum supported channel counts.

◆ BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT

#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT (   ...)     ((enum bt_audio_codec_cap_chan_count)((FOR_EACH(BIT, (|), __VA_ARGS__)) >> 1))

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

Channel count support capability.

Macro accepts variable number of channel counts. The allowed channel counts are defined by specification and have to be in range from BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN to BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX inclusive.

Example to support 1 and 3 channels: BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(1, 3)

◆ BT_AUDIO_CODEC_CFG

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

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

Value:
((struct bt_audio_codec_cfg){ \
/* Use HCI data path as default, can be overwritten by application */ \
.path_id = BT_ISO_DATA_PATH_HCI, \
.ctlr_transcode = false, \
.id = _id, \
.cid = _cid, \
.vid = _vid, \
.data_len = sizeof((uint8_t[])_data), \
.data = _data, \
.meta_len = sizeof((uint8_t[])_meta), \
.meta = _meta, \
})
Codec specific configuration structure.
Definition: audio.h:703

Helper to declare Codec config parsing APIs.

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

◆ BT_AUDIO_CODEC_DATA

#define BT_AUDIO_CODEC_DATA (   _type,
  _bytes... 
)     (sizeof((uint8_t)_type) + sizeof((uint8_t[]){_bytes})), (_type), _bytes

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

Helper to declare elements of bt_audio_codec_cap arrays.

This macro is mainly for creating an array of struct bt_audio_codec_cap data arrays.

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

◆ BT_AUDIO_CODEC_QOS

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

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

Value:
((struct bt_audio_codec_qos){ \
.interval = _interval, \
.framing = _framing, \
.phy = _phy, \
.sdu = _sdu, \
.rtn = _rtn, \
IF_ENABLED(UTIL_OR(IS_ENABLED(CONFIG_BT_BAP_BROADCAST_SOURCE), \
IS_ENABLED(CONFIG_BT_BAP_UNICAST)), \
(.latency = _latency,)) \
.pd = _pd, \
})
#define IS_ENABLED(config_macro)
Check for macro definition in compiler-visible expressions.
Definition: util_macro.h:124
#define UTIL_OR(a, b)
Like a || b, but does evaluation and short-circuiting at C preprocessor time.
Definition: util_macro.h:378
Codec QoS structure.
Definition: audio.h:849
uint16_t latency
Maximum Transport Latency.
Definition: audio.h:903

Helper to declare elements of bt_audio_codec_qos.

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

◆ BT_AUDIO_CODEC_QOS_FRAMED

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

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

Value:
_sdu, _rtn, _latency, _pd)
#define BT_AUDIO_CODEC_QOS(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd)
Helper to declare elements of bt_audio_codec_qos.
Definition: audio.h:791
@ BT_AUDIO_CODEC_QOS_2M
LE 2M PHY.
Definition: audio.h:817
@ BT_AUDIO_CODEC_QOS_FRAMING_FRAMED
Packets are always framed.
Definition: audio.h:809

Helper to declare Input Framed bt_audio_codec_qos.

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

◆ BT_AUDIO_CODEC_QOS_PREF

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

#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_audio_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_AUDIO_CODEC_QOS_UNFRAMED

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

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

Value:
_sdu, _rtn, _latency, _pd)
@ BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED
Packets may be framed or unframed.
Definition: audio.h:807

Helper to declare Input Unframed bt_audio_codec_qos.

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

◆ BT_AUDIO_CONTEXT_TYPE_ANY

#define BT_AUDIO_CONTEXT_TYPE_ANY

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

Value:
@ BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS
Notification and reminder sounds; attention-seeking audio, for example, in beeps signaling the arriva...
Definition: audio.h:342
@ BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM
Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts.
Definition: audio.h:354
@ BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL
Instructional audio, for example, in navigation, announcements, or user guidance.
Definition: audio.h:325
@ BT_AUDIO_CONTEXT_TYPE_RINGTONE
Alerts the user to an incoming call, for example, an incoming telephony or video call,...
Definition: audio.h:347
@ BT_AUDIO_CONTEXT_TYPE_LIVE
Live audio, for example, from a microphone where audio is perceived both through a direct acoustic pa...
Definition: audio.h:332
@ BT_AUDIO_CONTEXT_TYPE_MEDIA
Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio.
Definition: audio.h:318
@ BT_AUDIO_CONTEXT_TYPE_GAME
Audio associated with video gaming, for example gaming media; gaming effects; music and in-game voice...
Definition: audio.h:323
@ BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS
Sound effects including keyboard and touch feedback; menu and user interface sounds; and other system...
Definition: audio.h:337
@ BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS
Man-machine communication, for example, with voice recognition or virtual assistants.
Definition: audio.h:327
@ BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL
Conversation between humans, for example, in telephony or video calls, including traditional cellular...
Definition: audio.h:316
@ BT_AUDIO_CONTEXT_TYPE_ALERTS
Alarms and timers; immediate alerts, for example, in a critical battery alarm, timer expiry or alarm ...
Definition: audio.h:352
@ BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED
Identifies audio where the use case context does not match any other defined value,...
Definition: audio.h:311

Any known context.

◆ BT_AUDIO_LANG_SIZE

#define BT_AUDIO_LANG_SIZE   3

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

Size of the stream language value, e.g.

"eng"

◆ BT_AUDIO_LOCATION_ANY

#define BT_AUDIO_LOCATION_ANY

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

Value:
@ BT_AUDIO_LOCATION_FRONT_CENTER
Front Center.
Definition: audio.h:583
@ BT_AUDIO_LOCATION_TOP_BACK_LEFT
Top Back Left.
Definition: audio.h:611
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2
Low Frequency Effects 2.
Definition: audio.h:597
@ BT_AUDIO_LOCATION_TOP_SIDE_RIGHT
Top Side Right.
Definition: audio.h:617
@ BT_AUDIO_LOCATION_FRONT_RIGHT
Front Right.
Definition: audio.h:581
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT
Bottom Front Right.
Definition: audio.h:625
@ BT_AUDIO_LOCATION_BACK_RIGHT
Back Right.
Definition: audio.h:589
@ BT_AUDIO_LOCATION_TOP_CENTER
Top Center.
Definition: audio.h:609
@ BT_AUDIO_LOCATION_LEFT_SURROUND
Left Surround.
Definition: audio.h:631
@ BT_AUDIO_LOCATION_TOP_FRONT_RIGHT
Top Front Right.
Definition: audio.h:605
@ BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER
Front Right of Center.
Definition: audio.h:593
@ BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE
Front Right Wide.
Definition: audio.h:629
@ BT_AUDIO_LOCATION_TOP_BACK_RIGHT
Top Back Right.
Definition: audio.h:613
@ BT_AUDIO_LOCATION_BACK_LEFT
Back Left.
Definition: audio.h:587
@ BT_AUDIO_LOCATION_RIGHT_SURROUND
Right Surround.
Definition: audio.h:633
@ BT_AUDIO_LOCATION_SIDE_RIGHT
Side Right.
Definition: audio.h:601
@ BT_AUDIO_LOCATION_TOP_FRONT_LEFT
Top Front Left.
Definition: audio.h:603
@ BT_AUDIO_LOCATION_SIDE_LEFT
Side Left.
Definition: audio.h:599
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT
Bottom Front Left.
Definition: audio.h:623
@ BT_AUDIO_LOCATION_TOP_FRONT_CENTER
Top Front Center.
Definition: audio.h:607
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1
Low Frequency Effects 1.
Definition: audio.h:585
@ BT_AUDIO_LOCATION_FRONT_LEFT
Front Left.
Definition: audio.h:579
@ BT_AUDIO_LOCATION_FRONT_LEFT_WIDE
Front Left Wide.
Definition: audio.h:627
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER
Bottom Front Center.
Definition: audio.h:621
@ BT_AUDIO_LOCATION_BACK_CENTER
Back Center.
Definition: audio.h:595
@ BT_AUDIO_LOCATION_TOP_SIDE_LEFT
Top Side Left.
Definition: audio.h:615
@ BT_AUDIO_LOCATION_TOP_BACK_CENTER
Top Back Center.
Definition: audio.h:619
@ BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER
Front Left of Center.
Definition: audio.h:591

Any known location.

◆ BT_AUDIO_METADATA_TYPE_IS_KNOWN

#define BT_AUDIO_METADATA_TYPE_IS_KNOWN (   _type)

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

Value:
@ BT_AUDIO_METADATA_TYPE_EXTENDED
Extended metadata.
Definition: audio.h:487
@ BT_AUDIO_METADATA_TYPE_VENDOR
Vendor specific metadata.
Definition: audio.h:490
@ BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE
Broadcast Audio Immediate Rendering flag
Definition: audio.h:484
@ BT_AUDIO_METADATA_TYPE_PREF_CONTEXT
Preferred audio context.
Definition: audio.h:438
#define IN_RANGE(val, min, max)
Checks if a value is within range.
Definition: util.h:422

Helper to check whether metadata type is known by the stack.

Note
_type is evaluated thrice.

◆ BT_AUDIO_PD_MAX

#define BT_AUDIO_PD_MAX   0xFFFFFFU

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

Maximum presentation delay in microseconds.

◆ BT_AUDIO_PD_PREF_NONE

#define BT_AUDIO_PD_PREF_NONE   0x000000U

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

Indicates that the server have no preference for the presentation delay.

◆ BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL

#define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL   0x00

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

Unicast Server is connectable and is requesting a connection.

◆ BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED

#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED   0x01

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

Unicast Server is connectable but is not requesting a connection.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

Codec QoS Preferred PHY.

Enumerator
BT_AUDIO_CODEC_QOS_1M 

LE 1M PHY.

BT_AUDIO_CODEC_QOS_2M 

LE 2M PHY.

BT_AUDIO_CODEC_QOS_CODED 

LE Coded PHY.

◆ bt_audio_active_state

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

Audio Active State defined by the Generic Audio assigned numbers (bluetooth.com).

Enumerator
BT_AUDIO_ACTIVE_STATE_DISABLED 

No audio data is being transmitted.

BT_AUDIO_ACTIVE_STATE_ENABLED 

Audio data is being transmitted.

◆ bt_audio_codec_cap_chan_count

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

Supported audio capabilities channel count bitfield.

Enumerator
BT_AUDIO_CODEC_CAP_CHAN_COUNT_1 

Supporting 1 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_2 

Supporting 2 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_3 

Supporting 3 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_4 

Supporting 4 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_5 

Supporting 5 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_6 

Supporting 6 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_7 

Supporting 7 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_8 

Supporting 8 channel.

BT_AUDIO_CODEC_CAP_CHAN_COUNT_ANY 

Supporting all channels.

◆ bt_audio_codec_cap_frame_dur

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

Supported frame durations bitfield.

Enumerator
BT_AUDIO_CODEC_CAP_DURATION_7_5 

7.5 msec frame duration capability

BT_AUDIO_CODEC_CAP_DURATION_10 

10 msec frame duration capability

BT_AUDIO_CODEC_CAP_DURATION_ANY 

Any frame duration capability.

BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 

7.5 msec preferred frame duration capability.

This shall only be set if BT_AUDIO_CODEC_CAP_DURATION_7_5 is also set, and if BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 is not set.

BT_AUDIO_CODEC_CAP_DURATION_PREFER_10 

10 msec preferred frame duration capability

This shall only be set if BT_AUDIO_CODEC_CAP_DURATION_10 is also set, and if BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5 is not set.

◆ bt_audio_codec_cap_freq

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

Supported frequencies bitfield.

Enumerator
BT_AUDIO_CODEC_CAP_FREQ_8KHZ 

8 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_11KHZ 

11.025 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_16KHZ 

16 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_22KHZ 

22.05 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_24KHZ 

24 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_32KHZ 

32 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_44KHZ 

44.1 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_48KHZ 

48 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_88KHZ 

88.2 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_96KHZ 

96 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_176KHZ 

176.4 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_192KHZ 

192 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_384KHZ 

384 Khz sampling frequency

BT_AUDIO_CODEC_CAP_FREQ_ANY 

Any frequency capability.

◆ bt_audio_codec_cap_type

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

Codec capability types.

Used to build and parse codec capabilities as specified in the PAC specification. Source is assigned numbers for Generic Audio, bluetooth.com.

Enumerator
BT_AUDIO_CODEC_CAP_TYPE_FREQ 

Supported sampling frequencies.

BT_AUDIO_CODEC_CAP_TYPE_DURATION 

Supported frame durations.

BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT 

Supported audio channel counts.

BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN 

Supported octets per codec frame.

BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT 

Supported maximum codec frames per SDU

◆ bt_audio_codec_cfg_frame_dur

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

Codec configuration frame duration.

Enumerator
BT_AUDIO_CODEC_CFG_DURATION_7_5 

7.5 msec Frame Duration configuration

BT_AUDIO_CODEC_CFG_DURATION_10 

10 msec Frame Duration configuration

◆ bt_audio_codec_cfg_freq

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

Codec configuration sampling freqency.

Enumerator
BT_AUDIO_CODEC_CFG_FREQ_8KHZ 

8 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_11KHZ 

11.025 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_16KHZ 

16 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_22KHZ 

22.05 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_24KHZ 

24 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_32KHZ 

32 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_44KHZ 

44.1 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_48KHZ 

48 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_88KHZ 

88.2 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_96KHZ 

96 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_176KHZ 

176.4 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_192KHZ 

192 Khz codec sampling frequency

BT_AUDIO_CODEC_CFG_FREQ_384KHZ 

384 Khz codec sampling frequency

◆ bt_audio_codec_cfg_type

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

Codec configuration types.

Used to build and parse codec configurations as specified in the ASCS and BAP specifications. Source is assigned numbers for Generic Audio, bluetooth.com.

Enumerator
BT_AUDIO_CODEC_CFG_FREQ 

Sampling frequency.

BT_AUDIO_CODEC_CFG_DURATION 

Frame duration.

BT_AUDIO_CODEC_CFG_CHAN_ALLOC 

Audio channel allocation.

BT_AUDIO_CODEC_CFG_FRAME_LEN 

Octets per codec frame.

BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU 

Codec frame blocks per SDU.

◆ bt_audio_codec_qos_framing

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

Codec QoS Framing.

Enumerator
BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED 

Packets may be framed or unframed.

BT_AUDIO_CODEC_QOS_FRAMING_FRAMED 

Packets are always framed.

◆ bt_audio_context

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

Audio Context Type for Generic Audio.

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

Enumerator
BT_AUDIO_CONTEXT_TYPE_PROHIBITED 

Prohibited.

BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED 

Identifies audio where the use case context does not match any other defined value, or where the context is unknown or cannot be determined.

BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL 

Conversation between humans, for example, in telephony or video calls, including traditional cellular as well as VoIP and Push-to-Talk.

BT_AUDIO_CONTEXT_TYPE_MEDIA 

Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio.

BT_AUDIO_CONTEXT_TYPE_GAME 

Audio associated with video gaming, 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 

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

BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS 

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

BT_AUDIO_CONTEXT_TYPE_LIVE 

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_SOUND_EFFECTS 

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

BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS 

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

BT_AUDIO_CONTEXT_TYPE_RINGTONE 

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_ALERTS 

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_EMERGENCY_ALARM 

Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts.

◆ bt_audio_dir

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

Audio direction from the perspective of the BAP Unicast Server / BAP Broadcast Sink.

Enumerator
BT_AUDIO_DIR_SINK 

Audio direction sink.

For a BAP Unicast Client or Broadcast Source this is considered outgoing audio (TX). For a BAP Unicast Server or Broadcast Sink this is considered incoming audio (RX).

BT_AUDIO_DIR_SOURCE 

Audio direction source.

For a BAP Unicast Client or Broadcast Source this is considered incoming audio (RX). For a BAP Unicast Server or Broadcast Sink this is considered outgoing audio (TX).

◆ bt_audio_location

#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_MONO_AUDIO 

Mono Audio (no specified Audio Location)

BT_AUDIO_LOCATION_FRONT_LEFT 

Front Left.

BT_AUDIO_LOCATION_FRONT_RIGHT 

Front Right.

BT_AUDIO_LOCATION_FRONT_CENTER 

Front Center.

BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 

Low Frequency Effects 1.

BT_AUDIO_LOCATION_BACK_LEFT 

Back Left.

BT_AUDIO_LOCATION_BACK_RIGHT 

Back Right.

BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER 

Front Left of Center.

BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER 

Front Right of Center.

BT_AUDIO_LOCATION_BACK_CENTER 

Back Center.

BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 

Low Frequency Effects 2.

BT_AUDIO_LOCATION_SIDE_LEFT 

Side Left.

BT_AUDIO_LOCATION_SIDE_RIGHT 

Side Right.

BT_AUDIO_LOCATION_TOP_FRONT_LEFT 

Top Front Left.

BT_AUDIO_LOCATION_TOP_FRONT_RIGHT 

Top Front Right.

BT_AUDIO_LOCATION_TOP_FRONT_CENTER 

Top Front Center.

BT_AUDIO_LOCATION_TOP_CENTER 

Top Center.

BT_AUDIO_LOCATION_TOP_BACK_LEFT 

Top Back Left.

BT_AUDIO_LOCATION_TOP_BACK_RIGHT 

Top Back Right.

BT_AUDIO_LOCATION_TOP_SIDE_LEFT 

Top Side Left.

BT_AUDIO_LOCATION_TOP_SIDE_RIGHT 

Top Side Right.

BT_AUDIO_LOCATION_TOP_BACK_CENTER 

Top Back Center.

BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER 

Bottom Front Center.

BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT 

Bottom Front Left.

BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT 

Bottom Front Right.

BT_AUDIO_LOCATION_FRONT_LEFT_WIDE 

Front Left Wide.

BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE 

Front Right Wide.

BT_AUDIO_LOCATION_LEFT_SURROUND 

Left Surround.

BT_AUDIO_LOCATION_RIGHT_SURROUND 

Right Surround.

◆ bt_audio_metadata_type

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

Codec metadata type IDs.

Metadata types defined by the Generic Audio assigned numbers (bluetooth.com).

Enumerator
BT_AUDIO_METADATA_TYPE_PREF_CONTEXT 

Preferred audio context.

Bitfield of preferred audio contexts.

If 0, the context type is not a preferred use case for this codec configuration.

See the BT_AUDIO_CONTEXT_* for valid values.

BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT 

Streaming audio context.

Bitfield of streaming audio contexts.

If 0, the context type is not a preferred use case for this codec configuration.

See the BT_AUDIO_CONTEXT_* for valid values.

BT_AUDIO_METADATA_TYPE_PROGRAM_INFO 

UTF-8 encoded title or summary of stream content.

BT_AUDIO_METADATA_TYPE_LANG 

Language.

3 octet lower case language code defined by ISO 639-3 Possible values can be found at https://iso639-3.sil.org/code_tables/639/data

BT_AUDIO_METADATA_TYPE_CCID_LIST 

Array of 8-bit CCID values.

BT_AUDIO_METADATA_TYPE_PARENTAL_RATING 

Parental rating.

See bt_audio_parental_rating for valid values.

BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI 

UTF-8 encoded URI for additional Program information.

BT_AUDIO_METADATA_TYPE_AUDIO_STATE 

Audio active state.

See bt_audio_active_state for valid values.

BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE 

Broadcast Audio Immediate Rendering flag

BT_AUDIO_METADATA_TYPE_EXTENDED 

Extended metadata.

BT_AUDIO_METADATA_TYPE_VENDOR 

Vendor specific metadata.

◆ bt_audio_parental_rating

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

Parental rating defined by the Generic Audio assigned numbers (bluetooth.com).

The numbering scheme is aligned with Annex F of EN 300 707 v1.2.1 which defined parental rating for viewing.

Enumerator
BT_AUDIO_PARENTAL_RATING_NO_RATING 

No rating.

BT_AUDIO_PARENTAL_RATING_AGE_ANY 

For all ages.

BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE 

Recommended for listeners of age 5 and above.

BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE 

Recommended for listeners of age 6 and above.

BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE 

Recommended for listeners of age 7 and above.

BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE 

Recommended for listeners of age 8 and above.

BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE 

Recommended for listeners of age 9 and above.

BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE 

Recommended for listeners of age 10 and above.

BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE 

Recommended for listeners of age 11 and above.

BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE 

Recommended for listeners of age 12 and above.

BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE 

Recommended for listeners of age 13 and above.

BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE 

Recommended for listeners of age 14 and above.

BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE 

Recommended for listeners of age 15 and above.

BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE 

Recommended for listeners of age 16 and above.

BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE 

Recommended for listeners of age 17 and above.

BT_AUDIO_PARENTAL_RATING_AGE_18_OR_ABOVE 

Recommended for listeners of age 18 and above.

Function Documentation

◆ bt_audio_data_parse()

int bt_audio_data_parse ( const uint8_t  ltv[],
size_t  size,
bool(*)(struct bt_data *data, void *user_data)  func,
void *  user_data 
)

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

Helper for parsing length-type-value data.

Parameters
ltvLength-type-value (LTV) encoded data.
sizeSize of the ltv data.
funcCallback function which will be called for each element that's found in the data. The callback should return true to continue parsing, or false to stop parsing.
user_dataUser data to be passed to the callback.
Return values
0if all entries were parsed.
-EINVALif the data is incorrectly encoded
-ECANCELEDif parsing was prematurely cancelled by the callback

◆ bt_audio_get_chan_count()

uint8_t bt_audio_get_chan_count ( enum bt_audio_location  chan_allocation)

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

Function to get the number of channels from the channel allocation.

Parameters
chan_allocationThe channel allocation
Returns
The number of channels