Zephyr API Documentation 4.2.99
A Scalable Open Source RTOS
 4.2.99
audio.h
Go to the documentation of this file.
1
5
6/*
7 * Copyright (c) 2020 Intel Corporation
8 * Copyright (c) 2020-2024 Nordic Semiconductor ASA
9 *
10 * SPDX-License-Identifier: Apache-2.0
11 */
12#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_AUDIO_H_
13#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_AUDIO_H_
14
21
22#include <stdbool.h>
23#include <stddef.h>
24#include <stdint.h>
25
26#include <zephyr/autoconf.h>
34#include <zephyr/sys/atomic.h>
35#include <zephyr/sys/util.h>
37
38#ifdef __cplusplus
39extern "C" {
40#endif
41
43#define BT_AUDIO_BROADCAST_ID_SIZE 3
45#define BT_AUDIO_BROADCAST_ID_MAX 0xFFFFFFU
47#define BT_AUDIO_PD_PREF_NONE 0x000000U
49#define BT_AUDIO_PD_MAX 0xFFFFFFU
51#define BT_AUDIO_RTN_PREF_NONE 0xFFU
53#define BT_AUDIO_BROADCAST_NAME_LEN_MIN 4
55#define BT_AUDIO_BROADCAST_NAME_LEN_MAX 128
56
58#define BT_AUDIO_LANG_SIZE 3
59
82
134
163
197
199#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MIN 1
201#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_MAX 8
202
213#define BT_AUDIO_CODEC_CAP_CHAN_COUNT_SUPPORT(...) \
214 ((enum bt_audio_codec_cap_chan_count)((FOR_EACH(BIT, (|), __VA_ARGS__)) >> 1))
215
223
246
288
297
355
359#define BT_AUDIO_CONTEXT_TYPE_ANY (BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED | \
360 BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL | \
361 BT_AUDIO_CONTEXT_TYPE_MEDIA | \
362 BT_AUDIO_CONTEXT_TYPE_GAME | \
363 BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL | \
364 BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS | \
365 BT_AUDIO_CONTEXT_TYPE_LIVE | \
366 BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS | \
367 BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS | \
368 BT_AUDIO_CONTEXT_TYPE_RINGTONE | \
369 BT_AUDIO_CONTEXT_TYPE_ALERTS | \
370 BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM)
371
412
420
426
507
513#define BT_AUDIO_METADATA_TYPE_IS_KNOWN(_type) \
514 (IN_RANGE((_type), BT_AUDIO_METADATA_TYPE_PREF_CONTEXT, \
515 BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE) || \
516 (_type) == BT_AUDIO_METADATA_TYPE_EXTENDED || (_type) == BT_AUDIO_METADATA_TYPE_VENDOR)
517
523#define BT_AUDIO_UNICAST_ANNOUNCEMENT_GENERAL 0x00
525#define BT_AUDIO_UNICAST_ANNOUNCEMENT_TARGETED 0x01
527
536#define BT_AUDIO_CODEC_DATA(_type, _bytes...) \
537 (sizeof((uint8_t)_type) + sizeof((uint8_t[]){_bytes})), (_type), _bytes
538
548#define BT_AUDIO_CODEC_CFG(_id, _cid, _vid, _data, _meta) \
549 ((struct bt_audio_codec_cfg){ \
550 /* Use HCI data path as default, can be overwritten by application */ \
551 .path_id = BT_ISO_DATA_PATH_HCI, \
552 .ctlr_transcode = false, \
553 COND_CODE_1(IS_ENABLED(CONFIG_BT_BAP_UNICAST), \
554 (.target_latency = BT_AUDIO_CODEC_CFG_TARGET_LATENCY_BALANCED, \
555 .target_phy = BT_AUDIO_CODEC_CFG_TARGET_PHY_2M,), \
556 ()) \
557 .id = _id, \
558 .cid = _cid, \
559 .vid = _vid, \
560 .data_len = sizeof((uint8_t[])_data), \
561 .data = _data, \
562 .meta_len = sizeof((uint8_t[])_meta), \
563 .meta = _meta, \
564 })
565
575#define BT_AUDIO_CODEC_CAP(_id, _cid, _vid, _data, _meta) \
576 ((struct bt_audio_codec_cap){ \
577 /* Use HCI data path as default, can be overwritten by application */ \
578 .path_id = BT_ISO_DATA_PATH_HCI, \
579 .ctlr_transcode = false, \
580 .id = (_id), \
581 .cid = (_cid), \
582 .vid = (_vid), \
583 .data_len = sizeof((uint8_t[])_data), \
584 .data = _data, \
585 .meta_len = sizeof((uint8_t[])_meta), \
586 .meta = _meta, \
587 })
588
654
658#define BT_AUDIO_LOCATION_ANY (BT_AUDIO_LOCATION_FRONT_LEFT | \
659 BT_AUDIO_LOCATION_FRONT_RIGHT | \
660 BT_AUDIO_LOCATION_FRONT_CENTER | \
661 BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1 | \
662 BT_AUDIO_LOCATION_BACK_LEFT | \
663 BT_AUDIO_LOCATION_BACK_RIGHT | \
664 BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER | \
665 BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER | \
666 BT_AUDIO_LOCATION_BACK_CENTER | \
667 BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2 | \
668 BT_AUDIO_LOCATION_SIDE_LEFT | \
669 BT_AUDIO_LOCATION_SIDE_RIGHT | \
670 BT_AUDIO_LOCATION_TOP_FRONT_LEFT | \
671 BT_AUDIO_LOCATION_TOP_FRONT_RIGHT | \
672 BT_AUDIO_LOCATION_TOP_FRONT_CENTER | \
673 BT_AUDIO_LOCATION_TOP_CENTER | \
674 BT_AUDIO_LOCATION_TOP_BACK_LEFT | \
675 BT_AUDIO_LOCATION_TOP_BACK_RIGHT | \
676 BT_AUDIO_LOCATION_TOP_SIDE_LEFT | \
677 BT_AUDIO_LOCATION_TOP_SIDE_RIGHT | \
678 BT_AUDIO_LOCATION_TOP_BACK_CENTER | \
679 BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER | \
680 BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT | \
681 BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT | \
682 BT_AUDIO_LOCATION_FRONT_LEFT_WIDE | \
683 BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE | \
684 BT_AUDIO_LOCATION_LEFT_SURROUND | \
685 BT_AUDIO_LOCATION_RIGHT_SURROUND)
686
707#if CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE > 0 || defined(__DOXYGEN__)
709 size_t data_len;
711 uint8_t data[CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE];
712#endif /* CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE > 0 */
713#if defined(CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE) || defined(__DOXYGEN__)
715 size_t meta_len;
717 uint8_t meta[CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE];
718#endif /* CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE */
719};
720
737
753
768#if defined(CONFIG_BT_BAP_UNICAST)
773 enum bt_audio_codec_cfg_target_latency target_latency;
778 enum bt_audio_codec_cfg_target_phy target_phy;
779#endif /* CONFIG_BT_BAP_UNICAST */
786#if CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE > 0 || defined(__DOXYGEN__)
788 size_t data_len;
790 uint8_t data[CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE];
791#endif /* CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE > 0 */
792#if CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE > 0 || defined(__DOXYGEN__)
794 size_t meta_len;
796 uint8_t meta[CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE];
797#endif /* CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE > 0 */
798};
799
814int bt_audio_data_parse(const uint8_t ltv[], size_t size,
815 bool (*func)(struct bt_data *data, void *user_data), void *user_data);
816
832int bt_audio_data_get_val(const uint8_t ltv_data[], size_t size, uint8_t type,
833 const uint8_t **data);
834
843
861
870
880
890
902
914 enum bt_audio_codec_cfg_freq freq);
915
925
935
947
959 enum bt_audio_codec_cfg_frame_dur frame_dur);
960
982 enum bt_audio_location *chan_allocation,
983 bool fallback_to_default);
984
996 enum bt_audio_location chan_allocation);
997
1018
1030 uint16_t octets_per_frame);
1031
1053 bool fallback_to_default);
1054
1066 uint8_t frame_blocks);
1067
1080 enum bt_audio_codec_cfg_type type, const uint8_t **data);
1081
1095 enum bt_audio_codec_cfg_type type, const uint8_t *data,
1096 size_t data_len);
1097
1110 enum bt_audio_codec_cfg_type type);
1111
1125 const uint8_t **data);
1126
1140 enum bt_audio_metadata_type type, const uint8_t *data,
1141 size_t data_len);
1142
1155 enum bt_audio_metadata_type type);
1172 bool fallback_to_default);
1173
1185 enum bt_audio_context ctx);
1186
1200
1212 enum bt_audio_context ctx);
1213
1227 const uint8_t **program_info);
1228
1241 const uint8_t *program_info, size_t program_info_len);
1242
1257 const uint8_t **lang);
1258
1270 const uint8_t lang[BT_AUDIO_LANG_SIZE]);
1271
1285 const uint8_t **ccid_list);
1286
1299 const uint8_t *ccid_list, size_t ccid_list_len);
1300
1314
1326 enum bt_audio_parental_rating parental_rating);
1327
1341 const uint8_t **program_info_uri);
1342
1355 const uint8_t *program_info_uri,
1356 size_t program_info_uri_len);
1357
1371
1384
1397 const struct bt_audio_codec_cfg *codec_cfg);
1398
1409 struct bt_audio_codec_cfg *codec_cfg);
1410
1424 const struct bt_audio_codec_cfg *codec_cfg);
1425
1437 struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_assisted_listening_stream val);
1438
1452 const uint8_t **broadcast_name);
1453
1466 const uint8_t *broadcast_name,
1467 size_t broadcast_name_len);
1468
1482 const uint8_t **extended_meta);
1483
1496 const uint8_t *extended_meta, size_t extended_meta_len);
1497
1511 const uint8_t **vendor_meta);
1512
1525 const uint8_t *vendor_meta, size_t vendor_meta_len); /* End of bt_audio_codec_cfg */
1527
1537
1550 enum bt_audio_codec_cap_type type, const uint8_t **data);
1551
1565 enum bt_audio_codec_cap_type type, const uint8_t *data,
1566 size_t data_len);
1567
1580 enum bt_audio_codec_cap_type type);
1581
1594
1606 enum bt_audio_codec_cap_freq freq);
1607
1619
1631 enum bt_audio_codec_cap_frame_dur frame_dur);
1632
1646 bool fallback_to_default);
1647
1659 struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_chan_count chan_count);
1660
1673 const struct bt_audio_codec_cap *codec_cap,
1674 struct bt_audio_codec_octets_per_codec_frame *codec_frame);
1675
1687 struct bt_audio_codec_cap *codec_cap,
1688 const struct bt_audio_codec_octets_per_codec_frame *codec_frame);
1689
1703 bool fallback_to_default);
1704
1716 uint8_t codec_frames_per_sdu);
1717
1730 const uint8_t **data);
1731
1745 enum bt_audio_metadata_type type, const uint8_t *data,
1746 size_t data_len);
1747
1760 enum bt_audio_metadata_type type);
1761
1775
1787 enum bt_audio_context ctx);
1788
1802
1814 enum bt_audio_context ctx);
1815
1829 const uint8_t **program_info);
1830
1843 const uint8_t *program_info, size_t program_info_len);
1844
1859 const uint8_t **lang);
1860
1872 const uint8_t lang[BT_AUDIO_LANG_SIZE]);
1873
1887 const uint8_t **ccid_list);
1888
1901 const uint8_t *ccid_list, size_t ccid_list_len);
1902
1916
1928 enum bt_audio_parental_rating parental_rating);
1929
1943 const uint8_t **program_info_uri);
1944
1957 const uint8_t *program_info_uri,
1958 size_t program_info_uri_len);
1959
1973
1986
1999 const struct bt_audio_codec_cap *codec_cap);
2000
2011 struct bt_audio_codec_cap *codec_cap);
2012
2026 const struct bt_audio_codec_cap *codec_cap);
2027
2039 struct bt_audio_codec_cap *codec_cap, enum bt_audio_assisted_listening_stream val);
2040
2054 const uint8_t **broadcast_name);
2055
2068 const uint8_t *broadcast_name,
2069 size_t broadcast_name_len);
2083 const uint8_t **extended_meta);
2084
2097 const uint8_t *extended_meta, size_t extended_meta_len);
2098
2112 const uint8_t **vendor_meta);
2113
2126 const uint8_t *vendor_meta, size_t vendor_meta_len);
2127 /* End of bt_audio_codec_cap */
2129
2138
2148static inline char *bt_audio_context_bit_to_str(enum bt_audio_context context)
2149{
2150 switch (context) {
2152 return "None";
2154 return "Unspecified";
2156 return "Conversational";
2158 return "Media";
2160 return "Game";
2162 return "Instructional";
2164 return "Voice assistant";
2166 return "Live";
2168 return "Sound effects";
2170 return "Notifications";
2172 return "Ringtone";
2174 return "Alerts";
2176 return "Emergency alarm";
2177 default:
2178 return "Unknown context";
2179 }
2180}
2181
2189static inline char *bt_audio_parental_rating_to_str(enum bt_audio_parental_rating parental_rating)
2190{
2191 switch (parental_rating) {
2193 return "No rating";
2195 return "Any";
2197 return "Age 5 or above";
2199 return "Age 6 or above";
2201 return "Age 7 or above";
2203 return "Age 8 or above";
2205 return "Age 9 or above";
2207 return "Age 10 or above";
2209 return "Age 11 or above";
2211 return "Age 12 or above";
2213 return "Age 13 or above";
2215 return "Age 14 or above";
2217 return "Age 15 or above";
2219 return "Age 16 or above";
2221 return "Age 17 or above";
2223 return "Age 18 or above";
2224 default:
2225 return "Unknown rating";
2226 }
2227}
2228
2237{
2238 switch (state) {
2240 return "Disabled";
2242 return "Enabled";
2243 default:
2244 return "Unknown active state";
2245 }
2246}
2247
2258{
2259 switch (freq) {
2261 return "8000 Hz";
2263 return "11025 Hz";
2265 return "16000 Hz";
2267 return "22050 Hz";
2269 return "24000 Hz";
2271 return "32000 Hz";
2273 return "44100 Hz";
2275 return "48000 Hz";
2277 return "88200 Hz";
2279 return "96000 Hz";
2281 return "176400 Hz";
2283 return "192000 Hz";
2285 return "384000 Hz";
2286 default:
2287 return "Unknown supported frequency";
2288 }
2289}
2290
2300static inline char *
2302{
2303 switch (frame_dur) {
2305 return "7.5 ms";
2307 return "10 ms";
2309 return "7.5 ms preferred";
2311 return "10 ms preferred";
2312 default:
2313 return "Unknown frame duration";
2314 }
2315}
2316
2326static inline char *
2328{
2329 switch (chan_count) {
2331 return "1 channel";
2333 return "2 channels";
2335 return "3 channels";
2337 return "4 channels";
2339 return "5 channels";
2341 return "6 channels";
2343 return "7 channels";
2345 return "8 channels";
2346 default:
2347 return "Unknown channel count";
2348 }
2349}
2350
2360static inline char *bt_audio_location_bit_to_str(enum bt_audio_location location)
2361{
2362 switch (location) {
2364 return "Mono";
2366 return "Front left";
2368 return "Front right";
2370 return "Front center";
2372 return "Low frequency effects 1";
2374 return "Back left";
2376 return "Back right";
2378 return "Front left of center";
2380 return "Front right of center";
2382 return "Back center";
2384 return "Low frequency effects 2";
2386 return "Side left";
2388 return "Side right";
2390 return "Top front left";
2392 return "Top front right";
2394 return "Top front center";
2396 return "Top center";
2398 return "Top back left";
2400 return "Top back right";
2402 return "Top side left";
2404 return "Top side right";
2406 return "Top back center";
2408 return "Bottom front center";
2410 return "Bottom front left";
2412 return "Bottom front right";
2414 return "Front left wide";
2416 return "Front right wde";
2418 return "Left surround";
2420 return "Right surround";
2421 default:
2422 return "Unknown location";
2423 }
2424}
2425 /* End of bt_audio_to_str */
2427#ifdef __cplusplus
2428}
2429#endif
2430 /* end of bt_audio */
2432
2433#endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_H_ */
Bluetooth subsystem core APIs.
Bluetooth data buffer API.
Bluetooth connection handling.
Generic Attribute Profile handling.
int bt_audio_codec_cap_meta_set_ccid_list(struct bt_audio_codec_cap *codec_cap, const uint8_t *ccid_list, size_t ccid_list_len)
Set the CCID list of a codec capability metadata.
int bt_audio_codec_cap_set_val(struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_type type, const uint8_t *data, size_t data_len)
Set or add a specific codec capability value.
int bt_audio_codec_cap_get_frame_dur(const struct bt_audio_codec_cap *codec_cap)
Extract the frequency from a codec capability.
int bt_audio_codec_cap_get_max_codec_frames_per_sdu(const struct bt_audio_codec_cap *codec_cap, bool fallback_to_default)
Extract the maximum codec frames per SDU from a codec capability.
int bt_audio_codec_cap_meta_set_vendor(struct bt_audio_codec_cap *codec_cap, const uint8_t *vendor_meta, size_t vendor_meta_len)
Set the vendor specific metadata of a codec capability metadata.
int bt_audio_codec_cap_meta_set_val(struct bt_audio_codec_cap *codec_cap, enum bt_audio_metadata_type type, const uint8_t *data, size_t data_len)
Set or add a specific codec capability metadata value.
int bt_audio_codec_cap_meta_get_ccid_list(const struct bt_audio_codec_cap *codec_cap, const uint8_t **ccid_list)
Extract CCID list.
int bt_audio_codec_cap_meta_set_assisted_listening_stream(struct bt_audio_codec_cap *codec_cap, enum bt_audio_assisted_listening_stream val)
Set the assisted listening stream value of a codec capability metadata.
int bt_audio_codec_cap_meta_get_program_info(const struct bt_audio_codec_cap *codec_cap, const uint8_t **program_info)
Extract program info.
int bt_audio_codec_cap_set_max_codec_frames_per_sdu(struct bt_audio_codec_cap *codec_cap, uint8_t codec_frames_per_sdu)
Set the maximum codec frames per SDU of a codec capability.
int bt_audio_codec_cap_meta_get_broadcast_name(const struct bt_audio_codec_cap *codec_cap, const uint8_t **broadcast_name)
Extract broadcast name.
int bt_audio_codec_cap_meta_unset_val(struct bt_audio_codec_cap *codec_cap, enum bt_audio_metadata_type type)
Unset a specific codec capability metadata value.
int bt_audio_codec_cap_meta_set_program_info(struct bt_audio_codec_cap *codec_cap, const uint8_t *program_info, size_t program_info_len)
Set the program info of a codec capability metadata.
int bt_audio_codec_cap_meta_set_broadcast_name(struct bt_audio_codec_cap *codec_cap, const uint8_t *broadcast_name, size_t broadcast_name_len)
Set the broadcast name of a codec capability metadata.
int bt_audio_codec_cap_meta_get_assisted_listening_stream(const struct bt_audio_codec_cap *codec_cap)
Extract assisted listening stream.
int bt_audio_codec_cap_set_frame_dur(struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_frame_dur frame_dur)
Set the frame duration of a codec capability.
int bt_audio_codec_cap_meta_get_val(const struct bt_audio_codec_cap *codec_cap, uint8_t type, const uint8_t **data)
Lookup a specific metadata value based on type.
int bt_audio_codec_cap_meta_set_stream_context(struct bt_audio_codec_cap *codec_cap, enum bt_audio_context ctx)
Set the stream context of a codec capability metadata.
int bt_audio_codec_cap_meta_set_parental_rating(struct bt_audio_codec_cap *codec_cap, enum bt_audio_parental_rating parental_rating)
Set the parental rating of a codec capability metadata.
int bt_audio_codec_cap_get_supported_audio_chan_counts(const struct bt_audio_codec_cap *codec_cap, bool fallback_to_default)
Extract the frequency from a codec capability.
int bt_audio_codec_cap_meta_get_extended(const struct bt_audio_codec_cap *codec_cap, const uint8_t **extended_meta)
Extract extended metadata.
int bt_audio_codec_cap_meta_set_pref_context(struct bt_audio_codec_cap *codec_cap, enum bt_audio_context ctx)
Set the preferred context of a codec capability metadata.
int bt_audio_codec_cap_meta_set_lang(struct bt_audio_codec_cap *codec_cap, const uint8_t lang[3])
Set the language of a codec capability metadata.
int bt_audio_codec_cap_meta_get_audio_active_state(const struct bt_audio_codec_cap *codec_cap)
Extract audio active state.
int bt_audio_codec_cap_meta_get_stream_context(const struct bt_audio_codec_cap *codec_cap)
Extract stream contexts.
int bt_audio_codec_cap_meta_set_bcast_audio_immediate_rend_flag(struct bt_audio_codec_cap *codec_cap)
Set the broadcast audio immediate rendering flag of a codec capability metadata.
int bt_audio_codec_cap_get_freq(const struct bt_audio_codec_cap *codec_cap)
Extract the frequency from a codec capability.
int bt_audio_codec_cap_get_octets_per_frame(const struct bt_audio_codec_cap *codec_cap, struct bt_audio_codec_octets_per_codec_frame *codec_frame)
Extract the supported octets per codec frame from a codec capability.
int bt_audio_codec_cap_meta_get_pref_context(const struct bt_audio_codec_cap *codec_cap)
Extract preferred contexts.
int bt_audio_codec_cap_meta_get_parental_rating(const struct bt_audio_codec_cap *codec_cap)
Extract parental rating.
int bt_audio_codec_cap_meta_get_bcast_audio_immediate_rend_flag(const struct bt_audio_codec_cap *codec_cap)
Extract broadcast audio immediate rendering flag.
int bt_audio_codec_cap_meta_get_vendor(const struct bt_audio_codec_cap *codec_cap, const uint8_t **vendor_meta)
Extract vendor specific metadata.
int bt_audio_codec_cap_unset_val(struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_type type)
Unset a specific codec capability value.
int bt_audio_codec_cap_meta_set_extended(struct bt_audio_codec_cap *codec_cap, const uint8_t *extended_meta, size_t extended_meta_len)
Set the extended metadata of a codec capability metadata.
int bt_audio_codec_cap_set_freq(struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_freq freq)
Set the supported frequencies of a codec capability.
int bt_audio_codec_cap_set_octets_per_frame(struct bt_audio_codec_cap *codec_cap, const struct bt_audio_codec_octets_per_codec_frame *codec_frame)
Set the octets per codec frame of a codec capability.
int bt_audio_codec_cap_get_val(const struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_type type, const uint8_t **data)
Lookup a specific value based on type.
int bt_audio_codec_cap_meta_set_audio_active_state(struct bt_audio_codec_cap *codec_cap, enum bt_audio_active_state state)
Set the audio active state of a codec capability metadata.
int bt_audio_codec_cap_meta_get_program_info_uri(const struct bt_audio_codec_cap *codec_cap, const uint8_t **program_info_uri)
Extract program info URI.
int bt_audio_codec_cap_set_supported_audio_chan_counts(struct bt_audio_codec_cap *codec_cap, enum bt_audio_codec_cap_chan_count chan_count)
Set the channel count of a codec capability.
int bt_audio_codec_cap_meta_get_lang(const struct bt_audio_codec_cap *codec_cap, const uint8_t **lang)
Extract language.
int bt_audio_codec_cap_meta_set_program_info_uri(struct bt_audio_codec_cap *codec_cap, const uint8_t *program_info_uri, size_t program_info_uri_len)
Set the program info URI of a codec capability metadata.
int bt_audio_codec_cfg_meta_get_program_info(const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **program_info)
Extract program info.
int bt_audio_codec_cfg_frame_dur_us_to_frame_dur(uint32_t frame_dur_us)
Convert frame duration in microseconds to assigned numbers frame duration.
int bt_audio_codec_cfg_meta_get_audio_active_state(const struct bt_audio_codec_cfg *codec_cfg)
Extract audio active state.
int bt_audio_codec_cfg_meta_get_extended(const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **extended_meta)
Extract extended metadata.
int bt_audio_codec_cfg_frame_dur_to_frame_dur_us(enum bt_audio_codec_cfg_frame_dur frame_dur)
Convert assigned numbers frame duration to duration in microseconds.
int bt_audio_codec_cfg_meta_get_assisted_listening_stream(const struct bt_audio_codec_cfg *codec_cfg)
Extract assisted listening stream.
int bt_audio_codec_cfg_meta_set_program_info(struct bt_audio_codec_cfg *codec_cfg, const uint8_t *program_info, size_t program_info_len)
Set the program info of a codec configuration metadata.
int bt_audio_codec_cfg_get_frame_dur(const struct bt_audio_codec_cfg *codec_cfg)
Extract frame duration from BT codec config.
int bt_audio_codec_cfg_freq_to_freq_hz(enum bt_audio_codec_cfg_freq freq)
Convert assigned numbers frequency to frequency value.
int bt_audio_codec_cfg_meta_set_val(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_metadata_type type, const uint8_t *data, size_t data_len)
Set or add a specific codec configuration metadata value.
int bt_audio_codec_cfg_meta_get_vendor(const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **vendor_meta)
Extract vendor specific metadata.
int bt_audio_codec_cfg_meta_get_stream_context(const struct bt_audio_codec_cfg *codec_cfg)
Extract stream contexts.
int bt_audio_codec_cfg_meta_set_broadcast_name(struct bt_audio_codec_cfg *codec_cfg, const uint8_t *broadcast_name, size_t broadcast_name_len)
Set the broadcast name of a codec configuration metadata.
int bt_audio_codec_cfg_get_octets_per_frame(const struct bt_audio_codec_cfg *codec_cfg)
Extract frame size in octets from BT codec config.
int bt_audio_codec_cfg_meta_set_lang(struct bt_audio_codec_cfg *codec_cfg, const uint8_t lang[3])
Set the language of a codec configuration metadata.
int bt_audio_codec_cfg_meta_get_lang(const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **lang)
Extract language.
int bt_audio_codec_cfg_meta_set_ccid_list(struct bt_audio_codec_cfg *codec_cfg, const uint8_t *ccid_list, size_t ccid_list_len)
Set the CCID list of a codec configuration metadata.
int bt_audio_codec_cfg_meta_set_stream_context(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_context ctx)
Set the stream context of a codec configuration metadata.
int bt_audio_codec_cfg_meta_get_broadcast_name(const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **broadcast_name)
Extract broadcast name.
int bt_audio_codec_cfg_meta_get_bcast_audio_immediate_rend_flag(const struct bt_audio_codec_cfg *codec_cfg)
Extract broadcast audio immediate rendering flag.
int bt_audio_codec_cfg_meta_set_assisted_listening_stream(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_assisted_listening_stream val)
Set the assisted listening stream value of a codec configuration metadata.
int bt_audio_codec_cfg_meta_set_vendor(struct bt_audio_codec_cfg *codec_cfg, const uint8_t *vendor_meta, size_t vendor_meta_len)
Set the vendor specific metadata of a codec configuration metadata.
int bt_audio_codec_cfg_meta_get_program_info_uri(const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **program_info_uri)
Extract program info URI.
int bt_audio_codec_cfg_get_val(const struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_type type, const uint8_t **data)
Lookup a specific codec configuration value.
int bt_audio_codec_cfg_set_frame_dur(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_frame_dur frame_dur)
Set the frame duration of a codec configuration.
int bt_audio_codec_cfg_set_octets_per_frame(struct bt_audio_codec_cfg *codec_cfg, uint16_t octets_per_frame)
Set the octets per codec frame of a codec configuration.
int bt_audio_codec_cfg_meta_set_program_info_uri(struct bt_audio_codec_cfg *codec_cfg, const uint8_t *program_info_uri, size_t program_info_uri_len)
Set the program info URI of a codec configuration metadata.
int bt_audio_codec_cfg_freq_hz_to_freq(uint32_t freq_hz)
Convert frequency value to assigned numbers frequency.
int bt_audio_codec_cfg_meta_get_ccid_list(const struct bt_audio_codec_cfg *codec_cfg, const uint8_t **ccid_list)
Extract CCID list.
int bt_audio_codec_cfg_set_val(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_type type, const uint8_t *data, size_t data_len)
Set or add a specific codec configuration value.
int bt_audio_codec_cfg_meta_set_pref_context(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_context ctx)
Set the preferred context of a codec configuration metadata.
int bt_audio_codec_cfg_meta_unset_val(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_metadata_type type)
Unset a specific codec configuration metadata value.
int bt_audio_codec_cfg_meta_set_parental_rating(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_parental_rating parental_rating)
Set the parental rating of a codec configuration metadata.
int bt_audio_codec_cfg_set_freq(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_freq freq)
Set the frequency of a codec configuration.
int bt_audio_codec_cfg_set_frame_blocks_per_sdu(struct bt_audio_codec_cfg *codec_cfg, uint8_t frame_blocks)
Set the frame blocks per SDU of a codec configuration.
int bt_audio_codec_cfg_unset_val(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_codec_cfg_type type)
Unset a specific codec configuration value.
int bt_audio_codec_cfg_get_freq(const struct bt_audio_codec_cfg *codec_cfg)
Extract the frequency from a codec configuration.
int bt_audio_codec_cfg_get_frame_blocks_per_sdu(const struct bt_audio_codec_cfg *codec_cfg, bool fallback_to_default)
Extract number of audio frame blocks in each SDU from BT codec config.
int bt_audio_codec_cfg_meta_set_extended(struct bt_audio_codec_cfg *codec_cfg, const uint8_t *extended_meta, size_t extended_meta_len)
Set the extended metadata of a codec configuration metadata.
int bt_audio_codec_cfg_get_chan_allocation(const struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_location *chan_allocation, bool fallback_to_default)
Extract channel allocation from BT codec config.
int bt_audio_codec_cfg_meta_get_val(const struct bt_audio_codec_cfg *codec_cfg, uint8_t type, const uint8_t **data)
Lookup a specific metadata value based on type.
int bt_audio_codec_cfg_meta_get_pref_context(const struct bt_audio_codec_cfg *codec_cfg, bool fallback_to_default)
Extract preferred contexts.
int bt_audio_codec_cfg_meta_set_bcast_audio_immediate_rend_flag(struct bt_audio_codec_cfg *codec_cfg)
Set the broadcast audio immediate rendering flag of a codec configuration metadata.
int bt_audio_codec_cfg_meta_get_parental_rating(const struct bt_audio_codec_cfg *codec_cfg)
Extract parental rating.
int bt_audio_codec_cfg_meta_set_audio_active_state(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_active_state state)
Set the audio active state of a codec configuration metadata.
int bt_audio_codec_cfg_set_chan_allocation(struct bt_audio_codec_cfg *codec_cfg, enum bt_audio_location chan_allocation)
Set the channel allocation of a codec configuration.
static char * bt_audio_active_state_to_str(enum bt_audio_active_state state)
Returns a string representation of a bt_audio_active_state value.
Definition audio.h:2236
static char * bt_audio_context_bit_to_str(enum bt_audio_context context)
Returns a string representation of a specific bt_audio_context bit.
Definition audio.h:2148
static char * bt_audio_parental_rating_to_str(enum bt_audio_parental_rating parental_rating)
Returns a string representation of a bt_audio_parental_rating value.
Definition audio.h:2189
static char * bt_audio_codec_cap_frame_dur_bit_to_str(enum bt_audio_codec_cap_frame_dur frame_dur)
Returns a string representation of a specific bt_audio_codec_cap_frame_dur bit.
Definition audio.h:2301
static char * bt_audio_codec_cap_chan_count_bit_to_str(enum bt_audio_codec_cap_chan_count chan_count)
Returns a string representation of a specific bt_audio_codec_cap_chan_count bit.
Definition audio.h:2327
static char * bt_audio_location_bit_to_str(enum bt_audio_location location)
Returns a string representation of a specific bt_audio_location bit.
Definition audio.h:2360
static char * bt_audio_codec_cap_freq_bit_to_str(enum bt_audio_codec_cap_freq freq)
Returns a string representation of a specific bt_audio_codec_cap_freq bit.
Definition audio.h:2257
bt_audio_active_state
Audio Active State defined by the Generic Audio assigned numbers (bluetooth.com).
Definition audio.h:414
bt_audio_assisted_listening_stream
Assisted Listening Stream defined by the Generic Audio assigned numbers (bluetooth....
Definition audio.h:422
bt_audio_dir
Audio direction from the perspective of the BAP Unicast Server / BAP Broadcast Sink.
Definition audio.h:845
bt_audio_location
Location values for BT Audio.
Definition audio.h:594
bt_audio_codec_cfg_target_latency
Codec configuration target latency.
Definition audio.h:727
bt_audio_codec_cfg_target_phy
Codec configuration target PHY.
Definition audio.h:743
bt_audio_parental_rating
Parental rating defined by the Generic Audio assigned numbers (bluetooth.com).
Definition audio.h:378
bt_audio_codec_cfg_frame_dur
Codec configuration frame duration.
Definition audio.h:290
uint8_t bt_audio_get_chan_count(enum bt_audio_location chan_allocation)
Function to get the number of channels from the channel allocation.
bt_audio_codec_cfg_freq
Codec configuration sampling freqency.
Definition audio.h:248
bt_audio_codec_cfg_type
Codec configuration types.
Definition audio.h:230
bt_audio_codec_cap_freq
Supported frequencies bitfield.
Definition audio.h:84
bt_audio_metadata_type
Codec metadata type IDs.
Definition audio.h:432
#define BT_AUDIO_LANG_SIZE
Size of the stream language value, e.g.
Definition audio.h:58
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.
bt_audio_codec_cap_chan_count
Supported audio capabilities channel count bitfield.
Definition audio.h:165
bt_audio_codec_cap_frame_dur
Supported frame durations bitfield.
Definition audio.h:136
bt_audio_codec_cap_type
Codec capability types.
Definition audio.h:66
bt_audio_context
Audio Context Type for Generic Audio.
Definition audio.h:303
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.
@ BT_AUDIO_ACTIVE_STATE_ENABLED
Audio data is being transmitted.
Definition audio.h:418
@ BT_AUDIO_ACTIVE_STATE_DISABLED
No audio data is being transmitted.
Definition audio.h:416
@ BT_AUDIO_ASSISTED_LISTENING_STREAM_UNSPECIFIED
Unspecified audio enhancement.
Definition audio.h:424
@ BT_AUDIO_DIR_SINK
Audio direction sink.
Definition audio.h:852
@ BT_AUDIO_DIR_SOURCE
Audio direction source.
Definition audio.h:859
@ BT_AUDIO_LOCATION_FRONT_CENTER
Front Center.
Definition audio.h:602
@ BT_AUDIO_LOCATION_TOP_BACK_LEFT
Top Back Left.
Definition audio.h:630
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_2
Low Frequency Effects 2.
Definition audio.h:616
@ BT_AUDIO_LOCATION_TOP_SIDE_RIGHT
Top Side Right.
Definition audio.h:636
@ BT_AUDIO_LOCATION_FRONT_RIGHT
Front Right.
Definition audio.h:600
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_RIGHT
Bottom Front Right.
Definition audio.h:644
@ BT_AUDIO_LOCATION_BACK_RIGHT
Back Right.
Definition audio.h:608
@ BT_AUDIO_LOCATION_TOP_CENTER
Top Center.
Definition audio.h:628
@ BT_AUDIO_LOCATION_LEFT_SURROUND
Left Surround.
Definition audio.h:650
@ BT_AUDIO_LOCATION_TOP_FRONT_RIGHT
Top Front Right.
Definition audio.h:624
@ BT_AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER
Front Right of Center.
Definition audio.h:612
@ BT_AUDIO_LOCATION_FRONT_RIGHT_WIDE
Front Right Wide.
Definition audio.h:648
@ BT_AUDIO_LOCATION_TOP_BACK_RIGHT
Top Back Right.
Definition audio.h:632
@ BT_AUDIO_LOCATION_MONO_AUDIO
Mono Audio (no specified Audio Location)
Definition audio.h:596
@ BT_AUDIO_LOCATION_BACK_LEFT
Back Left.
Definition audio.h:606
@ BT_AUDIO_LOCATION_RIGHT_SURROUND
Right Surround.
Definition audio.h:652
@ BT_AUDIO_LOCATION_SIDE_RIGHT
Side Right.
Definition audio.h:620
@ BT_AUDIO_LOCATION_TOP_FRONT_LEFT
Top Front Left.
Definition audio.h:622
@ BT_AUDIO_LOCATION_SIDE_LEFT
Side Left.
Definition audio.h:618
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_LEFT
Bottom Front Left.
Definition audio.h:642
@ BT_AUDIO_LOCATION_TOP_FRONT_CENTER
Top Front Center.
Definition audio.h:626
@ BT_AUDIO_LOCATION_LOW_FREQ_EFFECTS_1
Low Frequency Effects 1.
Definition audio.h:604
@ BT_AUDIO_LOCATION_FRONT_LEFT
Front Left.
Definition audio.h:598
@ BT_AUDIO_LOCATION_FRONT_LEFT_WIDE
Front Left Wide.
Definition audio.h:646
@ BT_AUDIO_LOCATION_BOTTOM_FRONT_CENTER
Bottom Front Center.
Definition audio.h:640
@ BT_AUDIO_LOCATION_BACK_CENTER
Back Center.
Definition audio.h:614
@ BT_AUDIO_LOCATION_TOP_SIDE_LEFT
Top Side Left.
Definition audio.h:634
@ BT_AUDIO_LOCATION_TOP_BACK_CENTER
Top Back Center.
Definition audio.h:638
@ BT_AUDIO_LOCATION_FRONT_LEFT_OF_CENTER
Front Left of Center.
Definition audio.h:610
@ BT_AUDIO_CODEC_CFG_TARGET_LATENCY_HIGH
Target high latency.
Definition audio.h:735
@ BT_AUDIO_CODEC_CFG_TARGET_LATENCY_BALANCED
Target balanced latency.
Definition audio.h:732
@ BT_AUDIO_CODEC_CFG_TARGET_LATENCY_LOW
Target low latency.
Definition audio.h:729
@ BT_AUDIO_CODEC_CFG_TARGET_PHY_2M
LE 2M PHY.
Definition audio.h:748
@ BT_AUDIO_CODEC_CFG_TARGET_PHY_CODED
LE Coded PHY.
Definition audio.h:751
@ BT_AUDIO_CODEC_CFG_TARGET_PHY_1M
LE 1M PHY.
Definition audio.h:745
@ BT_AUDIO_PARENTAL_RATING_AGE_18_OR_ABOVE
Recommended for listeners of age 18 and above.
Definition audio.h:410
@ BT_AUDIO_PARENTAL_RATING_AGE_15_OR_ABOVE
Recommended for listeners of age 15 and above.
Definition audio.h:404
@ BT_AUDIO_PARENTAL_RATING_AGE_10_OR_ABOVE
Recommended for listeners of age 10 and above.
Definition audio.h:394
@ BT_AUDIO_PARENTAL_RATING_AGE_7_OR_ABOVE
Recommended for listeners of age 7 and above.
Definition audio.h:388
@ BT_AUDIO_PARENTAL_RATING_AGE_16_OR_ABOVE
Recommended for listeners of age 16 and above.
Definition audio.h:406
@ BT_AUDIO_PARENTAL_RATING_AGE_17_OR_ABOVE
Recommended for listeners of age 17 and above.
Definition audio.h:408
@ BT_AUDIO_PARENTAL_RATING_AGE_5_OR_ABOVE
Recommended for listeners of age 5 and above.
Definition audio.h:384
@ BT_AUDIO_PARENTAL_RATING_AGE_8_OR_ABOVE
Recommended for listeners of age 8 and above.
Definition audio.h:390
@ BT_AUDIO_PARENTAL_RATING_AGE_13_OR_ABOVE
Recommended for listeners of age 13 and above.
Definition audio.h:400
@ BT_AUDIO_PARENTAL_RATING_AGE_9_OR_ABOVE
Recommended for listeners of age 9 and above.
Definition audio.h:392
@ BT_AUDIO_PARENTAL_RATING_AGE_11_OR_ABOVE
Recommended for listeners of age 11 and above.
Definition audio.h:396
@ BT_AUDIO_PARENTAL_RATING_AGE_12_OR_ABOVE
Recommended for listeners of age 12 and above.
Definition audio.h:398
@ BT_AUDIO_PARENTAL_RATING_AGE_6_OR_ABOVE
Recommended for listeners of age 6 and above.
Definition audio.h:386
@ BT_AUDIO_PARENTAL_RATING_AGE_ANY
For all ages.
Definition audio.h:382
@ BT_AUDIO_PARENTAL_RATING_NO_RATING
No rating.
Definition audio.h:380
@ BT_AUDIO_PARENTAL_RATING_AGE_14_OR_ABOVE
Recommended for listeners of age 14 and above.
Definition audio.h:402
@ BT_AUDIO_CODEC_CFG_DURATION_10
10 msec Frame Duration configuration
Definition audio.h:295
@ BT_AUDIO_CODEC_CFG_DURATION_7_5
7.5 msec Frame Duration configuration
Definition audio.h:292
@ BT_AUDIO_CODEC_CFG_FREQ_24KHZ
24 Khz codec sampling frequency
Definition audio.h:262
@ BT_AUDIO_CODEC_CFG_FREQ_48KHZ
48 Khz codec sampling frequency
Definition audio.h:271
@ BT_AUDIO_CODEC_CFG_FREQ_32KHZ
32 Khz codec sampling frequency
Definition audio.h:265
@ BT_AUDIO_CODEC_CFG_FREQ_384KHZ
384 Khz codec sampling frequency
Definition audio.h:286
@ BT_AUDIO_CODEC_CFG_FREQ_22KHZ
22.05 Khz codec sampling frequency
Definition audio.h:259
@ BT_AUDIO_CODEC_CFG_FREQ_8KHZ
8 Khz codec sampling frequency
Definition audio.h:250
@ BT_AUDIO_CODEC_CFG_FREQ_96KHZ
96 Khz codec sampling frequency
Definition audio.h:277
@ BT_AUDIO_CODEC_CFG_FREQ_176KHZ
176.4 Khz codec sampling frequency
Definition audio.h:280
@ BT_AUDIO_CODEC_CFG_FREQ_44KHZ
44.1 Khz codec sampling frequency
Definition audio.h:268
@ BT_AUDIO_CODEC_CFG_FREQ_192KHZ
192 Khz codec sampling frequency
Definition audio.h:283
@ BT_AUDIO_CODEC_CFG_FREQ_11KHZ
11.025 Khz codec sampling frequency
Definition audio.h:253
@ BT_AUDIO_CODEC_CFG_FREQ_16KHZ
16 Khz codec sampling frequency
Definition audio.h:256
@ BT_AUDIO_CODEC_CFG_FREQ_88KHZ
88.2 Khz codec sampling frequency
Definition audio.h:274
@ BT_AUDIO_CODEC_CFG_FREQ
Sampling frequency.
Definition audio.h:232
@ BT_AUDIO_CODEC_CFG_FRAME_LEN
Octets per codec frame.
Definition audio.h:241
@ BT_AUDIO_CODEC_CFG_DURATION
Frame duration.
Definition audio.h:235
@ BT_AUDIO_CODEC_CFG_FRAME_BLKS_PER_SDU
Codec frame blocks per SDU.
Definition audio.h:244
@ BT_AUDIO_CODEC_CFG_CHAN_ALLOC
Audio channel allocation.
Definition audio.h:238
@ BT_AUDIO_CODEC_CAP_FREQ_176KHZ
176.4 Khz sampling frequency
Definition audio.h:116
@ BT_AUDIO_CODEC_CAP_FREQ_192KHZ
192 Khz sampling frequency
Definition audio.h:119
@ BT_AUDIO_CODEC_CAP_FREQ_88KHZ
88.2 Khz sampling frequency
Definition audio.h:110
@ BT_AUDIO_CODEC_CAP_FREQ_8KHZ
8 Khz sampling frequency
Definition audio.h:86
@ BT_AUDIO_CODEC_CAP_FREQ_11KHZ
11.025 Khz sampling frequency
Definition audio.h:89
@ BT_AUDIO_CODEC_CAP_FREQ_32KHZ
32 Khz sampling frequency
Definition audio.h:101
@ BT_AUDIO_CODEC_CAP_FREQ_48KHZ
48 Khz sampling frequency
Definition audio.h:107
@ BT_AUDIO_CODEC_CAP_FREQ_24KHZ
24 Khz sampling frequency
Definition audio.h:98
@ BT_AUDIO_CODEC_CAP_FREQ_16KHZ
16 Khz sampling frequency
Definition audio.h:92
@ BT_AUDIO_CODEC_CAP_FREQ_44KHZ
44.1 Khz sampling frequency
Definition audio.h:104
@ BT_AUDIO_CODEC_CAP_FREQ_22KHZ
22.05 Khz sampling frequency
Definition audio.h:95
@ BT_AUDIO_CODEC_CAP_FREQ_ANY
Any frequency capability.
Definition audio.h:125
@ BT_AUDIO_CODEC_CAP_FREQ_384KHZ
384 Khz sampling frequency
Definition audio.h:122
@ BT_AUDIO_CODEC_CAP_FREQ_96KHZ
96 Khz sampling frequency
Definition audio.h:113
@ BT_AUDIO_METADATA_TYPE_PROGRAM_INFO
UTF-8 encoded title or summary of stream content.
Definition audio.h:458
@ BT_AUDIO_METADATA_TYPE_EXTENDED
Extended metadata.
Definition audio.h:502
@ BT_AUDIO_METADATA_TYPE_VENDOR
Vendor specific metadata.
Definition audio.h:505
@ BT_AUDIO_METADATA_TYPE_CCID_LIST
Array of 8-bit CCID values.
Definition audio.h:469
@ BT_AUDIO_METADATA_TYPE_ASSISTED_LISTENING_STREAM
Assisted listening stream.
Definition audio.h:496
@ BT_AUDIO_METADATA_TYPE_BROADCAST_IMMEDIATE
Broadcast Audio Immediate Rendering flag.
Definition audio.h:489
@ BT_AUDIO_METADATA_TYPE_PROGRAM_INFO_URI
UTF-8 encoded URI for additional Program information.
Definition audio.h:479
@ BT_AUDIO_METADATA_TYPE_PARENTAL_RATING
Parental rating.
Definition audio.h:476
@ BT_AUDIO_METADATA_TYPE_STREAM_CONTEXT
Streaming audio context.
Definition audio.h:455
@ BT_AUDIO_METADATA_TYPE_PREF_CONTEXT
Preferred audio context.
Definition audio.h:443
@ BT_AUDIO_METADATA_TYPE_BROADCAST_NAME
UTF-8 encoded Broadcast name.
Definition audio.h:499
@ BT_AUDIO_METADATA_TYPE_AUDIO_STATE
Audio active state.
Definition audio.h:486
@ BT_AUDIO_METADATA_TYPE_LANG
Language.
Definition audio.h:466
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_4
Supporting 4 channel.
Definition audio.h:176
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_2
Supporting 2 channel.
Definition audio.h:170
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_1
Supporting 1 channel.
Definition audio.h:167
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_3
Supporting 3 channel.
Definition audio.h:173
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_8
Supporting 8 channel.
Definition audio.h:188
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_7
Supporting 7 channel.
Definition audio.h:185
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_ANY
Supporting all channels.
Definition audio.h:191
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_5
Supporting 5 channel.
Definition audio.h:179
@ BT_AUDIO_CODEC_CAP_CHAN_COUNT_6
Supporting 6 channel.
Definition audio.h:182
@ BT_AUDIO_CODEC_CAP_DURATION_7_5
7.5 msec frame duration capability
Definition audio.h:138
@ BT_AUDIO_CODEC_CAP_DURATION_PREFER_7_5
7.5 msec preferred frame duration capability.
Definition audio.h:153
@ BT_AUDIO_CODEC_CAP_DURATION_ANY
Any frame duration capability.
Definition audio.h:144
@ BT_AUDIO_CODEC_CAP_DURATION_PREFER_10
10 msec preferred frame duration capability
Definition audio.h:161
@ BT_AUDIO_CODEC_CAP_DURATION_10
10 msec frame duration capability
Definition audio.h:141
@ BT_AUDIO_CODEC_CAP_TYPE_CHAN_COUNT
Supported audio channel counts.
Definition audio.h:74
@ BT_AUDIO_CODEC_CAP_TYPE_DURATION
Supported frame durations.
Definition audio.h:71
@ BT_AUDIO_CODEC_CAP_TYPE_FRAME_COUNT
Supported maximum codec frames per SDU.
Definition audio.h:80
@ BT_AUDIO_CODEC_CAP_TYPE_FRAME_LEN
Supported octets per codec frame.
Definition audio.h:77
@ BT_AUDIO_CODEC_CAP_TYPE_FREQ
Supported sampling frequencies.
Definition audio.h:68
@ BT_AUDIO_CONTEXT_TYPE_NOTIFICATIONS
Notification and reminder sounds; attention-seeking audio, for example, in beeps signaling the arriva...
Definition audio.h:341
@ BT_AUDIO_CONTEXT_TYPE_EMERGENCY_ALARM
Emergency alarm Emergency sounds, for example, fire alarms or other urgent alerts.
Definition audio.h:353
@ BT_AUDIO_CONTEXT_TYPE_INSTRUCTIONAL
Instructional audio, for example, in navigation, announcements, or user guidance.
Definition audio.h:324
@ BT_AUDIO_CONTEXT_TYPE_RINGTONE
Alerts the user to an incoming call, for example, an incoming telephony or video call,...
Definition audio.h:346
@ 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:331
@ BT_AUDIO_CONTEXT_TYPE_MEDIA
Media, for example, music playback, radio, podcast or movie soundtrack, or tv audio.
Definition audio.h:317
@ BT_AUDIO_CONTEXT_TYPE_GAME
Audio associated with video gaming, for example gaming media; gaming effects; music and in-game voice...
Definition audio.h:322
@ BT_AUDIO_CONTEXT_TYPE_SOUND_EFFECTS
Sound effects including keyboard and touch feedback; menu and user interface sounds; and other system...
Definition audio.h:336
@ BT_AUDIO_CONTEXT_TYPE_VOICE_ASSISTANTS
Man-machine communication, for example, with voice recognition or virtual assistants.
Definition audio.h:326
@ BT_AUDIO_CONTEXT_TYPE_NONE
No context type.
Definition audio.h:305
@ BT_AUDIO_CONTEXT_TYPE_CONVERSATIONAL
Conversation between humans, for example, in telephony or video calls, including traditional cellular...
Definition audio.h:315
@ BT_AUDIO_CONTEXT_TYPE_ALERTS
Alarms and timers; immediate alerts, for example, in a critical battery alarm, timer expiry or alarm ...
Definition audio.h:351
@ BT_AUDIO_CONTEXT_TYPE_UNSPECIFIED
Identifies audio where the use case context does not match any other defined value,...
Definition audio.h:310
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
Bluetooth ISO handling.
Bluetooth LC3 codec handling.
state
Definition parser_state.h:29
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Codec capability structure.
Definition audio.h:688
uint16_t vid
Codec Company Vendor ID.
Definition audio.h:706
uint8_t data[CONFIG_BT_AUDIO_CODEC_CAP_MAX_DATA_SIZE]
Codec Specific Capabilities Data.
Definition audio.h:711
uint16_t cid
Codec Company ID.
Definition audio.h:704
uint8_t path_id
Data path ID.
Definition audio.h:694
bool ctlr_transcode
Whether or not the local controller should transcode.
Definition audio.h:700
uint8_t meta[CONFIG_BT_AUDIO_CODEC_CAP_MAX_METADATA_SIZE]
Codec Specific Capabilities Metadata.
Definition audio.h:717
size_t data_len
Codec Specific Capabilities Data count.
Definition audio.h:709
uint8_t id
Codec ID.
Definition audio.h:702
size_t meta_len
Codec Specific Capabilities Metadata count.
Definition audio.h:715
Codec specific configuration structure.
Definition audio.h:755
size_t meta_len
Codec Specific Capabilities Metadata count.
Definition audio.h:794
uint16_t vid
Codec Company Vendor ID.
Definition audio.h:785
uint8_t meta[CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE]
Codec Specific Capabilities Metadata.
Definition audio.h:796
uint16_t cid
Codec Company ID.
Definition audio.h:783
size_t data_len
Codec Specific Capabilities Data count.
Definition audio.h:788
uint8_t path_id
Data path ID.
Definition audio.h:761
bool ctlr_transcode
Whether or not the local controller should transcode.
Definition audio.h:767
uint8_t id
Codec ID.
Definition audio.h:781
uint8_t data[CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE]
Codec Specific Capabilities Data.
Definition audio.h:790
struct to hold minimum and maximum supported codec frame sizes
Definition audio.h:217
uint16_t min
Minimum number of octets supported per codec frame.
Definition audio.h:219
uint16_t max
Maximum number of octets supported per codec frame.
Definition audio.h:221
Bluetooth data.
Definition bluetooth.h:538
Misc utilities.
Macro utilities.