Zephyr API Documentation  3.5.0
A Scalable Open Source RTOS
3.5.0
All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
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_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 /* 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
 
#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_UNICAST_ANNOUNCEMENT_GENERAL   0x00
 
#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED   0x01
 
#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_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_STREAM_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_PROHIBITED = 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 Capability type. 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.
 

Detailed Description

Bluetooth Audio.

Macro Definition Documentation

◆ BT_AUDIO_BROADCAST_CODE_SIZE

#define BT_AUDIO_BROADCAST_CODE_SIZE   16

◆ 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 /* octets */

◆ 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, \
.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:46
__UINT8_TYPE__ uint8_t
Definition: stdint.h:88
Codec capability structure.
Definition: audio.h:312
uint16_t cid
Codec Company ID.
Definition: audio.h:322

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_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, \
.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:340

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, \
.latency = _latency, \
.pd = _pd, \
})
Codec QoS structure.
Definition: audio.h:452

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:401
@ BT_AUDIO_CODEC_QOS_FRAMING_FRAMED
Definition: audio.h:415
@ BT_AUDIO_CODEC_QOS_2M
Definition: audio.h:421

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
Definition: audio.h:414

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
Definition: audio.h:58
@ BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM
Definition: audio.h:61
@ BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL
Definition: audio.h:54
@ BT_AUDIO_CONTEXT_TYPE_RINGTONE
Definition: audio.h:59
@ BT_AUDIO_CONTEXT_TYPE_LIVE
Definition: audio.h:56
@ BT_AUDIO_CONTEXT_TYPE_MEDIA
Definition: audio.h:52
@ BT_AUDIO_CONTEXT_TYPE_GAME
Definition: audio.h:53
@ BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS
Definition: audio.h:57
@ BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS
Definition: audio.h:55
@ BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL
Definition: audio.h:51
@ BT_AUDIO_CONTEXT_TYPE_ALERTS
Definition: audio.h:60
@ BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED
Definition: audio.h:50

Any known context.

◆ BT_AUDIO_LOCATION_ANY

#define BT_AUDIO_LOCATION_ANY

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

Value:
@ BT_AUDIO_LOCATION_FRONT_CENTER
Definition: audio.h:251
@ BT_AUDIO_LOCATION_TOP_BACK_LEFT
Definition: audio.h:265
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2
Definition: audio.h:258
@ BT_AUDIO_LOCATION_TOP_SIDE_RIGHT
Definition: audio.h:268
@ BT_AUDIO_LOCATION_FRONT_RIGHT
Definition: audio.h:250
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT
Definition: audio.h:272
@ BT_AUDIO_LOCATION_BACK_RIGHT
Definition: audio.h:254
@ BT_AUDIO_LOCATION_TOP_CENTER
Definition: audio.h:264
@ BT_AUDIO_LOCATION_LEFT_SURROUND
Definition: audio.h:275
@ BT_AUDIO_LOCATION_TOP_FRONT_RIGHT
Definition: audio.h:262
@ BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER
Definition: audio.h:256
@ BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE
Definition: audio.h:274
@ BT_AUDIO_LOCATION_TOP_BACK_RIGHT
Definition: audio.h:266
@ BT_AUDIO_LOCATION_BACK_LEFT
Definition: audio.h:253
@ BT_AUDIO_LOCATION_RIGHT_SURROUND
Definition: audio.h:276
@ BT_AUDIO_LOCATION_SIDE_RIGHT
Definition: audio.h:260
@ BT_AUDIO_LOCATION_TOP_FRONT_LEFT
Definition: audio.h:261
@ BT_AUDIO_LOCATION_SIDE_LEFT
Definition: audio.h:259
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT
Definition: audio.h:271
@ BT_AUDIO_LOCATION_TOP_FRONT_CENTER
Definition: audio.h:263
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1
Definition: audio.h:252
@ BT_AUDIO_LOCATION_FRONT_LEFT
Definition: audio.h:249
@ BT_AUDIO_LOCATION_FRONT_LEFT_WIDE
Definition: audio.h:273
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER
Definition: audio.h:270
@ BT_AUDIO_LOCATION_BACK_CENTER
Definition: audio.h:257
@ BT_AUDIO_LOCATION_TOP_SIDE_LEFT
Definition: audio.h:267
@ BT_AUDIO_LOCATION_TOP_BACK_CENTER
Definition: audio.h:269
@ BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER
Definition: audio.h:255

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:170
@ BT_AUDIO_METADATA_TYPE_VENDOR
Vendor specific metadata.
Definition: audio.h:173
@ BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE
Broadcast Audio Immediate Rendering flag
Definition: audio.h:167
@ BT_AUDIO_METADATA_TYPE_PREF_CONTEXT
Preferred audio context.
Definition: audio.h:126
#define IN_RANGE(val, min, max)
Checks if a value is within range.
Definition: util.h:372

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

◆ 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

◆ BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED

#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED   0x01

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

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

Codec QoS Preferred PHY.

Enumerator
BT_AUDIO_CODEC_QOS_1M 
BT_AUDIO_CODEC_QOS_2M 
BT_AUDIO_CODEC_QOS_CODED 

◆ 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 
BT_AUDIO_ACTIVE_STATE_ENABLED 

◆ bt_audio_codec_qos_framing

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

Codec QoS Framing.

Enumerator
BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED 
BT_AUDIO_CODEC_QOS_FRAMING_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 
BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED 
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 

◆ bt_audio_dir

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

Audio Capability type.

Enumerator
BT_AUDIO_DIR_SINK 
BT_AUDIO_DIR_SOURCE 

◆ 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_PROHIBITED 
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_BACK_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_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_STREAM_LANG 

Stream language.

   3 octet lower case language code defined by ISO 639-3
BT_AUDIO_METADATA_TYPE_CCID_LIST 

Array of 8-bit CCID values.

BT_AUDIO_METADATA_TYPE_PARENTAL_RATING 

Parental rating.

   See @ref 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 @ref 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 
BT_AUDIO_PARENTAL_RATING_AGE_ANY 
BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE 
BT_AUDIO_PARENTAL_RATING_AGE_18_OR_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