Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 33 additions & 13 deletions tests/bluetooth/audio/cap_commander/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,43 @@

cmake_minimum_required(VERSION 3.20.0)

find_package(Zephyr COMPONENTS unittest HINTS $ENV{ZEPHYR_BASE})
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})

project(bluetooth_cap_commander)

add_subdirectory(${ZEPHYR_BASE}/tests/bluetooth/audio/cap_commander/uut uut)
target_include_directories(app PRIVATE
${ZEPHYR_BASE}/subsys/bluetooth/

target_link_libraries(testbinary PRIVATE uut)
${ZEPHYR_BASE}/tests/bluetooth/audio/cap_commander/include
${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/include
)

target_sources(app PRIVATE
# Test source files
src/main.c
src/test_common.c
src/test_vcp.c
src/test_micp.c
src/test_broadcast_reception.c
src/test_distribute_broadcast_code.c
src/test_cancel.c

# UUT files
uut/bap_broadcast_assistant.c
uut/aics.c
uut/cap_commander.c
uut/csip.c
uut/micp.c
uut/vcp.c
uut/vocs.c

target_include_directories(testbinary PRIVATE include)
# Stack source file
${ZEPHYR_BASE}/subsys/bluetooth/audio/audio.c
${ZEPHYR_BASE}/subsys/bluetooth/audio/cap_commander.c
${ZEPHYR_BASE}/subsys/bluetooth/audio/cap_common.c
${ZEPHYR_BASE}/subsys/bluetooth/common/addr.c

target_sources(testbinary
PRIVATE
src/main.c
src/test_common.c
src/test_vcp.c
src/test_micp.c
src/test_broadcast_reception.c
src/test_distribute_broadcast_code.c
src/test_cancel.c
# Mock files
${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/src/conn.c
${ZEPHYR_BASE}/tests/bluetooth/audio/mocks/src/gatt.c
)
131 changes: 131 additions & 0 deletions tests/bluetooth/audio/cap_commander/Kconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,131 @@
# Copyright (c) 2025 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0

config BT_AICS_CLIENT
bool
default y

config BT_AICS_CLIENT_MAX_INSTANCE_COUNT
int
default 1

config BT_ATT_PREPARE_COUNT
int
default 1

config BT_AUDIO
bool
default y

config BT_BAP_BASS_MAX_SUBGROUPS
int
default 2

config BT_BAP_BROADCAST_ASSISTANT
bool
default y

config BT_BAP_SCAN_DELEGATOR
bool
default y

config BT_BONDABLE
bool
default y

config BT_BUF_ACL_RX_SIZE
int
default 69

config BT_BUF_ACL_TX_COUNT
int
default 5

config BT_BUF_EVT_RX_COUNT
int
default 10

config BT_CSIP_SET_COORDINATOR
bool
default y

config BT_CSIP_SET_COORDINATOR_MAX_CSIS_INSTANCES
int
default 1

config BT_CONN
bool
default y

config BT_MAX_PAIRED
int
default 1

config BT_MICP_MIC_CTLR
bool
default y

config BT_MICP_MIC_CTLR_AICS
bool
default y

config BT_MICP_MIC_CTLR_MAX_AICS_INST
int
default 1

config BT_GATT_DYNAMIC_DB
bool
default y

config BT_ISO_PERIPHERAL
bool
default y

config BT_ISO_MAX_CHAN
int
default 10

config BT_L2CAP_TX_MTU
int
default 65

config BT_LOG
bool
default y

config BT_MAX_CONN
int
default 2

config BT_PERIPHERAL
bool
default y

config BT_VCP_VOL_CTLR
bool
default y

config BT_VCP_VOL_CTLR_MAX_VOCS_INST
int
default 1

config BT_VCP_VOL_CTLR_MAX_AICS_INST
int
default 1

config BT_VOCS_CLIENT
bool
default y

config BT_VOCS_CLIENT_MAX_INSTANCE_COUNT
int
default 1

config BT_SMP
bool
default y

# Include Zephyr's Kconfig.
source "Kconfig"
source "subsys/bluetooth/audio/Kconfig"
source "subsys/bluetooth/Kconfig.logging"
27 changes: 2 additions & 25 deletions tests/bluetooth/audio/cap_commander/prj.conf
Original file line number Diff line number Diff line change
@@ -1,33 +1,10 @@
CONFIG_ZTEST=y

CONFIG_BT=y
CONFIG_BT_SMP=y
CONFIG_BT_CENTRAL=y
CONFIG_BT_ISO_SYNC_RECEIVER=y
CONFIG_BT_MAX_CONN=2
CONFIG_BT_OBSERVER=y
CONFIG_BT_GATT_CLIENT=y
CONFIG_BT_GATT_AUTO_DISCOVER_CCC=y
CONFIG_BT_GATT_DYNAMIC_DB=y
CONFIG_BT_GATT_AUTO_UPDATE_MTU=y
CONFIG_BT_AUDIO=y

# Requirements for CAP commander
CONFIG_BT_VCP_VOL_CTLR=y
CONFIG_BT_VOCS_CLIENT_MAX_INSTANCE_COUNT=1
CONFIG_BT_VCP_VOL_CTLR_MAX_VOCS_INST=1
CONFIG_BT_CSIP_SET_COORDINATOR=y
CONFIG_BT_MICP_MIC_CTLR=y
CONFIG_BT_AICS_CLIENT_MAX_INSTANCE_COUNT=1
CONFIG_BT_MICP_MIC_CTLR_MAX_AICS_INST=1

CONFIG_BT_CAP_COMMANDER=y
CONFIG_BT_EXT_ADV=y
CONFIG_BT_PER_ADV_SYNC=y
CONFIG_BT_BAP_BROADCAST_ASSISTANT=y

CONFIG_LOG=y
CONFIG_BT_CAP_COMMANDER_LOG_LEVEL_DBG=y
CONFIG_BT_BAP_BASS_MAX_SUBGROUPS=2

CONFIG_ASSERT=y
CONFIG_ASSERT_LEVEL=2
CONFIG_ASSERT_VERBOSE=y
5 changes: 4 additions & 1 deletion tests/bluetooth/audio/cap_commander/testcase.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ common:
- bluetooth_audio
tests:
bluetooth.audio.cap_commander.test_default:
type: unit
platform_allow:
- native_sim
integration_platforms:
- native_sim
29 changes: 0 additions & 29 deletions tests/bluetooth/audio/cap_commander/uut/CMakeLists.txt

This file was deleted.