Bluetooth: Audio: Add TBS client TX buffer count requirement

After removing the high default for MCS, it was discovered that
the TBS client requires a significant amount of buffers to work
properly as well. Added the requirement as a build assert that
depends on which optional TBS client features are enabled.

Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
This commit is contained in:
Emil Gydesen 2023-05-24 11:39:09 +02:00 committed by Anas Nashif
commit 5109c941f2
4 changed files with 23 additions and 0 deletions

View file

@ -24,6 +24,24 @@
#include <zephyr/logging/log.h>
LOG_MODULE_REGISTER(bt_tbs_client, CONFIG_BT_TBS_CLIENT_LOG_LEVEL);
/* TODO TBS client attempts to subscribe to all characteristics at once if the MTU is large enough.
* This requires a significant amount of buffers, and should be optimized.
*/
/* Calculate the requiered buffers for TBS Client discovery */
#define TBS_CLIENT_BUF_COUNT \
(1 /* Discover buffer */ + 1 /* terminate reason */ + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_BEARER_PROVIDER_NAME) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_BEARER_TECHNOLOGY) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_BEARER_SIGNAL_STRENGTH) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_BEARER_LIST_CURRENT_CALLS) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_INCOMING_URI) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_STATUS_FLAGS) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_CP_PROCEDURES) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_CALL_FRIENDLY_NAME) + \
IS_ENABLED(CONFIG_BT_TBS_CLIENT_INCOMING_CALL))
BUILD_ASSERT(CONFIG_BT_L2CAP_TX_BUF_COUNT >= TBS_CLIENT_BUF_COUNT, "Too few L2CAP buffers");
#include "common/bt_str.h"