Bluetooth samples: broadcast audio: Add more test Kconfig options
Instead of handling some of the configuation thru
board overlays let's handle it thru the sample Kconfig
file, which reduces the amount of duplicate lines.
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
diff --git a/samples/bluetooth/broadcast_audio_sink/Kconfig b/samples/bluetooth/broadcast_audio_sink/Kconfig
index 189c9f2..b70a42e 100644
--- a/samples/bluetooth/broadcast_audio_sink/Kconfig
+++ b/samples/bluetooth/broadcast_audio_sink/Kconfig
@@ -35,4 +35,12 @@
Name of target broadcast device. If not empty string, sink device
will only listen to the specified broadcast source. Not case sensitive.
+config ENABLE_LC3
+ bool "Enable the LC3 codec"
+ # By default let's enable it in the platforms we know are capable of supporting it
+ default y
+ depends on (ARCH_POSIX || SOC_NRF5340_CPUAPP)
+ select LIBLC3
+ select FPU
+
source "Kconfig.zephyr"
diff --git a/samples/bluetooth/broadcast_audio_sink/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/broadcast_audio_sink/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf
index 29f7e03..8ab7a16 100644
--- a/samples/bluetooth/broadcast_audio_sink/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf
+++ b/samples/bluetooth/broadcast_audio_sink/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf
@@ -1,8 +1,3 @@
-# For LC3 the following configs are needed
-CONFIG_FPU=y
-CONFIG_LIBLC3=y
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
-# Enable encryption.
-CONFIG_BT_TINYCRYPT_ECC=y
diff --git a/samples/bluetooth/broadcast_audio_sink/prj.conf b/samples/bluetooth/broadcast_audio_sink/prj.conf
index 29a4799..359b74a 100644
--- a/samples/bluetooth/broadcast_audio_sink/prj.conf
+++ b/samples/bluetooth/broadcast_audio_sink/prj.conf
@@ -14,3 +14,6 @@
CONFIG_BT_BUF_ACL_TX_SIZE=251
CONFIG_BT_DEVICE_NAME="Broadcast Audio Sink"
+
+# Enable encryption.
+CONFIG_BT_TINYCRYPT_ECC=y
diff --git a/samples/bluetooth/broadcast_audio_source/Kconfig b/samples/bluetooth/broadcast_audio_source/Kconfig
index 91cca49..cc3e714 100644
--- a/samples/bluetooth/broadcast_audio_source/Kconfig
+++ b/samples/bluetooth/broadcast_audio_source/Kconfig
@@ -1,4 +1,5 @@
# Copyright (c) 2023 Demant A/S
+# Copyright (c) 2023 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
mainmenu "Bluetooth: Broadcast Audio Source"
@@ -19,4 +20,12 @@
endchoice
+config ENABLE_LC3
+ bool "Enable the LC3 codec"
+ # By default let's enable it in the platforms we know are capable of supporting it
+ default y
+ depends on (ARCH_POSIX || SOC_NRF5340_CPUAPP)
+ select LIBLC3
+ select FPU
+
source "Kconfig.zephyr"
diff --git a/samples/bluetooth/broadcast_audio_source/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf b/samples/bluetooth/broadcast_audio_source/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf
index aae6000..f274c4a 100644
--- a/samples/bluetooth/broadcast_audio_source/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf
+++ b/samples/bluetooth/broadcast_audio_source/boards/nrf5340_audio_dk_nrf5340_cpuapp.conf
@@ -1,10 +1,6 @@
-# For LC3 the following configs are needed
-CONFIG_FPU=y
-CONFIG_LIBLC3=y
# When Host is fixed, CONFIG_BT_CTLR_ISO_TX_BUFFER_SIZE can inherit the CONFIG_BT_ISO_TX_MTU value.
CONFIG_BT_ISO_TX_MTU=40
# The LC3 codec uses a large amount of stack. This app runs the codec in the work-queue, hence
# inctease stack size for that thread.
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_MAIN_STACK_SIZE=4096
-CONFIG_BT_TINYCRYPT_ECC=y
diff --git a/samples/bluetooth/broadcast_audio_source/prj.conf b/samples/bluetooth/broadcast_audio_source/prj.conf
index 8921099..576af17 100644
--- a/samples/bluetooth/broadcast_audio_source/prj.conf
+++ b/samples/bluetooth/broadcast_audio_source/prj.conf
@@ -11,3 +11,5 @@
CONFIG_BT_ISO_TX_BUF_COUNT=4
CONFIG_BT_DEVICE_NAME="Broadcast Audio Source"
+
+CONFIG_BT_TINYCRYPT_ECC=y