nimble/host: prepare for Broadcast sink
This patch renames files, functions and configs from `broadcaster` to
`broadcast source` so new `broadcast sink` files and functions can be
created. Adds `BLE_ISO_BROADCAST_SINK` sysconfig
diff --git a/.github/test_build_apps_syscfg.yml b/.github/test_build_apps_syscfg.yml
index 44bcb5e..faafa8a 100644
--- a/.github/test_build_apps_syscfg.yml
+++ b/.github/test_build_apps_syscfg.yml
@@ -27,7 +27,7 @@
BLE_PERIODIC_ADV_SYNC_BIGINFO_REPORTS: 1
BLE_ISO: 1
BLE_ISO_TEST: 1
- BLE_ISO_BROADCASTER: 1
+ BLE_ISO_BROADCAST_SOURCE: 1
BLE_HCI_VS: 1
BLE_POWER_CONTROL: 1
BLE_CONN_SUBRATING: 1
diff --git a/apps/auracast/syscfg.yml b/apps/auracast/syscfg.yml
index 26dbc8d..e67af5a 100644
--- a/apps/auracast/syscfg.yml
+++ b/apps/auracast/syscfg.yml
@@ -55,7 +55,7 @@
BLE_VERSION: 54
BLE_ISO: 1
- BLE_ISO_BROADCASTER: 1
+ BLE_ISO_BROADCAST_SOURCE: 1
BLE_MAX_BIG: 1
BLE_MAX_BIS: 2
diff --git a/apps/btshell/src/btshell.h b/apps/btshell/src/btshell.h
index d7beb14..83daded 100644
--- a/apps/btshell/src/btshell.h
+++ b/apps/btshell/src/btshell.h
@@ -28,8 +28,8 @@
#include "host/ble_gatt.h"
#include "host/ble_gap.h"
-#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
-#include "host/ble_audio_broadcast.h"
+#if (MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE))
+#include "host/ble_audio_broadcast_source.h"
#endif
#ifdef __cplusplus
@@ -191,7 +191,7 @@
int btshell_l2cap_reconfig(uint16_t conn_handle, uint16_t mtu,
uint8_t num, uint8_t idxs[]);
-#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+#if (MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE))
int btshell_broadcast_base_add(uint8_t adv_instance, uint32_t presentation_delay);
int btshell_broadcast_big_sub_add(uint8_t adv_instance,
uint8_t codec_fmt,
diff --git a/apps/btshell/src/cmd.c b/apps/btshell/src/cmd.c
index f23c4b9..ff8bae8 100644
--- a/apps/btshell/src/cmd.c
+++ b/apps/btshell/src/cmd.c
@@ -4206,7 +4206,7 @@
#endif
#endif
-#if MYNEWT_VAL(BLE_ISO_BROADCASTER)
+#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
#if MYNEWT_VAL(SHELL_CMD_HELP)
static const struct shell_param leaudio_base_add_params[] = {
{"adv_instance", "Advertising instance, usage: =<UINT8>"},
diff --git a/apps/btshell/src/cmd_leaudio.c b/apps/btshell/src/cmd_leaudio.c
index bdbc825..fc4fcd1 100644
--- a/apps/btshell/src/cmd_leaudio.c
+++ b/apps/btshell/src/cmd_leaudio.c
@@ -17,13 +17,13 @@
* under the License.
*/
-#include "host/ble_audio_broadcast.h"
+#include "host/ble_audio_broadcast_source.h"
#include "cmd_leaudio.h"
#include "btshell.h"
#include "console/console.h"
#include "errno.h"
-#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+#if (MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE))
int
cmd_leaudio_base_add(int argc, char **argv)
{
diff --git a/apps/btshell/src/main.c b/apps/btshell/src/main.c
index 2783806..0f87b5c 100644
--- a/apps/btshell/src/main.c
+++ b/apps/btshell/src/main.c
@@ -42,7 +42,7 @@
#include "host/ble_store.h"
#include "host/ble_sm.h"
#include "host/ble_audio_common.h"
-#include "host/ble_audio_broadcast.h"
+#include "host/ble_audio_broadcast_source.h"
#include "host/util/util.h"
/* Mandatory services. */
@@ -130,7 +130,7 @@
struct ble_sm_sc_oob_data oob_data_local;
struct ble_sm_sc_oob_data oob_data_remote;
-#if MYNEWT_VAL(BLE_ISO_BROADCASTER)
+#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
static struct {struct ble_audio_base *base; uint8_t adv_instance;}
btshell_base_list[MYNEWT_VAL(BLE_MAX_BIG)];
@@ -2749,7 +2749,7 @@
return default_own_addr_type;
}
-#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+#if (MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE))
static int
btshell_base_find_free(void)
{
@@ -3068,7 +3068,7 @@
"btshell_coc_conn_pool");
assert(rc == 0);
#endif
-#if (MYNEWT_VAL(BLE_ISO_BROADCASTER))
+#if (MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE))
rc = os_mempool_init(&btshell_base_pool, MYNEWT_VAL(BLE_MAX_BIG),
sizeof(struct ble_audio_base),
btshell_base_mem,
diff --git a/apps/leaudio_broadcaster/src/main.c b/apps/leaudio_broadcaster/src/main.c
index 5ea818e..a4e7bf9 100644
--- a/apps/leaudio_broadcaster/src/main.c
+++ b/apps/leaudio_broadcaster/src/main.c
@@ -24,7 +24,7 @@
#include "host/ble_hs.h"
#include "host/util/util.h"
-#include "host/ble_audio_broadcast.h"
+#include "host/ble_audio_broadcast_source.h"
#include "host/ble_audio_common.h"
#include "host/ble_iso.h"
diff --git a/apps/leaudio_broadcaster/syscfg.yml b/apps/leaudio_broadcaster/syscfg.yml
index 7fc1873..bed16f0 100644
--- a/apps/leaudio_broadcaster/syscfg.yml
+++ b/apps/leaudio_broadcaster/syscfg.yml
@@ -53,7 +53,7 @@
BLE_VERSION: 54
BLE_ISO: 1
- BLE_ISO_BROADCASTER: 1
+ BLE_ISO_BROADCAST_SOURCE: 1
BLE_MAX_BIG: 1
BLE_MAX_BIS: 2
diff --git a/nimble/controller/syscfg.yml b/nimble/controller/syscfg.yml
index 22a4c1b..c55107b 100644
--- a/nimble/controller/syscfg.yml
+++ b/nimble/controller/syscfg.yml
@@ -483,7 +483,7 @@
Enable support for Isochronous Broadcasting state.
restrictions:
- BLE_LL_ISO if 1
- value: MYNEWT_VAL(BLE_ISO_BROADCASTER)
+ value: MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
state: experimental
BLE_LL_ISO_HCI_FEEDBACK_INTERVAL_MS:
description: >
diff --git a/nimble/host/include/host/ble_audio_broadcast.h b/nimble/host/include/host/ble_audio_broadcast_source.h
similarity index 98%
rename from nimble/host/include/host/ble_audio_broadcast.h
rename to nimble/host/include/host/ble_audio_broadcast_source.h
index 13c1743..605aa5b 100644
--- a/nimble/host/include/host/ble_audio_broadcast.h
+++ b/nimble/host/include/host/ble_audio_broadcast_source.h
@@ -17,8 +17,8 @@
* under the License.
*/
-#ifndef H_BLE_AUDIO_BROADCAST_
-#define H_BLE_AUDIO_BROADCAST_
+#ifndef H_BLE_AUDIO_BROADCAST_SOURCE_
+#define H_BLE_AUDIO_BROADCAST_SOURCE_
/**
* @file ble_audio_broadcast.h
diff --git a/nimble/host/include/host/ble_audio_common.h b/nimble/host/include/host/ble_audio_common.h
index 43f88ea..d5e0afb 100644
--- a/nimble/host/include/host/ble_audio_common.h
+++ b/nimble/host/include/host/ble_audio_common.h
@@ -47,6 +47,7 @@
__VA_ARGS__)
#define BLE_BROADCAST_AUDIO_ANNOUNCEMENT_SVC_UUID 0x1852
+#define BLE_BROADCAST_PUBLIC_BROADCAST_ANNOUNCEMENT_SVC_UUID 0x1856
#define BLE_AUDIO_SAMPLING_RATE_8000_HZ 0x01
#define BLE_AUDIO_SAMPLING_RATE_11025_HZ 0x02
diff --git a/nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h b/nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h
index 7a31dfc..560adb8 100644
--- a/nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h
+++ b/nimble/host/services/auracast/include/services/auracast/ble_svc_auracast.h
@@ -20,7 +20,7 @@
#include <stdint.h>
#include "host/ble_gap.h"
#include "host/ble_audio_common.h"
-#include "host/ble_audio_broadcast.h"
+#include "host/ble_audio_broadcast_source.h"
struct ble_svc_auracast_create_params {
/** Broadcast Audio Source Endpoint */
diff --git a/nimble/host/services/auracast/src/ble_svc_auracast.c b/nimble/host/services/auracast/src/ble_svc_auracast.c
index 814035b..b1bc7d3 100644
--- a/nimble/host/services/auracast/src/ble_svc_auracast.c
+++ b/nimble/host/services/auracast/src/ble_svc_auracast.c
@@ -21,7 +21,7 @@
#include "host/ble_gap.h"
#include "host/ble_hs.h"
-#include "host/ble_audio_broadcast.h"
+#include "host/ble_audio_broadcast_source.h"
#include "services/auracast/ble_svc_auracast.h"
int
@@ -61,7 +61,8 @@
auracast_svc_data[data_offset] = BLE_HS_ADV_TYPE_SVC_DATA_UUID16;
data_offset++;
- put_le16(&auracast_svc_data[data_offset], 0x1856);
+ put_le16(&auracast_svc_data[data_offset],
+ BLE_BROADCAST_PUBLIC_BROADCAST_ANNOUNCEMENT_SVC_UUID);
data_offset += 2;
auracast_svc_data[data_offset] = features;
data_offset++;
diff --git a/nimble/host/src/ble_audio_broadcast.c b/nimble/host/src/ble_audio_broadcast_source.c
similarity index 98%
rename from nimble/host/src/ble_audio_broadcast.c
rename to nimble/host/src/ble_audio_broadcast_source.c
index b3ec29c..6a3aebf 100644
--- a/nimble/host/src/ble_audio_broadcast.c
+++ b/nimble/host/src/ble_audio_broadcast_source.c
@@ -18,11 +18,11 @@
*/
#include "host/ble_uuid.h"
-#include "host/ble_audio_broadcast.h"
+#include "host/ble_audio_broadcast_source.h"
#include "os/util.h"
-#if MYNEWT_VAL(BLE_ISO_BROADCASTER)
+#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
struct ble_audio_broadcast {
SLIST_ENTRY(ble_audio_broadcast) next;
uint8_t adv_instance;
diff --git a/nimble/host/src/ble_hs.c b/nimble/host/src/ble_hs.c
index 41bf5e2..8017221 100644
--- a/nimble/host/src/ble_hs.c
+++ b/nimble/host/src/ble_hs.c
@@ -24,7 +24,7 @@
#include "syscfg/syscfg.h"
#include "stats/stats.h"
#include "host/ble_hs.h"
-#include "host/ble_audio_broadcast.h"
+#include "host/ble_audio_broadcast_source.h"
#include "ble_hs_priv.h"
#include "nimble/nimble_npl.h"
#ifndef MYNEWT
@@ -756,7 +756,7 @@
#if MYNEWT_VAL(BLE_ISO)
rc = ble_iso_init();
SYSINIT_PANIC_ASSERT(rc == 0);
-#if MYNEWT_VAL(BLE_ISO_BROADCASTER)
+#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
rc = ble_audio_broadcast_init();
SYSINIT_PANIC_ASSERT(rc == 0);
#endif
diff --git a/nimble/host/src/ble_hs_hci_evt.c b/nimble/host/src/ble_hs_hci_evt.c
index 49a0993..e4fdad4 100644
--- a/nimble/host/src/ble_hs_hci_evt.c
+++ b/nimble/host/src/ble_hs_hci_evt.c
@@ -65,7 +65,7 @@
static ble_hs_hci_evt_le_fn ble_hs_hci_evt_le_periodic_adv_sync_lost;
static ble_hs_hci_evt_le_fn ble_hs_hci_evt_le_scan_req_rcvd;
static ble_hs_hci_evt_le_fn ble_hs_hci_evt_le_periodic_adv_sync_transfer;
-#if MYNEWT_VAL(BLE_ISO_BROADCASTER)
+#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
static ble_hs_hci_evt_le_fn ble_hs_hci_evt_le_create_big_complete;
static ble_hs_hci_evt_le_fn ble_hs_hci_evt_le_terminate_big_complete;
#endif
@@ -137,7 +137,7 @@
[BLE_HCI_LE_SUBEV_ADV_SET_TERMINATED] = ble_hs_hci_evt_le_adv_set_terminated,
[BLE_HCI_LE_SUBEV_SCAN_REQ_RCVD] = ble_hs_hci_evt_le_scan_req_rcvd,
[BLE_HCI_LE_SUBEV_PERIODIC_ADV_SYNC_TRANSFER] = ble_hs_hci_evt_le_periodic_adv_sync_transfer,
-#if MYNEWT_VAL(BLE_ISO_BROADCASTER)
+#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
[BLE_HCI_LE_SUBEV_CREATE_BIG_COMPLETE] =
ble_hs_hci_evt_le_create_big_complete,
[BLE_HCI_LE_SUBEV_TERMINATE_BIG_COMPLETE] =
@@ -747,7 +747,7 @@
return 0;
}
-#if MYNEWT_VAL(BLE_ISO_BROADCASTER)
+#if MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE)
static int
ble_hs_hci_evt_le_create_big_complete(uint8_t subevent, const void *data,
unsigned int len)
diff --git a/nimble/host/syscfg.yml b/nimble/host/syscfg.yml
index 79a027d..faaaa00 100644
--- a/nimble/host/syscfg.yml
+++ b/nimble/host/syscfg.yml
@@ -498,14 +498,14 @@
Number of available BIGs
value: 'MYNEWT_VAL_BLE_MULTI_ADV_INSTANCES'
restrictions:
- - 'BLE_ISO_BROADCASTER if 0'
+ - 'BLE_ISO_BROADCAST_SOURCE if 0'
BLE_MAX_BIS:
description: >
Number of supported BISes
value: 4
restrictions:
- - 'BLE_ISO_BROADCASTER if 0'
+ - 'BLE_ISO_BROADCAST_SOURCE if 0'
### Log settings.
diff --git a/nimble/syscfg.yml b/nimble/syscfg.yml
index 68432e2..47bd266 100644
--- a/nimble/syscfg.yml
+++ b/nimble/syscfg.yml
@@ -95,9 +95,15 @@
value: 0
restrictions:
- '(BLE_VERSION >= 52) if 1'
- BLE_ISO_BROADCASTER:
+ BLE_ISO_BROADCAST_SOURCE:
description: >
- This enables LE Audio Broadcaster feature
+ This enables LE Audio Broadcast Source feature
+ value: 0
+ restrictions:
+ - '(BLE_VERSION >= 52) if 1'
+ BLE_ISO_BROADCAST_SINK:
+ description: >
+ This enables LE Audio Broadcast Sink feature
value: 0
restrictions:
- '(BLE_VERSION >= 52) if 1'
diff --git a/porting/examples/linux/include/syscfg/syscfg.h b/porting/examples/linux/include/syscfg/syscfg.h
index 9489ae1..86da373 100644
--- a/porting/examples/linux/include/syscfg/syscfg.h
+++ b/porting/examples/linux/include/syscfg/syscfg.h
@@ -458,8 +458,12 @@
#define MYNEWT_VAL_BLE_ISO (0)
#endif
-#ifndef MYNEWT_VAL_BLE_ISO_BROADCASTER
-#define MYNEWT_VAL_BLE_ISO_BROADCASTER (0)
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SINK
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SINK (0)
+#endif
+
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE (0)
#endif
#ifndef MYNEWT_VAL_BLE_ISO_TEST
diff --git a/porting/examples/linux_blemesh/include/syscfg/syscfg.h b/porting/examples/linux_blemesh/include/syscfg/syscfg.h
index 64ed645..c44af9c 100644
--- a/porting/examples/linux_blemesh/include/syscfg/syscfg.h
+++ b/porting/examples/linux_blemesh/include/syscfg/syscfg.h
@@ -459,8 +459,12 @@
#define MYNEWT_VAL_BLE_ISO (0)
#endif
-#ifndef MYNEWT_VAL_BLE_ISO_BROADCASTER
-#define MYNEWT_VAL_BLE_ISO_BROADCASTER (0)
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SINK
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SINK (0)
+#endif
+
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE (0)
#endif
#ifndef MYNEWT_VAL_BLE_ISO_TEST
diff --git a/porting/examples/nuttx/include/syscfg/syscfg.h b/porting/examples/nuttx/include/syscfg/syscfg.h
index 74e67da..d087c57 100644
--- a/porting/examples/nuttx/include/syscfg/syscfg.h
+++ b/porting/examples/nuttx/include/syscfg/syscfg.h
@@ -458,8 +458,12 @@
#define MYNEWT_VAL_BLE_ISO (0)
#endif
-#ifndef MYNEWT_VAL_BLE_ISO_BROADCASTER
-#define MYNEWT_VAL_BLE_ISO_BROADCASTER (0)
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SINK
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SINK (0)
+#endif
+
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE (0)
#endif
#ifndef MYNEWT_VAL_BLE_ISO_TEST
diff --git a/porting/nimble/include/syscfg/syscfg.h b/porting/nimble/include/syscfg/syscfg.h
index b53057a..4910e54 100644
--- a/porting/nimble/include/syscfg/syscfg.h
+++ b/porting/nimble/include/syscfg/syscfg.h
@@ -457,8 +457,12 @@
#define MYNEWT_VAL_BLE_ISO (0)
#endif
-#ifndef MYNEWT_VAL_BLE_ISO_BROADCASTER
-#define MYNEWT_VAL_BLE_ISO_BROADCASTER (0)
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SINK
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SINK (0)
+#endif
+
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE (0)
#endif
#ifndef MYNEWT_VAL_BLE_ISO_TEST
diff --git a/porting/npl/riot/include/syscfg/syscfg.h b/porting/npl/riot/include/syscfg/syscfg.h
index a4ba6c3..b70ba2b 100644
--- a/porting/npl/riot/include/syscfg/syscfg.h
+++ b/porting/npl/riot/include/syscfg/syscfg.h
@@ -860,8 +860,12 @@
#define MYNEWT_VAL_BLE_ISO (0)
#endif
-#ifndef MYNEWT_VAL_BLE_ISO_BROADCASTER
-#define MYNEWT_VAL_BLE_ISO_BROADCASTER (0)
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SINK
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SINK (0)
+#endif
+
+#ifndef MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE
+#define MYNEWT_VAL_BLE_ISO_BROADCAST_SOURCE (0)
#endif
#ifndef MYNEWT_VAL_BLE_ISO_TEST
@@ -1201,7 +1205,7 @@
#define MYNEWT_VAL_BLE_LL_ISO (0)
#endif
-/* Value copied from BLE_ISO_BROADCASTER */
+/* Value copied from BLE_LL_ISO_BROADCASTER */
#ifndef MYNEWT_VAL_BLE_LL_ISO_BROADCASTER
#define MYNEWT_VAL_BLE_LL_ISO_BROADCASTER (0)
#endif
diff --git a/targets/nordic_pca10095_net-blehci_broadcaster/syscfg.yml b/targets/nordic_pca10095_net-blehci_broadcaster/syscfg.yml
index 22fd743..d3255ff 100644
--- a/targets/nordic_pca10095_net-blehci_broadcaster/syscfg.yml
+++ b/targets/nordic_pca10095_net-blehci_broadcaster/syscfg.yml
@@ -42,6 +42,6 @@
BLE_VERSION: 54
BLE_ISO: 1
- BLE_ISO_BROADCASTER: 1
+ BLE_ISO_BROADCAST_SOURCE: 1
BLE_MAX_BIG: 1
BLE_MAX_BIS: 2