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:
parent
bd707b4e11
commit
2c6358c9c9
|
@ -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
|
||||
*/
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -37,5 +37,6 @@ rsource "Kconfig.bass"
|
|||
rsource "Kconfig.has"
|
||||
rsource "Kconfig.mpl"
|
||||
rsource "Kconfig.mctl"
|
||||
rsource "Kconfig.cap"
|
||||
|
||||
endif # BT_AUDIO
|
||||
|
|
27
subsys/bluetooth/audio/Kconfig.cap
Normal file
27
subsys/bluetooth/audio/Kconfig.cap
Normal 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.
|
16
subsys/bluetooth/audio/cap.c
Normal file
16
subsys/bluetooth/audio/cap.c
Normal 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 */
|
Loading…
Reference in a new issue