Zephyr Project API
3.4.0
A Scalable Open Source RTOS
|
Bluetooth Audio. More...
Modules | |
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_codec_qos |
Codec QoS structure. More... | |
struct | bt_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 |
#define | BT_AUDIO_PD_PREF_NONE 0x000000U |
#define | BT_AUDIO_PD_MAX 0xFFFFFFU |
#define | BT_AUDIO_BROADCAST_CODE_SIZE 16 |
#define | BT_AUDIO_CONTEXT_TYPE_ANY |
#define | BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL 0x00 |
#define | BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED 0x01 |
#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_AUDIO_LOCATION_ANY |
#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... | |
Functions | |
ssize_t | bt_audio_codec_data_to_buf (const struct bt_codec_data *codec_data, size_t count, uint8_t *buf, size_t buf_size) |
Turns an array of bt_codec_data to a flat LTV encoded uint8_t array. More... | |
Bluetooth Audio.
#define BT_AUDIO_BROADCAST_CODE_SIZE 16 |
#include <include/zephyr/bluetooth/audio/audio.h>
#define BT_AUDIO_BROADCAST_ID_MAX 0xFFFFFFU |
#include <include/zephyr/bluetooth/audio/audio.h>
Maximum broadcast ID value
#define BT_AUDIO_BROADCAST_ID_SIZE 3 /* octets */ |
#include <include/zephyr/bluetooth/audio/audio.h>
#define BT_AUDIO_CONTEXT_TYPE_ANY |
#include <include/zephyr/bluetooth/audio/audio.h>
Any known context.
#define BT_AUDIO_LOCATION_ANY |
#include <include/zephyr/bluetooth/audio/audio.h>
Any known location.
#define BT_AUDIO_PD_MAX 0xFFFFFFU |
#include <include/zephyr/bluetooth/audio/audio.h>
Maximum presentation delay in microseconds
#define BT_AUDIO_PD_PREF_NONE 0x000000U |
#include <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 <include/zephyr/bluetooth/audio/audio.h>
#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED 0x01 |
#include <include/zephyr/bluetooth/audio/audio.h>
#define BT_CODEC | ( | _id, | |
_cid, | |||
_vid, | |||
_data, | |||
_meta | |||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Helper to declare bt_codec 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_CODEC_DATA | ( | _type, | |
_bytes... | |||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
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_bap_stream_config or bt_bap_stream_reconfig.
_type | Type of advertising data field |
_bytes | Variable number of single-byte parameters |
#define BT_CODEC_QOS | ( | _interval, | |
_framing, | |||
_phy, | |||
_sdu, | |||
_rtn, | |||
_latency, | |||
_pd | |||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Helper to declare elements of bt_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_CODEC_QOS_FRAMED | ( | _interval, | |
_sdu, | |||
_rtn, | |||
_latency, | |||
_pd | |||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Helper to declare Input Framed bt_codec_qos.
_interval | SDU interval (usec) |
_sdu | Maximum SDU Size |
_rtn | Retransmission number |
_latency | Maximum Transport Latency (msec) |
_pd | Presentation Delay (usec) |
#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>
Helper to declare elements of bt_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_CODEC_QOS_UNFRAMED | ( | _interval, | |
_sdu, | |||
_rtn, | |||
_latency, | |||
_pd | |||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Helper to declare Input Unframed bt_codec_qos.
_interval | SDU interval (usec) |
_sdu | Maximum SDU Size |
_rtn | Retransmission number |
_latency | Maximum Transport Latency (msec) |
_pd | Presentation Delay (usec) |
anonymous enum |
#include <include/zephyr/bluetooth/audio/audio.h>
Codec QoS Framing.
Enumerator | |
---|---|
BT_CODEC_QOS_UNFRAMED | |
BT_CODEC_QOS_FRAMED |
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 |
#include <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 |
enum bt_audio_context |
#include <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 <include/zephyr/bluetooth/audio/audio.h>
Audio Capability type.
Enumerator | |
---|---|
BT_AUDIO_DIR_SINK | |
BT_AUDIO_DIR_SOURCE |
enum 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
#include <include/zephyr/bluetooth/audio/audio.h>
Codec metadata type IDs.
Metadata types defined by the Generic Audio assigned numbers (bluetooth.com).
#include <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.
ssize_t bt_audio_codec_data_to_buf | ( | const struct bt_codec_data * | codec_data, |
size_t | count, | ||
uint8_t * | buf, | ||
size_t | buf_size | ||
) |
#include <include/zephyr/bluetooth/audio/audio.h>
Turns an array of bt_codec_data to a flat LTV encoded uint8_t array.
The resulting buf
array can then be used to send over air.
codec_data | The codec data. Can either be codec configuration data, or codec metadata. |
count | The number of elements in the codec_data array |
buf | The resulting buffer to put the LTV encoded data. |
buf_size | The size of buf . |
The | length of the encoded data if successful. |
-ENOMEM | if the codec_data did not fit into the buf . |