Zephyr API Documentation
3.6.99
A Scalable Open Source RTOS
|
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 | 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_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_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. | |
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. | |
Bluetooth Audio.
#define BT_AUDIO_BROADCAST_CODE_SIZE 16 |
#include <zephyr/bluetooth/audio/audio.h>
#define BT_AUDIO_BROADCAST_ID_MAX 0xFFFFFFU |
#include <zephyr/bluetooth/audio/audio.h>
Maximum broadcast ID value.
#define BT_AUDIO_BROADCAST_ID_SIZE 3 /* octets */ |
#include <zephyr/bluetooth/audio/audio.h>
#define BT_AUDIO_CODEC_CAP | ( | _id, | |
_cid, | |||
_vid, | |||
_data, | |||
_meta | |||
) |
#include <zephyr/bluetooth/audio/audio.h>
Helper to declare Codec capability parsing APIs structure.
_id | Codec ID |
_cid | Company ID |
_vid | Vendor ID |
_data | Codec Specific Data in LVT format |
_meta | Codec Specific Metadata in LVT format |
#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX 8 |
#include <zephyr/bluetooth/audio/audio.h>
Maximum supported channel counts.
#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN 1 |
#include <zephyr/bluetooth/audio/audio.h>
Minimum supported channel counts.
#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)
#define BT_AUDIO_CODEC_CFG | ( | _id, | |
_cid, | |||
_vid, | |||
_data, | |||
_meta | |||
) |
#include <zephyr/bluetooth/audio/audio.h>
Helper to declare Codec config parsing APIs.
_id | Codec ID |
_cid | Company ID |
_vid | Vendor ID |
_data | Codec Specific Data in LVT format |
_meta | Codec Specific Metadata in LVT format |
#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.
_type | Type of advertising data field |
_bytes | Variable number of single-byte parameters |
#define BT_AUDIO_CODEC_QOS | ( | _interval, | |
_framing, | |||
_phy, | |||
_sdu, | |||
_rtn, | |||
_latency, | |||
_pd | |||
) |
#include <zephyr/bluetooth/audio/audio.h>
Helper to declare elements of bt_audio_codec_qos.
_interval | SDU interval (usec) |
_framing | Framing |
_phy | Target PHY |
_sdu | Maximum SDU Size |
_rtn | Retransmission number |
_latency | Maximum Transport Latency (msec) |
_pd | Presentation Delay (usec) |
#define BT_AUDIO_CODEC_QOS_FRAMED | ( | _interval, | |
_sdu, | |||
_rtn, | |||
_latency, | |||
_pd | |||
) |
#include <zephyr/bluetooth/audio/audio.h>
Helper to declare Input Framed bt_audio_codec_qos.
_interval | SDU interval (usec) |
_sdu | Maximum SDU Size |
_rtn | Retransmission number |
_latency | Maximum Transport Latency (msec) |
_pd | Presentation Delay (usec) |
#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>
Helper to declare elements of bt_audio_codec_qos_pref.
_unframed_supported | Unframed PDUs supported |
_phy | Preferred Target PHY |
_rtn | Preferred Retransmission number |
_latency | Preferred Maximum Transport Latency (msec) |
_pd_min | Minimum Presentation Delay (usec) |
_pd_max | Maximum Presentation Delay (usec) |
_pref_pd_min | Preferred Minimum Presentation Delay (usec) |
_pref_pd_max | Preferred Maximum Presentation Delay (usec) |
#define BT_AUDIO_CODEC_QOS_UNFRAMED | ( | _interval, | |
_sdu, | |||
_rtn, | |||
_latency, | |||
_pd | |||
) |
#include <zephyr/bluetooth/audio/audio.h>
Helper to declare Input Unframed bt_audio_codec_qos.
_interval | SDU interval (usec) |
_sdu | Maximum SDU Size |
_rtn | Retransmission number |
_latency | Maximum Transport Latency (msec) |
_pd | Presentation Delay (usec) |
#define BT_AUDIO_CONTEXT_TYPE_ANY |
#include <zephyr/bluetooth/audio/audio.h>
Any known context.
#define BT_AUDIO_LOCATION_ANY |
#include <zephyr/bluetooth/audio/audio.h>
Any known location.
#define BT_AUDIO_METADATA_TYPE_IS_KNOWN | ( | _type | ) |
#include <zephyr/bluetooth/audio/audio.h>
Helper to check whether metadata type is known by the stack.
_type
is evaluated thrice. #define BT_AUDIO_PD_MAX 0xFFFFFFU |
#include <zephyr/bluetooth/audio/audio.h>
Maximum presentation delay in microseconds.
#define BT_AUDIO_PD_PREF_NONE 0x000000U |
#include <zephyr/bluetooth/audio/audio.h>
Indicates that the server have no preference for the presentation delay.
#define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL 0x00 |
#include <zephyr/bluetooth/audio/audio.h>
#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED 0x01 |
#include <zephyr/bluetooth/audio/audio.h>
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 |
#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 |
#include <zephyr/bluetooth/audio/audio.h>
#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. |
#include <zephyr/bluetooth/audio/audio.h>
Supported frequencies bitfield.
#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.
#include <zephyr/bluetooth/audio/audio.h>
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 |
#include <zephyr/bluetooth/audio/audio.h>
#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.
#include <zephyr/bluetooth/audio/audio.h>
Codec QoS Framing.
Enumerator | |
---|---|
BT_AUDIO_CODEC_QOS_FRAMING_UNFRAMED | |
BT_AUDIO_CODEC_QOS_FRAMING_FRAMED |
enum 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
enum bt_audio_dir |
#include <zephyr/bluetooth/audio/audio.h>
Audio Capability type.
Enumerator | |
---|---|
BT_AUDIO_DIR_SINK | |
BT_AUDIO_DIR_SOURCE |
enum 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
#include <zephyr/bluetooth/audio/audio.h>
Codec metadata type IDs.
Metadata types defined by the Generic Audio assigned numbers (bluetooth.com).
#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.
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.
ltv | Length-type-value (LTV) encoded data. |
size | Size of the ltv data. |
func | Callback 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_data | User data to be passed to the callback. |
0 | if all entries were parsed. |
-EINVAL | if the data is incorrectly encoded |
-ECANCELED | if parsing was prematurely cancelled by the callback |