Skip to content

Commit

Permalink
Bluetooth: BAP: Unicast client shall support 0 or > 1 endpoints
Browse files Browse the repository at this point in the history
As per table 4.2 in BAP v1.0.1, the BAP unicast client shall
support at least 2 (> 1) endpoints in either direction if it
supports that direction.

Since Kconfig does not support such requirements (0 || > 1),
this is done using a BUILD_ASSERT.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
  • Loading branch information
Thalley authored and fabiobaltieri committed Jun 26, 2023
1 parent 15cdcc7 commit 5a4c9a2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
4 changes: 2 additions & 2 deletions samples/bluetooth/tmap_central/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ CONFIG_BT_TBS_SUPPORTED_FEATURES=3
CONFIG_BT_ISO_TX_BUF_COUNT=2
CONFIG_BT_ISO_MAX_CHAN=2
CONFIG_BT_BAP_UNICAST_CLIENT_GROUP_STREAM_COUNT=1
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT=1
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT=1
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT=2
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT=2
CONFIG_BT_GATT_DYNAMIC_DB=y

CONFIG_BT_EXT_ADV=y
Expand Down
2 changes: 1 addition & 1 deletion subsys/bluetooth/audio/Kconfig.bap
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ config BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT

config BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT
int "Basic Audio Profile ASE Source count"
default 1
default 2
range 0 255
help
This option enables caching a number of Audio Stream Endpoint Source
Expand Down
8 changes: 8 additions & 0 deletions subsys/bluetooth/audio/bap_unicast_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ BUILD_ASSERT(CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT > 0 ||
"CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT or "
"CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT shall be non-zero");

BUILD_ASSERT(CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT == 0 ||
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT > 1,
"CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SNK_COUNT shall be either 0 or > 1");

BUILD_ASSERT(CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT == 0 ||
CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT > 1,
"CONFIG_BT_BAP_UNICAST_CLIENT_ASE_SRC_COUNT shall be either 0 or > 1");

LOG_MODULE_REGISTER(bt_bap_unicast_client, CONFIG_BT_BAP_UNICAST_CLIENT_LOG_LEVEL);

#define PAC_DIR_UNUSED(dir) ((dir) != BT_AUDIO_DIR_SINK && (dir) != BT_AUDIO_DIR_SOURCE)
Expand Down

0 comments on commit 5a4c9a2

Please sign in to comment.