Bluetooth: Audio: Add CAP acceptor

Adding the CAP Acceptor role, which is a quite simple
role. The role instantiates the Common Audio Service (CAS)

The role will later be expanded to properly support
the use the Coordinated Set Member role via CSIS.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2021-12-07 16:41:02 +01:00 committed by Fabio Baltieri
parent bd707b4e11
commit 2c6358c9c9
5 changed files with 54 additions and 0 deletions

View file

@ -554,6 +554,15 @@ struct bt_uuid_128 {
*/
#define BT_UUID_BROADCAST_AUDIO \
BT_UUID_DECLARE_16(BT_UUID_BROADCAST_AUDIO_VAL)
/** @def BT_UUID_CAS_VAL
* @brief Common Audio Service value
*/
#define BT_UUID_CAS_VAL 0x1853
/** @def BT_UUID_CAS
* @brief Common Audio Service
*/
#define BT_UUID_CAS \
BT_UUID_DECLARE_16(BT_UUID_CAS_VAL)
/** @def BT_UUID_HAS_VAL
* @brief Hearing Access Service value
*/

View file

@ -56,3 +56,4 @@ 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_HAS has.c)
zephyr_library_sources_ifdef(CONFIG_BT_HAS_CLIENT has_client.c)
zephyr_library_sources_ifdef(CONFIG_BT_CAP cap.c)

View file

@ -37,5 +37,6 @@ rsource "Kconfig.bass"
rsource "Kconfig.has"
rsource "Kconfig.mpl"
rsource "Kconfig.mctl"
rsource "Kconfig.cap"
endif # BT_AUDIO

View file

@ -0,0 +1,27 @@
# Bluetooth Audio - Common Audio Profile (CAP) options
#
# Copyright (c) 2022 Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
#
config BT_CAP
bool
help
Hidden Kconfig to enable cross-role CAP capabilities.
config BT_CAP_ACCEPTOR
bool "Common Audio Profile Acceptor Role Support [EXPERIMENTAL]"
depends on BT_AUDIO_UNICAST_SERVER || (BT_AUDIO_BROADCAST_SINK && BT_BASS)
select EXPERIMENTAL
select BT_CAP
help
Enabling this will enable the CAP Acceptor role. This instantiates the
common audio service (CAS).
config BT_DEBUG_CAP
bool "Common Audio Profile debug"
depends on BT_CAP
help
Use this option to enable CAP debug logs for the
Bluetooth Audio functionality.

View file

@ -0,0 +1,16 @@
/*
* Copyright (c) 2022 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <bluetooth/gatt.h>
#if defined(CONFIG_BT_CAP_ACCEPTOR)
BT_GATT_SERVICE_DEFINE(cas_svc,
BT_GATT_PRIMARY_SERVICE(BT_UUID_CAS)
/* TODO: Add support for included CSIS */
);
#endif /* BT_CAP_ACCEPTOR */