|
Zephyr API Documentation 4.3.0-rc1
A Scalable Open Source RTOS
|
Bluetooth Audio. More...
Topics | |
| Assigned numbers to string API | |
| Assigned numbers to string API. | |
| 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... | |
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_RTN_PREF_NONE 0xFFU |
| Indicates that the unicast server does not have a preference for any retransmission number. | |
| #define | BT_AUDIO_LANG_SIZE 3 |
| Size of the stream language value, e.g. | |
| #define | BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(...) |
| Channel count support capability. | |
| #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...) |
| 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. | |
Enumerations | |
| enum | bt_audio_codec_cfg_target_latency { BT_AUDIO_CODEC_CFG_TARGET_LATENCY_LOW = 0x01 , BT_AUDIO_CODEC_CFG_TARGET_LATENCY_BALANCED = 0x02 , BT_AUDIO_CODEC_CFG_TARGET_LATENCY_HIGH = 0x03 } |
| Codec configuration target latency. More... | |
| enum | bt_audio_codec_cfg_target_phy { BT_AUDIO_CODEC_CFG_TARGET_PHY_1M = 0x01 , BT_AUDIO_CODEC_CFG_TARGET_PHY_2M = 0x02 , BT_AUDIO_CODEC_CFG_TARGET_PHY_CODED = 0x03 } |
| Codec configuration target PHY. 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... | |
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. | |
| int | bt_audio_data_get_val (const uint8_t ltv_data[], size_t size, uint8_t type, const uint8_t **data) |
| Get the value of a specific data type in an length-type-value data array. | |
| 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. | |
Bluetooth Audio.
| #define BT_AUDIO_BROADCAST_ID_MAX 0xFFFFFFU |
#include <zephyr/bluetooth/audio/audio.h>
Maximum broadcast ID value.
| #define BT_AUDIO_BROADCAST_ID_SIZE 3 |
#include <zephyr/bluetooth/audio/audio.h>
Size of the broadcast ID in octets.
| #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_SUPPORT | ( | ... | ) |
#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... ) |
#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_LANG_SIZE 3 |
| #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_RTN_PREF_NONE 0xFFU |
#include <zephyr/bluetooth/audio/audio.h>
Indicates that the unicast server does not have a preference for any retransmission number.
| #define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL 0x00 |
#include <zephyr/bluetooth/audio/audio.h>
Unicast Server is connectable and is requesting a connection.
| #define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED 0x01 |
#include <zephyr/bluetooth/audio/audio.h>
Unicast Server is connectable but is not requesting a connection.
#include <zephyr/bluetooth/audio/audio.h>
Codec configuration target latency.
Set by the BAP Unicast Client to provide context for the BAP Unicast Server for the server to set its QoS preferences.
| Enumerator | |
|---|---|
| BT_AUDIO_CODEC_CFG_TARGET_LATENCY_LOW | Target low latency. |
| BT_AUDIO_CODEC_CFG_TARGET_LATENCY_BALANCED | Target balanced latency. |
| BT_AUDIO_CODEC_CFG_TARGET_LATENCY_HIGH | Target high latency. |
#include <zephyr/bluetooth/audio/audio.h>
Codec configuration target PHY.
The target PHY to achieve the target latency (bt_audio_codec_cfg_target_latency).
| Enumerator | |
|---|---|
| BT_AUDIO_CODEC_CFG_TARGET_PHY_1M | LE 1M PHY. |
| BT_AUDIO_CODEC_CFG_TARGET_PHY_2M | LE 2M PHY. |
| BT_AUDIO_CODEC_CFG_TARGET_PHY_CODED | LE Coded PHY. |
| enum bt_audio_dir |
#include <zephyr/bluetooth/audio/audio.h>
Audio direction from the perspective of the BAP Unicast Server / BAP Broadcast Sink.
| int bt_audio_data_get_val | ( | const uint8_t | ltv_data[], |
| size_t | size, | ||
| uint8_t | type, | ||
| const uint8_t ** | data ) |
#include <zephyr/bluetooth/audio/audio.h>
Get the value of a specific data type in an length-type-value data array.
| [in] | ltv_data | The array containing the length-type-value tuples |
| [in] | size | The size of ltv_data |
| [in] | type | The type to get the value for. May be any type, but typically either bt_audio_codec_cap_type, bt_audio_codec_cfg_type or bt_audio_metadata_type. |
| [out] | data | Pointer to the data-pointer to update when item is found. Any found data will be little endian. |
| length | The length of found data (may be 0). |
| -EINVAL | Arguments are invalid |
| -ENODATA | Data not found |
| int bt_audio_data_parse | ( | const uint8_t | ltv[], |
| size_t | size, | ||
| bool(* | func )(struct bt_data *data, void *user_data), | ||
| 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 | All entries were parsed. |
| -EINVAL | The data is incorrectly encoded |
| -ECANCELED | Parsing was prematurely cancelled by the callback |
| 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.
| chan_allocation | The channel allocation |