This is an automated email from the ASF dual-hosted git repository.
sjanc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-nimble.git
The following commit(s) were added to refs/heads/master by this push:
new 0841f3e35 nimble/audio: Add explicit init for LE Audio common code
0841f3e35 is described below
commit 0841f3e35734f54ec0f9fb7c4d5b71ca0b1da02f
Author: Szymon Janc <[email protected]>
AuthorDate: Mon Jul 6 17:10:23 2026 +0200
nimble/audio: Add explicit init for LE Audio common code
This allows to properly unit test code.
---
nimble/host/audio/pkg.yml | 3 +++
nimble/host/audio/src/ble_audio.c | 9 +++++++--
nimble/host/audio/syscfg.yml | 5 +++++
3 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/nimble/host/audio/pkg.yml b/nimble/host/audio/pkg.yml
index 43385d271..9dc6495ca 100644
--- a/nimble/host/audio/pkg.yml
+++ b/nimble/host/audio/pkg.yml
@@ -37,6 +37,9 @@ pkg.deps.BLE_AUDIO_BROADCAST_SINK:
pkg.deps.BLE_AUDIO_SCAN_DELEGATOR:
- nimble/host/audio/services/bass
+pkg.init:
+ ble_audio_init: 'MYNEWT_VAL(BLE_AUDIO_SYSINIT_STAGE)'
+
pkg.init.BLE_AUDIO_BROADCAST_SINK:
ble_audio_broadcast_sink_init:
'MYNEWT_VAL(BLE_AUDIO_BROADCAST_SINK_SYSINIT_STAGE)'
diff --git a/nimble/host/audio/src/ble_audio.c
b/nimble/host/audio/src/ble_audio.c
index f601a07fb..ee3758da0 100644
--- a/nimble/host/audio/src/ble_audio.c
+++ b/nimble/host/audio/src/ble_audio.c
@@ -26,8 +26,7 @@
#include "ble_audio_priv.h"
static struct ble_gap_event_listener ble_audio_gap_event_listener;
-static SLIST_HEAD(, ble_audio_event_listener) ble_audio_event_listener_list =
- SLIST_HEAD_INITIALIZER(ble_audio_event_listener_list);
+static SLIST_HEAD(, ble_audio_event_listener) ble_audio_event_listener_list;
struct ble_audio_adv_parse_broadcast_announcement_data {
struct ble_audio_event event;
@@ -527,3 +526,9 @@ ble_audio_base_bis_iter(struct ble_audio_base_iter
*bis_iter,
return 0;
}
+
+void
+ble_audio_init(void)
+{
+ SLIST_INIT(&ble_audio_event_listener_list);
+}
diff --git a/nimble/host/audio/syscfg.yml b/nimble/host/audio/syscfg.yml
index a5c8907f6..bdcf82d06 100644
--- a/nimble/host/audio/syscfg.yml
+++ b/nimble/host/audio/syscfg.yml
@@ -35,6 +35,11 @@ syscfg.defs:
This option enables BLE Audio Scan Delegator support.
value: 0
+ BLE_AUDIO_SYSINIT_STAGE:
+ description: >
+ Primary sysinit stage for BLE Audio.
+ value: 300
+
syscfg.defs.BLE_AUDIO_BROADCAST_SINK:
BLE_AUDIO_BROADCAST_SINK_SYSINIT_STAGE:
description: >