Skip to content

Commit

Permalink
host: refactor BLE Audio
Browse files Browse the repository at this point in the history
This patch refactors BLE Audio library to conform to new directory tree
introduced in a979570.

LE Audio related files present in host/include, host/src and
host/services were moved to corelated folders in host/audio.

Experimental system config BLE_AUDIO enabling LE Audio feature was introduced.

Naming convention for BLE Audio functions, structures and files was
unified - replaced `bcst` shorthand with `broadcast`. For example,
ble_audio_pub_bcst_announcement_feat was renamed to
ble_audio_pub_broadcast_announcement_feat.

Contents of host/include/ble_audio_common.h was incorporated into
host/audio/include/audio/ble_audio.h.

Apps and Auracast service were adjusted to new config and include paths.
  • Loading branch information
KKopyscinski committed Mar 1, 2024
1 parent ebe1e78 commit 7f1df8a
Show file tree
Hide file tree
Showing 25 changed files with 336 additions and 359 deletions.
1 change: 1 addition & 0 deletions .github/test_build_apps_syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ syscfg.vals:
BLE_PERIODIC_ADV_SYNC_BIGINFO_REPORTS: 1
BLE_ISO: 1
BLE_ISO_TEST: 1
BLE_AUDIO: 1
BLE_ISO_BROADCAST_SOURCE: 1
BLE_HCI_VS: 1
BLE_POWER_CONTROL: 1
Expand Down
2 changes: 1 addition & 1 deletion apps/auracast/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ pkg.deps:
- nimble/host/util
- nimble/host/services/gap
- nimble/host/store/config
- nimble/host/audio/services/auracast
- "@apache-mynewt-core/kernel/os"
- "@apache-mynewt-core/sys/console"
- "@apache-mynewt-core/sys/log"
- "@apache-mynewt-core/sys/stats"
- "@apache-mynewt-core/sys/sysinit"
- "@apache-mynewt-core/sys/id"
- "@apache-mynewt-nimble/nimble/host/services/auracast"
4 changes: 3 additions & 1 deletion apps/auracast/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,6 @@ syscfg.vals:
BLE_MAX_BIG: 1
BLE_MAX_BIS: 2

BLE_PHY_NRF52_HEADERMASK_WORKAROUND: 1
BLE_PHY_NRF52_HEADERMASK_WORKAROUND: 1

BLE_AUDIO: 1
3 changes: 3 additions & 0 deletions apps/btshell/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,8 @@ pkg.deps:
- nimble/host/store/config
- nimble/host/util

pkg.deps.BLE_AUDIO:
- nimble/host/audio

pkg.deps.BTSHELL_ANS:
- nimble/host/services/ans
2 changes: 1 addition & 1 deletion apps/btshell/src/btshell.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "host/ble_gatt.h"
#include "host/ble_gap.h"
#if (MYNEWT_VAL(BLE_ISO_BROADCAST_SOURCE))
#include "host/ble_audio_broadcast_source.h"
#include "audio/ble_audio_broadcast_source.h"
#endif

#ifdef __cplusplus
Expand Down
4 changes: 2 additions & 2 deletions apps/btshell/src/cmd_leaudio.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
* under the License.
*/

#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_BROADCAST_SOURCE))
#if (MYNEWT_VAL(BLE_AUDIO))
#include "audio/ble_audio_broadcast_source.h"
int
cmd_leaudio_base_add(int argc, char **argv)
{
Expand Down
6 changes: 4 additions & 2 deletions apps/btshell/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,10 @@
#include "host/ble_gatt.h"
#include "host/ble_store.h"
#include "host/ble_sm.h"
#include "host/ble_audio_common.h"
#include "host/ble_audio_broadcast_source.h"
#if MYNEWT_VAL(BLE_AUDIO)
#include "audio/ble_audio_broadcast_source.h"
#include "audio/ble_audio.h"
#endif
#include "host/util/util.h"

/* Mandatory services. */
Expand Down
1 change: 1 addition & 0 deletions apps/leaudio_broadcaster/pkg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ pkg.deps:
- nimble/host/util
- nimble/host/services/gap
- nimble/host/store/config
- nimble/host/audio
- "@apache-mynewt-core/kernel/os"
- "@apache-mynewt-core/sys/console"
- "@apache-mynewt-core/sys/log"
Expand Down
4 changes: 2 additions & 2 deletions apps/leaudio_broadcaster/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
#include "host/ble_hs.h"
#include "host/util/util.h"

#include "host/ble_audio_broadcast_source.h"
#include "host/ble_audio_common.h"
#include "audio/ble_audio_broadcast_source.h"
#include "audio/ble_audio.h"
#include "host/ble_iso.h"

#include "hal/hal_gpio.h"
Expand Down
1 change: 1 addition & 0 deletions apps/leaudio_broadcaster/syscfg.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ syscfg.vals:
MSYS_1_BLOCK_COUNT: 32

BLE_VERSION: 54
BLE_AUDIO: 1
BLE_ISO: 1
BLE_ISO_BROADCAST_SOURCE: 1
BLE_MAX_BIG: 1
Expand Down
Loading

0 comments on commit 7f1df8a

Please sign in to comment.