Zephyr API Documentation 4.0.99
A Scalable Open Source RTOS
Loading...
Searching...
No Matches
bap.h
Go to the documentation of this file.
1
11#ifndef ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_BAP_
12#define ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_BAP_
13
27#include <stdbool.h>
28#include <stddef.h>
29#include <stdint.h>
30
36#include <zephyr/net_buf.h>
37#include <zephyr/sys/slist.h>
39
40#ifdef __cplusplus
41extern "C" {
42#endif
43
44#if defined(CONFIG_BT_BAP_BASS_MAX_SUBGROUPS)
45#define BT_BAP_BASS_MAX_SUBGROUPS CONFIG_BT_BAP_BASS_MAX_SUBGROUPS
46#else
47#define BT_BAP_BASS_MAX_SUBGROUPS 0
48#endif /* CONFIG_BT_BAP_BASS_MAX_SUBGROUPS*/
49
51#define BT_BAP_INVALID_BROADCAST_ID 0xFFFFFFFFU
52
61#define BT_BAP_BASS_VALID_BIT_BITFIELD(_bis_bitfield) \
62 ((_bis_bitfield) == 0U || (_bis_bitfield) == BT_BAP_BIS_SYNC_NO_PREF || \
63 BT_ISO_VALID_BIS_BITFIELD(_bis_bitfield))
64
76#define BT_BAP_QOS_CFG(_interval, _framing, _phy, _sdu, _rtn, _latency, _pd) \
77 ((struct bt_bap_qos_cfg){ \
78 .interval = _interval, \
79 .framing = _framing, \
80 .phy = _phy, \
81 .sdu = _sdu, \
82 .rtn = _rtn, \
83 IF_ENABLED(UTIL_OR(IS_ENABLED(CONFIG_BT_BAP_BROADCAST_SOURCE), \
84 IS_ENABLED(CONFIG_BT_BAP_UNICAST)), \
85 (.latency = _latency,)) \
86 .pd = _pd, \
87 })
88
96
98enum {
105};
106
116#define BT_BAP_QOS_CFG_UNFRAMED(_interval, _sdu, _rtn, _latency, _pd) \
117 BT_BAP_QOS_CFG(_interval, BT_BAP_QOS_CFG_FRAMING_UNFRAMED, BT_BAP_QOS_CFG_2M, _sdu, _rtn, \
118 _latency, _pd)
119
129#define BT_BAP_QOS_CFG_FRAMED(_interval, _sdu, _rtn, _latency, _pd) \
130 BT_BAP_QOS_CFG(_interval, BT_BAP_QOS_CFG_FRAMING_FRAMED, BT_BAP_QOS_CFG_2M, _sdu, _rtn, \
131 _latency, _pd)
132
146
154 struct {
157
165
173
180
181#if defined(CONFIG_BT_BAP_BROADCAST_SOURCE) || defined(CONFIG_BT_BAP_UNICAST) || \
182 defined(__DOXYGEN__)
189#endif /* CONFIG_BT_BAP_BROADCAST_SOURCE || CONFIG_BT_BAP_UNICAST */
190
197
198#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
211
218
227#endif /* CONFIG_BT_ISO_TEST_PARAMS */
228 };
229};
230
243#define BT_BAP_QOS_CFG_PREF(_unframed_supported, _phy, _rtn, _latency, _pd_min, _pd_max, \
244 _pref_pd_min, _pref_pd_max) \
245 { \
246 .unframed_supported = _unframed_supported, .phy = _phy, .rtn = _rtn, \
247 .latency = _latency, .pd_min = _pd_min, .pd_max = _pd_max, \
248 .pref_pd_min = _pref_pd_min, .pref_pd_max = _pref_pd_max, \
249 }
250
318
336
351
360
362#define BT_BAP_PA_INTERVAL_UNKNOWN 0xFFFF
363
370#define BT_BAP_BIS_SYNC_NO_PREF 0xFFFFFFFF
372#define BT_BAP_BIS_SYNC_FAILED 0xFFFFFFFF
373
397
436
468
520
528#define BT_BAP_ASCS_RSP(c, r) (struct bt_bap_ascs_rsp) { .code = c, .reason = r }
529
531struct bt_bap_broadcast_source;
532
534struct bt_bap_broadcast_sink;
535
537struct bt_bap_unicast_group;
538
540struct bt_bap_ep;
541
546
549
550#if defined(CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE) || defined(__DOXYGEN__)
552 uint8_t metadata[CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE];
553#endif /* CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE */
554};
555
593
609 void (*recv_state_updated)(struct bt_conn *conn,
610 const struct bt_bap_scan_delegator_recv_state *recv_state);
611
628 int (*pa_sync_req)(struct bt_conn *conn,
629 const struct bt_bap_scan_delegator_recv_state *recv_state,
630 bool past_avail, uint16_t pa_interval);
631
645 int (*pa_sync_term_req)(struct bt_conn *conn,
646 const struct bt_bap_scan_delegator_recv_state *recv_state);
647
659 void (*broadcast_code)(struct bt_conn *conn,
660 const struct bt_bap_scan_delegator_recv_state *recv_state,
683 int (*bis_sync_req)(struct bt_conn *conn,
684 const struct bt_bap_scan_delegator_recv_state *recv_state,
695 void (*scanning_state)(struct bt_conn *conn, bool is_scanning);
696};
697
702
705
708
711
714
717
721 struct bt_bap_ep *paired_ep;
722
725};
726
736int bt_bap_ep_get_info(const struct bt_bap_ep *ep, struct bt_bap_ep_info *info);
737
748 struct bt_conn *conn;
749
751 struct bt_bap_ep *ep;
752
755
758
761
762#if defined(CONFIG_BT_BAP_UNICAST_CLIENT) || defined(__DOXYGEN__)
768 struct bt_bap_iso *bap_iso;
769#endif /* CONFIG_BT_BAP_UNICAST_CLIENT */
770
772 void *group;
773
776
777#if defined(CONFIG_BT_BAP_DEBUG_STREAM_SEQ_NUM) || defined(__DOXYGEN__)
779 uint16_t _prev_seq_num;
780#endif /* CONFIG_BT_BAP_DEBUG_STREAM_SEQ_NUM */
781
783 sys_snode_t _node;
784};
785
788#if defined(CONFIG_BT_BAP_UNICAST) || defined(__DOXYGEN__)
797 void (*configured)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref);
798
807 void (*qos_set)(struct bt_bap_stream *stream);
808
816 void (*enabled)(struct bt_bap_stream *stream);
817
826 void (*metadata_updated)(struct bt_bap_stream *stream);
827
835 void (*disabled)(struct bt_bap_stream *stream);
836
845 void (*released)(struct bt_bap_stream *stream);
846#endif /* CONFIG_BT_BAP_UNICAST */
847
856 void (*started)(struct bt_bap_stream *stream);
857
866 void (*stopped)(struct bt_bap_stream *stream, uint8_t reason);
867
868#if defined(CONFIG_BT_AUDIO_RX) || defined(__DOXYGEN__)
880 void (*recv)(struct bt_bap_stream *stream, const struct bt_iso_recv_info *info,
881 struct net_buf *buf);
882#endif /* CONFIG_BT_AUDIO_RX */
883
884#if defined(CONFIG_BT_AUDIO_TX) || defined(__DOXYGEN__)
897 void (*sent)(struct bt_bap_stream *stream);
898#endif /* CONFIG_BT_AUDIO_TX */
899
912 void (*connected)(struct bt_bap_stream *stream);
913
926 void (*disconnected)(struct bt_bap_stream *stream, uint8_t reason);
927};
928
944
954
968int bt_bap_stream_config(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_bap_ep *ep,
969 struct bt_audio_codec_cfg *codec_cfg);
970
984int bt_bap_stream_reconfig(struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg);
985
998int bt_bap_stream_qos(struct bt_conn *conn, struct bt_bap_unicast_group *group);
999
1014int bt_bap_stream_enable(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len);
1015
1027int bt_bap_stream_metadata(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len);
1028
1042
1067
1091
1116
1131
1146int bt_bap_stream_send(struct bt_bap_stream *stream, struct net_buf *buf, uint16_t seq_num);
1147
1164int bt_bap_stream_send_ts(struct bt_bap_stream *stream, struct net_buf *buf, uint16_t seq_num,
1165 uint32_t ts);
1166
1186
1213 int (*config)(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir,
1214 const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream,
1215 struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp);
1216
1233 int (*reconfig)(struct bt_bap_stream *stream, enum bt_audio_dir dir,
1234 const struct bt_audio_codec_cfg *codec_cfg,
1235 struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp);
1236
1250 int (*qos)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos,
1251 struct bt_bap_ascs_rsp *rsp);
1252
1266 int (*enable)(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len,
1267 struct bt_bap_ascs_rsp *rsp);
1268
1280 int (*start)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1281
1295 int (*metadata)(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len,
1296 struct bt_bap_ascs_rsp *rsp);
1297
1309 int (*disable)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1310
1322 int (*stop)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1323
1336 int (*release)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp);
1337};
1338
1350
1366
1380
1395
1403typedef void (*bt_bap_ep_func_t)(struct bt_bap_ep *ep, void *user_data);
1404
1412void bt_bap_unicast_server_foreach_ep(struct bt_conn *conn, bt_bap_ep_func_t func, void *user_data);
1413
1424int bt_bap_unicast_server_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream,
1425 struct bt_audio_codec_cfg *codec_cfg,
1426 const struct bt_bap_qos_cfg_pref *qos_pref);
1427
1428 /* End of group bt_bap_unicast_server */
1429
1444
1458
1463
1466
1475
1476#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
1486
1496
1505#endif /* CONFIG_BT_ISO_TEST_PARAMS */
1506};
1507
1522 struct bt_bap_unicast_group **unicast_group);
1523
1539int bt_bap_unicast_group_reconfig(struct bt_bap_unicast_group *unicast_group,
1540 const struct bt_bap_unicast_group_param *param);
1541
1561int bt_bap_unicast_group_add_streams(struct bt_bap_unicast_group *unicast_group,
1563 size_t num_param);
1564
1575int bt_bap_unicast_group_delete(struct bt_bap_unicast_group *unicast_group);
1576
1591 void (*location)(struct bt_conn *conn, enum bt_audio_dir dir, enum bt_audio_location loc);
1592
1605 void (*available_contexts)(struct bt_conn *conn, enum bt_audio_context snk_ctx,
1606 enum bt_audio_context src_ctx);
1607
1617 void (*config)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1618 enum bt_bap_ascs_reason reason);
1619
1632 void (*qos)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1633 enum bt_bap_ascs_reason reason);
1634
1645 void (*enable)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1646 enum bt_bap_ascs_reason reason);
1647
1660 void (*start)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1661 enum bt_bap_ascs_reason reason);
1662
1675 void (*stop)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1676 enum bt_bap_ascs_reason reason);
1677
1688 void (*disable)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1689 enum bt_bap_ascs_reason reason);
1690
1701 void (*metadata)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1702 enum bt_bap_ascs_reason reason);
1703
1714 void (*release)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code,
1715 enum bt_bap_ascs_reason reason);
1716
1731 void (*pac_record)(struct bt_conn *conn, enum bt_audio_dir dir,
1732 const struct bt_audio_codec_cap *codec_cap);
1733
1745 void (*endpoint)(struct bt_conn *conn, enum bt_audio_dir dir, struct bt_bap_ep *ep);
1746
1759 void (*discover)(struct bt_conn *conn, int err, enum bt_audio_dir dir);
1760
1763 sys_snode_t _node;
1765};
1766
1780
1790int bt_bap_unicast_client_discover(struct bt_conn *conn, enum bt_audio_dir dir);
1791
1792 /* End of group bt_bap_unicast_client */
1801struct bt_bap_base_subgroup;
1803struct bt_bap_base;
1804
1814
1824
1833const struct bt_bap_base *bt_bap_base_get_base_from_ad(const struct bt_data *ad);
1834
1843int bt_bap_base_get_size(const struct bt_bap_base *base);
1844
1853int bt_bap_base_get_pres_delay(const struct bt_bap_base *base);
1854
1863int bt_bap_base_get_subgroup_count(const struct bt_bap_base *base);
1864
1874int bt_bap_base_get_bis_indexes(const struct bt_bap_base *base, uint32_t *bis_indexes);
1875
1887int bt_bap_base_foreach_subgroup(const struct bt_bap_base *base,
1888 bool (*func)(const struct bt_bap_base_subgroup *subgroup,
1889 void *user_data),
1890 void *user_data);
1891
1901int bt_bap_base_get_subgroup_codec_id(const struct bt_bap_base_subgroup *subgroup,
1902 struct bt_bap_base_codec_id *codec_id);
1903
1913int bt_bap_base_get_subgroup_codec_data(const struct bt_bap_base_subgroup *subgroup,
1914 uint8_t **data);
1915
1925int bt_bap_base_get_subgroup_codec_meta(const struct bt_bap_base_subgroup *subgroup,
1926 uint8_t **meta);
1927
1938int bt_bap_base_subgroup_codec_to_codec_cfg(const struct bt_bap_base_subgroup *subgroup,
1939 struct bt_audio_codec_cfg *codec_cfg);
1940
1949int bt_bap_base_get_subgroup_bis_count(const struct bt_bap_base_subgroup *subgroup);
1950
1960int bt_bap_base_subgroup_get_bis_indexes(const struct bt_bap_base_subgroup *subgroup,
1961 uint32_t *bis_indexes);
1962
1974int bt_bap_base_subgroup_foreach_bis(const struct bt_bap_base_subgroup *subgroup,
1975 bool (*func)(const struct bt_bap_base_subgroup_bis *bis,
1976 void *user_data),
1977 void *user_data);
1978
1993 struct bt_audio_codec_cfg *codec_cfg);
1994
1995 /* End of group bt_bap_broadcast */
1996
2015 void (*started)(struct bt_bap_broadcast_source *source);
2016
2023 void (*stopped)(struct bt_bap_broadcast_source *source, uint8_t reason);
2024
2026 sys_snode_t _node;
2027};
2028
2039
2050
2055
2056#if CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE > 0 || defined(__DOXYGEN__)
2062 size_t data_len;
2063
2066#endif /* CONFIG_BT_AUDIO_CODEC_CFG_MAX_DATA_SIZE > 0 */
2067};
2068
2080
2085
2088
2091
2100
2103
2115
2116#if defined(CONFIG_BT_ISO_TEST_PARAMS) || defined(__DOXYGEN__)
2125
2134
2143#endif /* CONFIG_BT_ISO_TEST_PARAMS */
2144};
2145
2163 struct bt_bap_broadcast_source **source);
2164
2184int bt_bap_broadcast_source_reconfig(struct bt_bap_broadcast_source *source,
2185 struct bt_bap_broadcast_source_param *param);
2186
2199int bt_bap_broadcast_source_update_metadata(struct bt_bap_broadcast_source *source,
2200 const uint8_t meta[], size_t meta_len);
2201
2213int bt_bap_broadcast_source_start(struct bt_bap_broadcast_source *source,
2214 struct bt_le_ext_adv *adv);
2215
2226int bt_bap_broadcast_source_stop(struct bt_bap_broadcast_source *source);
2227
2238int bt_bap_broadcast_source_delete(struct bt_bap_broadcast_source *source);
2239
2254int bt_bap_broadcast_source_get_base(struct bt_bap_broadcast_source *source,
2255 struct net_buf_simple *base_buf);
2256
2257 /* End of bt_bap_broadcast_source */
2258
2278 void (*base_recv)(struct bt_bap_broadcast_sink *sink, const struct bt_bap_base *base,
2279 size_t base_size);
2280
2293 void (*syncable)(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo);
2294
2301 void (*started)(struct bt_bap_broadcast_sink *sink);
2302
2309 void (*stopped)(struct bt_bap_broadcast_sink *sink, uint8_t reason);
2310
2312 sys_snode_t _node;
2313};
2314
2329
2348int bt_bap_broadcast_sink_create(struct bt_le_per_adv_sync *pa_sync, uint32_t broadcast_id,
2349 struct bt_bap_broadcast_sink **sink);
2350
2370int bt_bap_broadcast_sink_sync(struct bt_bap_broadcast_sink *sink, uint32_t indexes_bitfield,
2371 struct bt_bap_stream *streams[],
2372 const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]);
2373
2384int bt_bap_broadcast_sink_stop(struct bt_bap_broadcast_sink *sink);
2385
2397int bt_bap_broadcast_sink_delete(struct bt_bap_broadcast_sink *sink);
2398
2399 /* End of group bt_bap_broadcast_sink */
2400
2415
2425
2440 enum bt_bap_pa_state pa_state);
2441
2452
2473
2488
2511
2526
2541
2553 const struct bt_bap_scan_delegator_recv_state *recv_state, void *user_data);
2554
2562 void *user_data);
2563
2573 bt_bap_scan_delegator_state_func_t func, void *user_data);
2574
2575/******************************** CLIENT API ********************************/
2576
2583typedef void (*bt_bap_broadcast_assistant_write_cb)(struct bt_conn *conn,
2584 int err);
2585
2601 void (*discover)(struct bt_conn *conn, int err,
2602 uint8_t recv_state_count);
2603
2613 void (*scan)(const struct bt_le_scan_recv_info *info,
2614 uint32_t broadcast_id);
2615
2625 void (*recv_state)(struct bt_conn *conn, int err,
2627
2634 void (*recv_state_removed)(struct bt_conn *conn, uint8_t src_id);
2635
2642 void (*scan_start)(struct bt_conn *conn, int err);
2643
2650 void (*scan_stop)(struct bt_conn *conn, int err);
2651
2658 void (*add_src)(struct bt_conn *conn, int err);
2659
2666 void (*mod_src)(struct bt_conn *conn, int err);
2667
2674 void (*broadcast_code)(struct bt_conn *conn, int err);
2675
2682 void (*rem_src)(struct bt_conn *conn, int err);
2683
2685 sys_snode_t _node;
2686};
2687
2703int bt_bap_broadcast_assistant_discover(struct bt_conn *conn);
2704
2730 bool start_scan);
2731
2746
2757
2768
2769
2801
2816 struct bt_conn *conn, const struct bt_bap_broadcast_assistant_add_src_param *param);
2817
2839
2854 struct bt_conn *conn, const struct bt_bap_broadcast_assistant_mod_src_param *param);
2855
2871 struct bt_conn *conn, uint8_t src_id,
2872 const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]);
2873
2887int bt_bap_broadcast_assistant_rem_src(struct bt_conn *conn, uint8_t src_id);
2888
2904
2905 /* end of bt_bap */
2906
2907#ifdef __cplusplus
2908}
2909#endif
2910
2911#endif /* ZEPHYR_INCLUDE_BLUETOOTH_AUDIO_BAP_ */
Bluetooth device address definitions and utilities.
Bluetooth Audio handling.
Bluetooth subsystem core APIs.
Bluetooth connection handling.
bt_audio_dir
Audio direction from the perspective of the BAP Unicast Server / BAP Broadcast Sink.
Definition audio.h:796
bt_audio_location
Location values for BT Audio.
Definition audio.h:590
bt_audio_metadata_type
Codec metadata type IDs.
Definition audio.h:432
bt_audio_context
Audio Context Type for Generic Audio.
Definition audio.h:303
int bt_bap_broadcast_sink_create(struct bt_le_per_adv_sync *pa_sync, uint32_t broadcast_id, struct bt_bap_broadcast_sink **sink)
Create a Broadcast Sink from a periodic advertising sync.
int bt_bap_broadcast_sink_stop(struct bt_bap_broadcast_sink *sink)
Stop audio broadcast sink.
int bt_bap_broadcast_sink_register_cb(struct bt_bap_broadcast_sink_cb *cb)
Register Broadcast sink callbacks.
int bt_bap_broadcast_sink_delete(struct bt_bap_broadcast_sink *sink)
Release a broadcast sink.
int bt_bap_broadcast_sink_sync(struct bt_bap_broadcast_sink *sink, uint32_t indexes_bitfield, struct bt_bap_stream *streams[], const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE])
Sync to a broadcaster's audio.
int bt_bap_broadcast_source_delete(struct bt_bap_broadcast_source *source)
Delete audio broadcast source.
int bt_bap_broadcast_source_stop(struct bt_bap_broadcast_source *source)
Stop audio broadcast source.
int bt_bap_broadcast_source_reconfig(struct bt_bap_broadcast_source *source, struct bt_bap_broadcast_source_param *param)
Reconfigure audio broadcast source.
int bt_bap_broadcast_source_start(struct bt_bap_broadcast_source *source, struct bt_le_ext_adv *adv)
Start audio broadcast source.
int bt_bap_broadcast_source_register_cb(struct bt_bap_broadcast_source_cb *cb)
Registers callbacks for Broadcast Sources.
int bt_bap_broadcast_source_unregister_cb(struct bt_bap_broadcast_source_cb *cb)
Unregisters callbacks for Broadcast Sources.
int bt_bap_broadcast_source_create(struct bt_bap_broadcast_source_param *param, struct bt_bap_broadcast_source **source)
Create audio broadcast source.
int bt_bap_broadcast_source_get_base(struct bt_bap_broadcast_source *source, struct net_buf_simple *base_buf)
Get the Broadcast Audio Stream Endpoint of a broadcast source.
int bt_bap_broadcast_source_update_metadata(struct bt_bap_broadcast_source *source, const uint8_t meta[], size_t meta_len)
Modify the metadata of an audio broadcast source.
int bt_bap_base_get_subgroup_bis_count(const struct bt_bap_base_subgroup *subgroup)
Get the BIS count of a subgroup.
int bt_bap_base_get_subgroup_codec_data(const struct bt_bap_base_subgroup *subgroup, uint8_t **data)
Get the codec configuration data of a subgroup.
const struct bt_bap_base * bt_bap_base_get_base_from_ad(const struct bt_data *ad)
Generate a pointer to a BASE from periodic advertising data.
int bt_bap_base_subgroup_get_bis_indexes(const struct bt_bap_base_subgroup *subgroup, uint32_t *bis_indexes)
Get all BIS indexes of a subgroup.
int bt_bap_base_subgroup_foreach_bis(const struct bt_bap_base_subgroup *subgroup, bool(*func)(const struct bt_bap_base_subgroup_bis *bis, void *user_data), void *user_data)
Iterate on all BIS in the subgroup.
int bt_bap_base_get_size(const struct bt_bap_base *base)
Get the size of a BASE.
int bt_bap_base_foreach_subgroup(const struct bt_bap_base *base, bool(*func)(const struct bt_bap_base_subgroup *subgroup, void *user_data), void *user_data)
Iterate on all subgroups in the BASE.
int bt_bap_base_get_bis_indexes(const struct bt_bap_base *base, uint32_t *bis_indexes)
Get all BIS indexes of a BASE.
int bt_bap_base_subgroup_codec_to_codec_cfg(const struct bt_bap_base_subgroup *subgroup, struct bt_audio_codec_cfg *codec_cfg)
Store subgroup codec data in a Codec config parsing APIs.
int bt_bap_base_subgroup_bis_codec_to_codec_cfg(const struct bt_bap_base_subgroup_bis *bis, struct bt_audio_codec_cfg *codec_cfg)
Store BIS codec configuration data in a Codec config parsing APIs.
int bt_bap_base_get_subgroup_count(const struct bt_bap_base *base)
Get the subgroup count of a BASE.
int bt_bap_base_get_subgroup_codec_id(const struct bt_bap_base_subgroup *subgroup, struct bt_bap_base_codec_id *codec_id)
Get the codec ID of a subgroup.
int bt_bap_base_get_pres_delay(const struct bt_bap_base *base)
Get the presentation delay value of a BASE.
int bt_bap_base_get_subgroup_codec_meta(const struct bt_bap_base_subgroup *subgroup, uint8_t **meta)
Get the codec metadata of a subgroup.
int bt_bap_unicast_group_delete(struct bt_bap_unicast_group *unicast_group)
Delete audio unicast group.
int bt_bap_unicast_group_add_streams(struct bt_bap_unicast_group *unicast_group, struct bt_bap_unicast_group_stream_pair_param params[], size_t num_param)
Add streams to a unicast group as a unicast client.
int bt_bap_unicast_group_create(struct bt_bap_unicast_group_param *param, struct bt_bap_unicast_group **unicast_group)
Create unicast group.
int bt_bap_unicast_group_reconfig(struct bt_bap_unicast_group *unicast_group, const struct bt_bap_unicast_group_param *param)
Reconfigure unicast group.
int bt_bap_unicast_client_discover(struct bt_conn *conn, enum bt_audio_dir dir)
Discover remote capabilities and endpoints.
int bt_bap_unicast_client_register_cb(struct bt_bap_unicast_client_cb *cb)
Register unicast client callbacks.
void bt_bap_unicast_server_foreach_ep(struct bt_conn *conn, bt_bap_ep_func_t func, void *user_data)
Iterate through all endpoints of the given connection.
int bt_bap_unicast_server_config_ase(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg, const struct bt_bap_qos_cfg_pref *qos_pref)
Initialize and configure a new ASE.
int bt_bap_unicast_server_unregister(void)
Unregister the Unicast Server.
int bt_bap_unicast_server_register_cb(const struct bt_bap_unicast_server_cb *cb)
Register unicast server callbacks.
int bt_bap_unicast_server_register(const struct bt_bap_unicast_server_register_param *param)
Register the Unicast Server.
void(* bt_bap_ep_func_t)(struct bt_bap_ep *ep, void *user_data)
The callback function called for each endpoint.
Definition bap.h:1403
int bt_bap_unicast_server_unregister_cb(const struct bt_bap_unicast_server_cb *cb)
Unregister unicast server callbacks.
int bt_bap_broadcast_assistant_rem_src(struct bt_conn *conn, uint8_t src_id)
Remove a source from the server.
int bt_bap_stream_metadata(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len)
Change Audio Stream Metadata.
int bt_bap_stream_disable(struct bt_bap_stream *stream)
Disable Audio Stream.
int bt_bap_stream_enable(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len)
Enable Audio Stream.
bt_bap_bass_att_err
Broadcast Audio Scan Service (BASS) specific ATT error codes.
Definition bap.h:353
int bt_bap_stream_config(struct bt_conn *conn, struct bt_bap_stream *stream, struct bt_bap_ep *ep, struct bt_audio_codec_cfg *codec_cfg)
Configure Audio Stream.
bt_bap_qos_cfg_framing
QoS Framing.
Definition bap.h:90
int bt_bap_scan_delegator_set_pa_state(uint8_t src_id, enum bt_bap_pa_state pa_state)
Set the periodic advertising sync state to syncing.
#define BT_BAP_BASS_MAX_SUBGROUPS
Definition bap.h:47
int bt_bap_stream_get_tx_sync(struct bt_bap_stream *stream, struct bt_iso_tx_info *info)
Get ISO transmission timing info for a Basic Audio Profile stream.
void(* bt_bap_broadcast_assistant_write_cb)(struct bt_conn *conn, int err)
Callback function for writes.
Definition bap.h:2583
bt_bap_big_enc_state
Broadcast Isochronous Group encryption state reported by the Scan Delegator.
Definition bap.h:338
int bt_bap_stream_send(struct bt_bap_stream *stream, struct net_buf *buf, uint16_t seq_num)
Send data to Audio stream without timestamp.
int bt_bap_broadcast_assistant_unregister_cb(struct bt_bap_broadcast_assistant_cb *cb)
Unregisters the callbacks used by the Broadcast Audio Scan Service client.
int bt_bap_scan_delegator_rem_src(uint8_t src_id)
Remove a receive state source.
int bt_bap_scan_delegator_add_src(const struct bt_bap_scan_delegator_add_src_param *param)
Add a receive state source locally.
int bt_bap_scan_delegator_unregister(void)
unregister the Basic Audio Profile Scan Delegator and BASS.
int bt_bap_scan_delegator_register(struct bt_bap_scan_delegator_cb *cb)
Register the Basic Audio Profile Scan Delegator and BASS.
int bt_bap_broadcast_assistant_scan_stop(struct bt_conn *conn)
Stop remote scanning for BISes for a server.
int bt_bap_stream_start(struct bt_bap_stream *stream)
Start Audio Stream.
int bt_bap_broadcast_assistant_read_recv_state(struct bt_conn *conn, uint8_t idx)
Read the specified receive state from the server.
int bt_bap_broadcast_assistant_scan_start(struct bt_conn *conn, bool start_scan)
Scan start for BISes for a remote server.
bt_bap_ascs_reason
Response Reasons.
Definition bap.h:444
bt_bap_ascs_rsp_code
Response Status Code.
Definition bap.h:404
int bt_bap_stream_send_ts(struct bt_bap_stream *stream, struct net_buf *buf, uint16_t seq_num, uint32_t ts)
Send data to Audio stream with timestamp.
int bt_bap_stream_connect(struct bt_bap_stream *stream)
Connect unicast audio stream.
int bt_bap_broadcast_assistant_mod_src(struct bt_conn *conn, const struct bt_bap_broadcast_assistant_mod_src_param *param)
Modify a source on the server.
int bt_bap_stream_reconfig(struct bt_bap_stream *stream, struct bt_audio_codec_cfg *codec_cfg)
Reconfigure Audio Stream.
int bt_bap_stream_release(struct bt_bap_stream *stream)
Release Audio Stream.
void bt_bap_stream_cb_register(struct bt_bap_stream *stream, struct bt_bap_stream_ops *ops)
Register Audio callbacks for a stream.
int bt_bap_broadcast_assistant_discover(struct bt_conn *conn)
Discover Broadcast Audio Scan Service on the server.
void bt_bap_scan_delegator_foreach_state(bt_bap_scan_delegator_state_func_t func, void *user_data)
Iterate through all existing receive states.
int bt_bap_broadcast_assistant_register_cb(struct bt_bap_broadcast_assistant_cb *cb)
Registers the callbacks used by Broadcast Audio Scan Service client.
int bt_bap_broadcast_assistant_set_broadcast_code(struct bt_conn *conn, uint8_t src_id, const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE])
Set a broadcast code to the specified receive state.
const struct bt_bap_scan_delegator_recv_state * bt_bap_scan_delegator_find_state(bt_bap_scan_delegator_state_func_t func, void *user_data)
Find and return a receive state based on a compare function.
int bt_bap_scan_delegator_mod_src(const struct bt_bap_scan_delegator_mod_src_param *param)
Add a receive state source locally.
bt_bap_pa_state
Periodic advertising state reported by the Scan Delegator.
Definition bap.h:320
int bt_bap_stream_qos(struct bt_conn *conn, struct bt_bap_unicast_group *group)
Configure Audio Stream QoS.
int bt_bap_broadcast_assistant_add_src(struct bt_conn *conn, const struct bt_bap_broadcast_assistant_add_src_param *param)
Add a source on the server.
int bt_bap_stream_stop(struct bt_bap_stream *stream)
Stop Audio Stream.
int bt_bap_ep_get_info(const struct bt_bap_ep *ep, struct bt_bap_ep_info *info)
Return structure holding information of audio stream endpoint.
bt_bap_ep_state
Endpoint states.
Definition bap.h:375
bool(* bt_bap_scan_delegator_state_func_t)(const struct bt_bap_scan_delegator_recv_state *recv_state, void *user_data)
Callback function for Scan Delegator receive state search functions.
Definition bap.h:2552
int bt_bap_scan_delegator_set_bis_sync_state(uint8_t src_id, uint32_t bis_synced[0])
Set the sync state of a receive state in the server.
@ BT_BAP_QOS_CFG_CODED
LE Coded PHY.
Definition bap.h:104
@ BT_BAP_QOS_CFG_2M
LE 2M PHY.
Definition bap.h:102
@ BT_BAP_QOS_CFG_1M
LE 1M PHY.
Definition bap.h:100
@ BT_BAP_BASS_ERR_OPCODE_NOT_SUPPORTED
Opcode not supported.
Definition bap.h:355
@ BT_BAP_BASS_ERR_INVALID_SRC_ID
Invalid source ID supplied.
Definition bap.h:358
@ BT_BAP_QOS_CFG_FRAMING_FRAMED
Packets are always framed.
Definition bap.h:94
@ BT_BAP_QOS_CFG_FRAMING_UNFRAMED
Packets may be framed or unframed.
Definition bap.h:92
@ BT_BAP_BIG_ENC_STATE_BCODE_REQ
The Broadcast Isochronous Group broadcast code requested.
Definition bap.h:343
@ BT_BAP_BIG_ENC_STATE_NO_ENC
The Broadcast Isochronous Group not encrypted.
Definition bap.h:340
@ BT_BAP_BIG_ENC_STATE_BAD_CODE
The Broadcast Isochronous Group bad broadcast code.
Definition bap.h:349
@ BT_BAP_BIG_ENC_STATE_DEC
The Broadcast Isochronous Group decrypted.
Definition bap.h:346
@ BT_BAP_ASCS_REASON_NONE
No reason.
Definition bap.h:446
@ BT_BAP_ASCS_REASON_PD
Presendation delay.
Definition bap.h:464
@ BT_BAP_ASCS_REASON_FRAMING
Framing.
Definition bap.h:454
@ BT_BAP_ASCS_REASON_CODEC_DATA
Codec configuration.
Definition bap.h:450
@ BT_BAP_ASCS_REASON_SDU
Maximum SDU size.
Definition bap.h:458
@ BT_BAP_ASCS_REASON_CODEC
Codec ID.
Definition bap.h:448
@ BT_BAP_ASCS_REASON_PHY
PHY.
Definition bap.h:456
@ BT_BAP_ASCS_REASON_LATENCY
Max transport latency.
Definition bap.h:462
@ BT_BAP_ASCS_REASON_CIS
Invalid CIS mapping.
Definition bap.h:466
@ BT_BAP_ASCS_REASON_RTN
RTN.
Definition bap.h:460
@ BT_BAP_ASCS_REASON_INTERVAL
SDU interval.
Definition bap.h:452
@ BT_BAP_ASCS_RSP_CODE_INVALID_ASE_STATE
Invalid ASE state.
Definition bap.h:414
@ BT_BAP_ASCS_RSP_CODE_METADATA_INVALID
Invalid metadata.
Definition bap.h:430
@ BT_BAP_ASCS_RSP_CODE_NOT_SUPPORTED
Server did not support operation by client.
Definition bap.h:408
@ BT_BAP_ASCS_RSP_CODE_CONF_UNSUPPORTED
Configuration parameters not supported by server.
Definition bap.h:420
@ BT_BAP_ASCS_RSP_CODE_INVALID_ASE
Invalid ASE ID.
Definition bap.h:412
@ BT_BAP_ASCS_RSP_CODE_INVALID_DIR
Invalid operation for direction.
Definition bap.h:416
@ BT_BAP_ASCS_RSP_CODE_CONF_INVALID
Invalid Configuration parameters.
Definition bap.h:424
@ BT_BAP_ASCS_RSP_CODE_CAP_UNSUPPORTED
Capabilities not supported by server.
Definition bap.h:418
@ BT_BAP_ASCS_RSP_CODE_NO_MEM
Server has insufficient resources.
Definition bap.h:432
@ BT_BAP_ASCS_RSP_CODE_METADATA_REJECTED
Metadata rejected by server.
Definition bap.h:428
@ BT_BAP_ASCS_RSP_CODE_UNSPECIFIED
Unspecified error.
Definition bap.h:434
@ BT_BAP_ASCS_RSP_CODE_INVALID_LENGTH
Server rejected due to invalid operation length.
Definition bap.h:410
@ BT_BAP_ASCS_RSP_CODE_METADATA_UNSUPPORTED
Unsupported metadata.
Definition bap.h:426
@ BT_BAP_ASCS_RSP_CODE_SUCCESS
Server completed operation successfully.
Definition bap.h:406
@ BT_BAP_ASCS_RSP_CODE_CONF_REJECTED
Configuration parameters rejected by server.
Definition bap.h:422
@ BT_BAP_PA_STATE_NOT_SYNCED
The periodic advertising has not been synchronized.
Definition bap.h:322
@ BT_BAP_PA_STATE_FAILED
Failed to synchronized to periodic advertising.
Definition bap.h:331
@ BT_BAP_PA_STATE_SYNCED
Synchronized to periodic advertising.
Definition bap.h:328
@ BT_BAP_PA_STATE_INFO_REQ
Waiting for SyncInfo from Broadcast Assistant.
Definition bap.h:325
@ BT_BAP_PA_STATE_NO_PAST
No periodic advertising sync transfer receiver from Broadcast Assistant.
Definition bap.h:334
@ BT_BAP_EP_STATE_ENABLING
Audio Stream Endpoint Enabling state.
Definition bap.h:386
@ BT_BAP_EP_STATE_IDLE
Audio Stream Endpoint Idle state.
Definition bap.h:377
@ BT_BAP_EP_STATE_CODEC_CONFIGURED
Audio Stream Endpoint Codec Configured state.
Definition bap.h:380
@ BT_BAP_EP_STATE_RELEASING
Audio Stream Endpoint Streaming state.
Definition bap.h:395
@ BT_BAP_EP_STATE_QOS_CONFIGURED
Audio Stream Endpoint QoS Configured state.
Definition bap.h:383
@ BT_BAP_EP_STATE_DISABLING
Audio Stream Endpoint Disabling state.
Definition bap.h:392
@ BT_BAP_EP_STATE_STREAMING
Audio Stream Endpoint Streaming state.
Definition bap.h:389
#define BT_ISO_BROADCAST_CODE_SIZE
Broadcast code size.
Definition iso.h:132
struct _snode sys_snode_t
Single-linked list node structure.
Definition slist.h:39
#define BIT(n)
Unsigned integer with bit position n set (signed in assembly language).
Definition util_macro.h:44
Bluetooth ISO handling.
Buffer management.
state
Definition parser_state.h:29
#define bool
Definition stdbool.h:13
__UINT32_TYPE__ uint32_t
Definition stdint.h:90
__UINT8_TYPE__ uint8_t
Definition stdint.h:88
__UINT16_TYPE__ uint16_t
Definition stdint.h:89
Bluetooth LE Device Address.
Definition addr.h:49
Codec capability structure.
Definition audio.h:684
Codec specific configuration structure.
Definition audio.h:718
Structure storing values of fields of ASE Control Point notification.
Definition bap.h:470
enum bt_bap_ascs_reason reason
Response reason.
Definition bap.h:507
enum bt_audio_metadata_type metadata_type
Response metadata type.
Definition bap.h:517
enum bt_bap_ascs_rsp_code code
Value of the Response Code field.
Definition bap.h:484
Codec ID structure for a Broadcast Audio Source Endpoint (BASE)
Definition bap.h:1806
uint16_t cid
Codec Company ID.
Definition bap.h:1810
uint16_t vid
Codec Company Vendor ID.
Definition bap.h:1812
uint8_t id
Codec ID.
Definition bap.h:1808
BIS structure for each BIS in a Broadcast Audio Source Endpoint (BASE) subgroup.
Definition bap.h:1816
uint8_t * data
Codec Specific Data.
Definition bap.h:1822
uint8_t data_len
Codec Specific Data length.
Definition bap.h:1820
uint8_t index
Unique index of the BIS.
Definition bap.h:1818
Struct to hold subgroup specific information for the receive state.
Definition bap.h:543
uint8_t metadata[CONFIG_BT_AUDIO_CODEC_CFG_MAX_METADATA_SIZE]
The metadata.
Definition bap.h:552
uint32_t bis_sync
BIS synced bitfield.
Definition bap.h:545
uint8_t metadata_len
Length of the metadata.
Definition bap.h:548
Parameters for adding a source to a Broadcast Audio Scan Service server.
Definition bap.h:2771
uint8_t num_subgroups
Number of subgroups.
Definition bap.h:2792
bt_addr_le_t addr
Address of the advertiser.
Definition bap.h:2773
uint8_t adv_sid
SID of the advertising set.
Definition bap.h:2776
struct bt_bap_bass_subgroup * subgroups
Pointer to array of subgroups.
Definition bap.h:2799
uint16_t pa_interval
Periodic advertising interval in milliseconds.
Definition bap.h:2789
bool pa_sync
Whether to sync to periodic advertisements.
Definition bap.h:2779
uint32_t broadcast_id
24-bit broadcast ID
Definition bap.h:2782
Struct to hold the Basic Audio Profile Broadcast Assistant callbacks.
Definition bap.h:2591
void(* discover)(struct bt_conn *conn, int err, uint8_t recv_state_count)
Callback function for bt_bap_broadcast_assistant_discover.
Definition bap.h:2601
void(* broadcast_code)(struct bt_conn *conn, int err)
Callback function for bt_bap_broadcast_assistant_set_broadcast_code().
Definition bap.h:2674
void(* recv_state)(struct bt_conn *conn, int err, const struct bt_bap_scan_delegator_recv_state *state)
Callback function for when a receive state is read or updated.
Definition bap.h:2625
void(* scan_stop)(struct bt_conn *conn, int err)
Callback function for bt_bap_broadcast_assistant_scan_stop().
Definition bap.h:2650
void(* mod_src)(struct bt_conn *conn, int err)
Callback function for bt_bap_broadcast_assistant_mod_src().
Definition bap.h:2666
void(* scan)(const struct bt_le_scan_recv_info *info, uint32_t broadcast_id)
Callback function for Broadcast Audio Scan Service client scan results.
Definition bap.h:2613
void(* scan_start)(struct bt_conn *conn, int err)
Callback function for bt_bap_broadcast_assistant_scan_start().
Definition bap.h:2642
void(* add_src)(struct bt_conn *conn, int err)
Callback function for bt_bap_broadcast_assistant_add_src().
Definition bap.h:2658
void(* rem_src)(struct bt_conn *conn, int err)
Callback function for bt_bap_broadcast_assistant_rem_src().
Definition bap.h:2682
void(* recv_state_removed)(struct bt_conn *conn, uint8_t src_id)
Callback function for when a receive state is removed.
Definition bap.h:2634
Parameters for modifying a source.
Definition bap.h:2819
struct bt_bap_bass_subgroup * subgroups
Pointer to array of subgroups.
Definition bap.h:2837
uint8_t num_subgroups
Number of subgroups.
Definition bap.h:2834
uint8_t src_id
Source ID of the receive state.
Definition bap.h:2821
bool pa_sync
Whether to sync to periodic advertisements.
Definition bap.h:2824
uint16_t pa_interval
Periodic advertising interval.
Definition bap.h:2831
Broadcast Audio Sink callback structure.
Definition bap.h:2267
void(* base_recv)(struct bt_bap_broadcast_sink *sink, const struct bt_bap_base *base, size_t base_size)
Broadcast Audio Source Endpoint (BASE) received.
Definition bap.h:2278
void(* stopped)(struct bt_bap_broadcast_sink *sink, uint8_t reason)
The Broadcast Sink has stopped and none of the streams will receive audio data.
Definition bap.h:2309
void(* syncable)(struct bt_bap_broadcast_sink *sink, const struct bt_iso_biginfo *biginfo)
Broadcast sink is syncable.
Definition bap.h:2293
void(* started)(struct bt_bap_broadcast_sink *sink)
The Broadcast Sink has started and audio data may be received from all of the streams.
Definition bap.h:2301
Struct to hold the Broadcast Source callbacks.
Definition bap.h:2009
void(* started)(struct bt_bap_broadcast_source *source)
The Broadcast Source has started and all of the streams are ready for audio data.
Definition bap.h:2015
void(* stopped)(struct bt_bap_broadcast_source *source, uint8_t reason)
The Broadcast Source has stopped and none of the streams are ready for audio data.
Definition bap.h:2023
Broadcast Source create parameters.
Definition bap.h:2082
uint16_t iso_interval
ISO interval.
Definition bap.h:2142
uint8_t packing
Broadcast Source packing mode.
Definition bap.h:2099
uint8_t pto
Pre-transmission offset.
Definition bap.h:2133
size_t params_count
The number of parameters in subgroup_params.
Definition bap.h:2084
struct bt_bap_broadcast_source_subgroup_param * params
Array of stream parameters.
Definition bap.h:2087
uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]
Broadcast code.
Definition bap.h:2114
bool encryption
Whether or not to encrypt the streams.
Definition bap.h:2102
uint8_t irc
Immediate Repetition Count.
Definition bap.h:2124
struct bt_bap_qos_cfg * qos
Quality of Service configuration.
Definition bap.h:2090
Broadcast Source stream parameters.
Definition bap.h:2052
uint8_t * data
BIS Codec Specific Configuration.
Definition bap.h:2065
struct bt_bap_stream * stream
Audio stream.
Definition bap.h:2054
size_t data_len
The number of elements in the data array.
Definition bap.h:2062
Broadcast Source subgroup parameters.
Definition bap.h:2070
struct bt_audio_codec_cfg * codec_cfg
Subgroup Codec configuration.
Definition bap.h:2078
size_t params_count
The number of parameters in stream_params.
Definition bap.h:2072
struct bt_bap_broadcast_source_stream_param * params
Array of stream parameters.
Definition bap.h:2075
Structure holding information of audio stream endpoint.
Definition bap.h:699
uint8_t id
The ID of the endpoint.
Definition bap.h:701
bool can_recv
True if the stream associated with the endpoint is able to receive data.
Definition bap.h:716
struct bt_iso_chan * iso_chan
The isochronous channel associated with the endpoint.
Definition bap.h:710
enum bt_bap_ep_state state
The state of the endpoint.
Definition bap.h:704
struct bt_bap_ep * paired_ep
Pointer to paired endpoint if the endpoint is part of a bidirectional CIS, otherwise NULL.
Definition bap.h:721
enum bt_audio_dir dir
Capabilities type.
Definition bap.h:707
bool can_send
True if the stream associated with the endpoint is able to send data.
Definition bap.h:713
const struct bt_bap_qos_cfg_pref * qos_pref
Pointer to the preferred QoS settings associated with the endpoint.
Definition bap.h:724
Audio Stream Quality of Service Preference structure.
Definition bap.h:252
uint32_t pref_pd_min
Preferred minimum Presentation Delay in microseconds.
Definition bap.h:307
uint8_t rtn
Preferred Retransmission Number.
Definition bap.h:274
bool unframed_supported
Unframed PDUs supported.
Definition bap.h:259
uint32_t pd_min
Minimum Presentation Delay in microseconds.
Definition bap.h:290
uint32_t pd_max
Maximum Presentation Delay in microseconds.
Definition bap.h:299
uint8_t phy
Preferred PHY bitfield.
Definition bap.h:267
uint32_t pref_pd_max
Preferred maximum Presentation Delay in microseconds.
Definition bap.h:316
uint16_t latency
Preferred Transport Latency.
Definition bap.h:281
QoS configuration structure.
Definition bap.h:134
uint16_t sdu
Maximum SDU size.
Definition bap.h:179
uint8_t burst_number
Burst number.
Definition bap.h:217
enum bt_bap_qos_cfg_framing framing
QoS Framing.
Definition bap.h:156
uint16_t latency
Maximum Transport Latency.
Definition bap.h:188
uint8_t num_subevents
Number of subevents.
Definition bap.h:226
uint8_t rtn
Retransmission Number.
Definition bap.h:172
uint32_t interval
SDU Interval.
Definition bap.h:196
uint8_t phy
PHY.
Definition bap.h:164
uint16_t max_pdu
Maximum PDU size.
Definition bap.h:210
uint32_t pd
Presentation Delay in microseconds.
Definition bap.h:145
Parameters for bt_bap_scan_delegator_add_src()
Definition bap.h:2454
uint8_t num_subgroups
Number of subgroups.
Definition bap.h:2468
struct bt_bap_bass_subgroup subgroups[0]
Subgroup specific information.
Definition bap.h:2471
enum bt_bap_big_enc_state encrypt_state
The broadcast isochronous group encryption state.
Definition bap.h:2462
bt_addr_le_t addr
Periodic Advertiser Address.
Definition bap.h:2456
uint8_t sid
Advertiser SID.
Definition bap.h:2459
uint32_t broadcast_id
The 24-bit broadcast ID.
Definition bap.h:2465
Struct to hold the Basic Audio Profile Scan Delegator callbacks.
Definition bap.h:599
int(* pa_sync_req)(struct bt_conn *conn, const struct bt_bap_scan_delegator_recv_state *recv_state, bool past_avail, uint16_t pa_interval)
Periodic advertising sync request.
Definition bap.h:628
int(* pa_sync_term_req)(struct bt_conn *conn, const struct bt_bap_scan_delegator_recv_state *recv_state)
Periodic advertising sync termination request.
Definition bap.h:645
void(* recv_state_updated)(struct bt_conn *conn, const struct bt_bap_scan_delegator_recv_state *recv_state)
Receive state updated.
Definition bap.h:609
void(* broadcast_code)(struct bt_conn *conn, const struct bt_bap_scan_delegator_recv_state *recv_state, const uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE])
Broadcast code received.
Definition bap.h:659
int(* bis_sync_req)(struct bt_conn *conn, const struct bt_bap_scan_delegator_recv_state *recv_state, const uint32_t bis_sync_req[0])
Broadcast Isochronous Stream synchronize request.
Definition bap.h:683
void(* scanning_state)(struct bt_conn *conn, bool is_scanning)
Broadcast Assistant scanning state callback.
Definition bap.h:695
Parameters for bt_bap_scan_delegator_mod_src()
Definition bap.h:2490
uint32_t broadcast_id
The 24-bit broadcast ID.
Definition bap.h:2498
struct bt_bap_bass_subgroup subgroups[0]
Subgroup specific information.
Definition bap.h:2509
uint8_t num_subgroups
Number of subgroups.
Definition bap.h:2501
uint8_t src_id
The periodic adverting sync.
Definition bap.h:2492
enum bt_bap_big_enc_state encrypt_state
The broadcast isochronous group encryption state.
Definition bap.h:2495
Represents the Broadcast Audio Scan Service receive state.
Definition bap.h:557
uint8_t src_id
The source ID
Definition bap.h:559
uint8_t bad_code[BT_ISO_BROADCAST_CODE_SIZE]
The bad broadcast code.
Definition bap.h:581
struct bt_bap_bass_subgroup subgroups[0]
Subgroup specific information.
Definition bap.h:591
enum bt_bap_pa_state pa_sync_state
The periodic adverting sync state.
Definition bap.h:568
bt_addr_le_t addr
The Bluetooth address.
Definition bap.h:562
uint8_t adv_sid
The advertising set ID.
Definition bap.h:565
uint8_t num_subgroups
Number of subgroups.
Definition bap.h:584
uint32_t broadcast_id
The 24-bit broadcast ID.
Definition bap.h:574
enum bt_bap_big_enc_state encrypt_state
The broadcast isochronous group encryption state.
Definition bap.h:571
Stream operation.
Definition bap.h:787
void(* recv)(struct bt_bap_stream *stream, const struct bt_iso_recv_info *info, struct net_buf *buf)
Stream audio HCI receive callback.
Definition bap.h:880
void(* enabled)(struct bt_bap_stream *stream)
Stream enabled callback.
Definition bap.h:816
void(* sent)(struct bt_bap_stream *stream)
Stream audio HCI sent callback.
Definition bap.h:897
void(* released)(struct bt_bap_stream *stream)
Stream released callback.
Definition bap.h:845
void(* disabled)(struct bt_bap_stream *stream)
Stream disabled callback.
Definition bap.h:835
void(* configured)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg_pref *pref)
Stream configured callback.
Definition bap.h:797
void(* connected)(struct bt_bap_stream *stream)
Isochronous channel connected callback.
Definition bap.h:912
void(* metadata_updated)(struct bt_bap_stream *stream)
Stream metadata updated callback.
Definition bap.h:826
void(* started)(struct bt_bap_stream *stream)
Stream started callback.
Definition bap.h:856
void(* disconnected)(struct bt_bap_stream *stream, uint8_t reason)
Isochronous channel disconnected callback.
Definition bap.h:926
void(* stopped)(struct bt_bap_stream *stream, uint8_t reason)
Stream stopped callback.
Definition bap.h:866
void(* qos_set)(struct bt_bap_stream *stream)
Stream QoS set callback.
Definition bap.h:807
Basic Audio Profile stream structure.
Definition bap.h:746
void * group
Definition bap.h:772
struct bt_audio_codec_cfg * codec_cfg
Codec Configuration.
Definition bap.h:754
struct bt_bap_qos_cfg * qos
QoS Configuration.
Definition bap.h:757
struct bt_bap_stream_ops * ops
Audio stream operations.
Definition bap.h:760
struct bt_conn * conn
Connection reference.
Definition bap.h:748
struct bt_bap_iso * bap_iso
Definition bap.h:768
struct bt_bap_ep * ep
Endpoint reference.
Definition bap.h:751
void * user_data
Stream user data.
Definition bap.h:775
Unicast Client callback structure.
Definition bap.h:1578
void(* enable)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_enable().
Definition bap.h:1645
void(* discover)(struct bt_conn *conn, int err, enum bt_audio_dir dir)
BAP discovery callback function.
Definition bap.h:1759
void(* qos)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_qos().
Definition bap.h:1632
void(* pac_record)(struct bt_conn *conn, enum bt_audio_dir dir, const struct bt_audio_codec_cap *codec_cap)
Remote Published Audio Capability (PAC) record discovered.
Definition bap.h:1731
void(* disable)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_disable().
Definition bap.h:1688
void(* start)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_start().
Definition bap.h:1660
void(* location)(struct bt_conn *conn, enum bt_audio_dir dir, enum bt_audio_location loc)
Remote Unicast Server Audio Locations.
Definition bap.h:1591
void(* metadata)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_metadata().
Definition bap.h:1701
void(* release)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_release().
Definition bap.h:1714
void(* stop)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_stop().
Definition bap.h:1675
void(* available_contexts)(struct bt_conn *conn, enum bt_audio_context snk_ctx, enum bt_audio_context src_ctx)
Remote Unicast Server Available Contexts.
Definition bap.h:1605
void(* endpoint)(struct bt_conn *conn, enum bt_audio_dir dir, struct bt_bap_ep *ep)
Remote Audio Stream Endpoint (ASE) discovered.
Definition bap.h:1745
void(* config)(struct bt_bap_stream *stream, enum bt_bap_ascs_rsp_code rsp_code, enum bt_bap_ascs_reason reason)
Callback function for bt_bap_stream_config() and bt_bap_stream_reconfig().
Definition bap.h:1617
Parameters for the creating unicast groups with bt_bap_unicast_group_create()
Definition bap.h:1460
uint16_t iso_interval
ISO interval.
Definition bap.h:1504
uint8_t packing
Unicast Group packing mode.
Definition bap.h:1474
uint8_t p_to_c_ft
Peripheral to Central flush timeout.
Definition bap.h:1495
uint8_t c_to_p_ft
Central to Peripheral flush timeout.
Definition bap.h:1485
size_t params_count
The number of parameters in params.
Definition bap.h:1462
struct bt_bap_unicast_group_stream_pair_param * params
Array of stream parameters.
Definition bap.h:1465
Parameter struct for the unicast group functions.
Definition bap.h:1451
struct bt_bap_unicast_group_stream_param * rx_param
Pointer to a receiving stream parameters.
Definition bap.h:1453
struct bt_bap_unicast_group_stream_param * tx_param
Pointer to a transmitting stream parameters.
Definition bap.h:1456
Parameter struct for each stream in the unicast group.
Definition bap.h:1437
struct bt_bap_qos_cfg * qos
The QoS settings for the stream object.
Definition bap.h:1442
struct bt_bap_stream * stream
Pointer to a stream object.
Definition bap.h:1439
Unicast Server callback structure.
Definition bap.h:1194
int(* disable)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp)
Stream Disable request callback.
Definition bap.h:1309
int(* qos)(struct bt_bap_stream *stream, const struct bt_bap_qos_cfg *qos, struct bt_bap_ascs_rsp *rsp)
Stream QoS request callback.
Definition bap.h:1250
int(* start)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp)
Stream Start request callback.
Definition bap.h:1280
int(* metadata)(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len, struct bt_bap_ascs_rsp *rsp)
Stream Metadata update request callback.
Definition bap.h:1295
int(* enable)(struct bt_bap_stream *stream, const uint8_t meta[], size_t meta_len, struct bt_bap_ascs_rsp *rsp)
Stream Enable request callback.
Definition bap.h:1266
int(* reconfig)(struct bt_bap_stream *stream, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp)
Stream reconfig request callback.
Definition bap.h:1233
int(* stop)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp)
Stream Stop callback.
Definition bap.h:1322
int(* release)(struct bt_bap_stream *stream, struct bt_bap_ascs_rsp *rsp)
Stream release callback.
Definition bap.h:1336
int(* config)(struct bt_conn *conn, const struct bt_bap_ep *ep, enum bt_audio_dir dir, const struct bt_audio_codec_cfg *codec_cfg, struct bt_bap_stream **stream, struct bt_bap_qos_cfg_pref *const pref, struct bt_bap_ascs_rsp *rsp)
Endpoint config request callback.
Definition bap.h:1213
Structure for registering Unicast Server.
Definition bap.h:930
uint8_t snk_cnt
Sink Count to register.
Definition bap.h:936
uint8_t src_cnt
Source Count to register.
Definition bap.h:942
Bluetooth data.
Definition bluetooth.h:456
Broadcast Isochronous Group (BIG) information.
Definition iso.h:628
ISO Channel structure.
Definition iso.h:187
ISO Meta Data structure for received ISO packets.
Definition iso.h:337
ISO Meta Data structure for transmitted ISO packets.
Definition iso.h:353
LE advertisement and scan response packet information.
Definition bluetooth.h:2206
Group structure.
Definition grp.h:18
Simple network buffer representation.
Definition net_buf.h:89
Network buffer representation.
Definition net_buf.h:1006
Macro utilities.