7#ifndef _BROADCAST_SOURCE_H_
8#define _BROADCAST_SOURCE_H_
10#include <zephyr/bluetooth/audio/cap.h>
11#include <zephyr/bluetooth/audio/bap_lc3_preset.h>
14#if CONFIG_BT_AUDIO_BROADCAST_CONFIGURABLE
15#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
16 BT_BAP_LC3_PRESET_CONFIGURABLE( \
17 BT_AUDIO_LOCATION_FRONT_LEFT | BT_AUDIO_LOCATION_FRONT_RIGHT, \
18 BT_AUDIO_CONTEXT_TYPE_MEDIA, CONFIG_BT_AUDIO_BITRATE_BROADCAST_SRC)
20#elif CONFIG_BT_BAP_BROADCAST_16_2_1
21#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
22 BT_BAP_LC3_BROADCAST_PRESET_16_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \
23 BT_AUDIO_LOCATION_FRONT_RIGHT, \
24 BT_AUDIO_CONTEXT_TYPE_MEDIA)
26#elif CONFIG_BT_BAP_BROADCAST_16_2_2
27#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
28 BT_BAP_LC3_BROADCAST_PRESET_16_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \
29 BT_AUDIO_LOCATION_FRONT_RIGHT, \
30 BT_AUDIO_CONTEXT_TYPE_MEDIA)
32#elif CONFIG_BT_BAP_BROADCAST_24_2_1
33#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
34 BT_BAP_LC3_BROADCAST_PRESET_24_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \
35 BT_AUDIO_LOCATION_FRONT_RIGHT, \
36 BT_AUDIO_CONTEXT_TYPE_MEDIA)
38#elif CONFIG_BT_BAP_BROADCAST_24_2_2
39#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
40 BT_BAP_LC3_BROADCAST_PRESET_24_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \
41 BT_AUDIO_LOCATION_FRONT_RIGHT, \
42 BT_AUDIO_CONTEXT_TYPE_MEDIA)
44#elif CONFIG_BT_BAP_BROADCAST_48_2_1
45#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
46 BT_BAP_LC3_BROADCAST_PRESET_48_2_1(BT_AUDIO_LOCATION_FRONT_LEFT | \
47 BT_AUDIO_LOCATION_FRONT_RIGHT, \
48 BT_AUDIO_CONTEXT_TYPE_MEDIA)
49#elif CONFIG_BT_BAP_BROADCAST_48_2_2
50#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
51 BT_BAP_LC3_BROADCAST_PRESET_48_2_2(BT_AUDIO_LOCATION_FRONT_LEFT | \
52 BT_AUDIO_LOCATION_FRONT_RIGHT, \
53 BT_AUDIO_CONTEXT_TYPE_MEDIA)
55#elif CONFIG_BT_BAP_BROADCAST_48_4_1
56#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
57 BT_BAP_LC3_BROADCAST_PRESET_48_4_1(BT_AUDIO_LOCATION_FRONT_LEFT | \
58 BT_AUDIO_LOCATION_FRONT_RIGHT, \
59 BT_AUDIO_CONTEXT_TYPE_MEDIA)
61#elif CONFIG_BT_BAP_BROADCAST_48_4_2
62#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
63 BT_BAP_LC3_BROADCAST_PRESET_48_4_2(BT_AUDIO_LOCATION_FRONT_LEFT | \
64 BT_AUDIO_LOCATION_FRONT_RIGHT, \
65 BT_AUDIO_CONTEXT_TYPE_MEDIA)
67#elif CONFIG_BT_BAP_BROADCAST_48_6_1
68#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
69 BT_BAP_LC3_BROADCAST_PRESET_48_6_1(BT_AUDIO_LOCATION_FRONT_LEFT | \
70 BT_AUDIO_LOCATION_FRONT_RIGHT, \
71 BT_AUDIO_CONTEXT_TYPE_MEDIA)
73#elif CONFIG_BT_BAP_BROADCAST_48_6_2
74#define BT_BAP_LC3_BROADCAST_PRESET_NRF5340_AUDIO \
75 BT_BAP_LC3_BROADCAST_PRESET_48_6_2(BT_AUDIO_LOCATION_FRONT_LEFT | \
76 BT_AUDIO_LOCATION_FRONT_RIGHT, \
77 BT_AUDIO_CONTEXT_TYPE_MEDIA)
79#error Unsupported LC3 codec preset for broadcast
85#define BROADCAST_SOURCE_PBA_HEADER_SIZE (BT_UUID_SIZE_16 + (sizeof(uint8_t) * 2))
87#define BROADCAST_SOURCE_ADV_NAME_MAX (32)
88#define BROADCAST_SOURCE_ADV_ID_START (BT_UUID_SIZE_16)
128 uint8_t pba_metadata_vacant_cnt;
160 struct bt_data *ext_adv_buf,
size_t ext_adv_buf_vacant);
175 struct bt_data *per_adv_buf,
size_t per_adv_buf_vacant);
int broadcast_source_enable(struct broadcast_source_big const *const broadcast_param, uint8_t big_index)
Enable the LE Audio broadcast (BIS) source.
int broadcast_source_per_adv_populate(uint8_t big_index, struct broadcast_source_per_adv_data *per_adv_data, struct bt_data *per_adv_buf, size_t per_adv_buf_vacant)
Populate the periodic advertising data buffer.
int broadcast_source_send(uint8_t big_index, uint8_t subgroup_index, struct le_audio_encoded_audio enc_audio)
Broadcast the Bluetooth LE Audio data.
int broadcast_source_id_get(uint8_t big_index, uint32_t *broadcast_id)
Get the broadcast ID for the given Broadcast Isochronous Group (BIG).
int broadcast_source_disable(uint8_t big_index)
Disable the LE Audio broadcast (BIS) source.
int broadcast_source_start(uint8_t big_index, struct bt_le_ext_adv *ext_adv)
Start the Bluetooth LE Audio broadcast (BIS) source.
bool broadcast_source_is_streaming(uint8_t big_index)
Check if the broadcast source is streaming.
#define BROADCAST_SOURCE_ADV_NAME_MAX
Definition broadcast_source.h:87
int broadcast_source_ext_adv_populate(uint8_t big_index, bool fixed_id, uint32_t broadcast_id, struct broadcast_source_ext_adv_data *ext_adv_data, struct bt_data *ext_adv_buf, size_t ext_adv_buf_vacant)
Populate the extended advertising data buffer.
int broadcast_source_stop(uint8_t big_index)
Stop the Bluetooth LE Audio broadcast (BIS) source.
void broadcast_source_default_create(struct broadcast_source_big *broadcast_param)
Create a set up for a default broadcaster.
uint8_t packing
Definition broadcast_source.h:101
bool fixed_id
Definition broadcast_source.h:106
char broadcast_name[(32)+1]
Definition broadcast_source.h:104
bool encryption
Definition broadcast_source.h:102
uint8_t num_subgroups
Definition broadcast_source.h:100
uint32_t broadcast_id
Definition broadcast_source.h:107
uint8_t broadcast_code[BT_ISO_BROADCAST_CODE_SIZE]
Definition broadcast_source.h:103
struct subgroup_config * subgroups
Definition broadcast_source.h:99
char adv_name[CONFIG_BT_DEVICE_NAME_MAX+1]
Definition broadcast_source.h:105
Definition broadcast_source.h:98
uint8_t brdcst_appearance_buf[(sizeof(uint8_t) *2)]
Definition broadcast_source.h:121
uint8_t brdcst_name_buf[(32)]
Definition broadcast_source.h:124
uint8_t brdcst_id_buf[BT_UUID_SIZE_16+BT_AUDIO_BROADCAST_ID_SIZE]
Definition broadcast_source.h:118
struct net_buf_simple * uuid_buf
Definition broadcast_source.h:115
Advertising data for broadcast source.
Definition broadcast_source.h:113
struct net_buf_simple * base_buf
Definition broadcast_source.h:140
Periodic advertising data for broadcast source.
Definition broadcast_source.h:138
Encoded audio data and information.
Definition le_audio.h:63
enum bt_audio_context context
Definition broadcast_source.h:93
enum bt_audio_location * location
Definition broadcast_source.h:91
uint8_t num_bises
Definition broadcast_source.h:92
struct bt_bap_lc3_preset group_lc3_preset
Definition broadcast_source.h:94
char * preset_name
Definition broadcast_source.h:95
Definition broadcast_source.h:90