Bluetooth: Audio: Make CAP acceptor more explicit

Remove the generic CONFIG_BT_CAP and CONFIG_BT_DEBUG_CAP
and only use Kconfigs specific to the individual roles.

This also includes renaming cap.c to cap_acceptor.c.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2022-06-28 12:06:16 +02:00 committed by Carles Cufí
commit 7a1e827a8b
4 changed files with 7 additions and 17 deletions

View file

@ -57,5 +57,5 @@ zephyr_library_sources_ifdef(CONFIG_BT_BASS bass.c)
zephyr_library_sources_ifdef(CONFIG_BT_BASS_CLIENT bass_client.c) zephyr_library_sources_ifdef(CONFIG_BT_BASS_CLIENT bass_client.c)
zephyr_library_sources_ifdef(CONFIG_BT_HAS has.c) zephyr_library_sources_ifdef(CONFIG_BT_HAS has.c)
zephyr_library_sources_ifdef(CONFIG_BT_HAS_CLIENT has_client.c) zephyr_library_sources_ifdef(CONFIG_BT_HAS_CLIENT has_client.c)
zephyr_library_sources_ifdef(CONFIG_BT_CAP_ACCEPTOR cap.c) zephyr_library_sources_ifdef(CONFIG_BT_CAP_ACCEPTOR cap_acceptor.c)
zephyr_library_sources_ifdef(CONFIG_BT_CAP_INITIATOR cap_initiator.c) zephyr_library_sources_ifdef(CONFIG_BT_CAP_INITIATOR cap_initiator.c)

View file

@ -5,16 +5,10 @@
# SPDX-License-Identifier: Apache-2.0 # SPDX-License-Identifier: Apache-2.0
# #
config BT_CAP
bool
help
Hidden Kconfig to enable cross-role CAP capabilities.
config BT_CAP_ACCEPTOR config BT_CAP_ACCEPTOR
bool "Common Audio Profile Acceptor Role Support [EXPERIMENTAL]" bool "Common Audio Profile Acceptor Role Support [EXPERIMENTAL]"
depends on BT_AUDIO_UNICAST_SERVER || (BT_AUDIO_BROADCAST_SINK && BT_BASS) depends on BT_AUDIO_UNICAST_SERVER || (BT_AUDIO_BROADCAST_SINK && BT_BASS)
select EXPERIMENTAL select EXPERIMENTAL
select BT_CAP
help help
Enabling this will enable the CAP Acceptor role. This instantiates the Enabling this will enable the CAP Acceptor role. This instantiates the
common audio service (CAS). common audio service (CAS).
@ -29,9 +23,9 @@ config BT_CAP_ACCEPTOR_SET_MEMBER
Enabling will take one of the allocated CSIS instances Enabling will take one of the allocated CSIS instances
(BT_CSIS_MAX_INSTANCE_COUNT). (BT_CSIS_MAX_INSTANCE_COUNT).
config BT_DEBUG_CAP config BT_DEBUG_CAP_ACCEPTOR
bool "Common Audio Profile debug" bool "Common Audio Profile debug"
depends on BT_CAP depends on BT_CAP_ACCEPTOR
help help
Use this option to enable CAP debug logs for the Use this option to enable CAP debug logs for the
Bluetooth Audio functionality. Bluetooth Audio functionality.
@ -40,7 +34,6 @@ config BT_CAP_INITIATOR
bool "Common Audio Profile Initiator Role Support [EXPERIMENTAL]" bool "Common Audio Profile Initiator Role Support [EXPERIMENTAL]"
depends on (BT_AUDIO_UNICAST_CLIENT && BT_CSIS_CLIENT) || BT_AUDIO_BROADCAST_SOURCE depends on (BT_AUDIO_UNICAST_CLIENT && BT_CSIS_CLIENT) || BT_AUDIO_BROADCAST_SOURCE
select EXPERIMENTAL select EXPERIMENTAL
select BT_CAP
help help
Enabling this will enable the CAP Initiator role. Enabling this will enable the CAP Initiator role.

View file

@ -10,11 +10,10 @@
#include <zephyr/bluetooth/audio/csis.h> #include <zephyr/bluetooth/audio/csis.h>
#include "cap_internal.h" #include "cap_internal.h"
#define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_CAP) #define BT_DBG_ENABLED IS_ENABLED(CONFIG_BT_DEBUG_CAP_ACCEPTOR)
#define LOG_MODULE_NAME bt_cap #define LOG_MODULE_NAME bt_cap_acceptor
#include "common/log.h" #include "common/log.h"
#if defined(CONFIG_BT_CAP_ACCEPTOR)
#if defined(CONFIG_BT_CAP_ACCEPTOR_SET_MEMBER) #if defined(CONFIG_BT_CAP_ACCEPTOR_SET_MEMBER)
static struct bt_gatt_attr svc_attrs[] = { static struct bt_gatt_attr svc_attrs[] = {
@ -48,7 +47,7 @@ int bt_cap_acceptor_register(const struct bt_csis_register_param *param,
return 0; return 0;
} }
#else #else /* CONFIG_BT_CAP_ACCEPTOR_SET_MEMBER */
BT_GATT_SERVICE_DEFINE(cas_svc, BT_GATT_SERVICE_DEFINE(cas_svc,
BT_GATT_PRIMARY_SERVICE(BT_UUID_CAS) BT_GATT_PRIMARY_SERVICE(BT_UUID_CAS)
@ -68,5 +67,3 @@ bool bt_cap_acceptor_ccid_exist(const struct bt_conn *conn, uint8_t ccid)
return false; return false;
} }
#endif /* BT_CAP_ACCEPTOR */

View file

@ -145,7 +145,7 @@ CONFIG_BT_DEBUG_BASS=y
CONFIG_BT_DEBUG_BASS_CLIENT=y CONFIG_BT_DEBUG_BASS_CLIENT=y
CONFIG_BT_DEBUG_HAS=y CONFIG_BT_DEBUG_HAS=y
CONFIG_BT_DEBUG_HAS_CLIENT=y CONFIG_BT_DEBUG_HAS_CLIENT=y
CONFIG_BT_DEBUG_CAP=y CONFIG_BT_DEBUG_CAP_ACCEPTOR=y
CONFIG_BT_DEBUG_CAP_INITIATOR=y CONFIG_BT_DEBUG_CAP_INITIATOR=y
# LOGGING # LOGGING