Skip to content

Commit

Permalink
tests: Bluetooth: tester: Implement TBS registration
Browse files Browse the repository at this point in the history
TBS registration was changed from static to dynamic
and the BT Tester application need to be updated to use
the dynamic registration.

Signed-off-by: Emil Gydesen <[email protected]>
  • Loading branch information
Thalley committed Oct 1, 2024
1 parent 9c0f92d commit 57e90dc
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions tests/bluetooth/tester/src/audio/btp_ccp.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,9 @@

#include <../../subsys/bluetooth/audio/tbs_internal.h>

#include <zephyr/bluetooth/audio/tbs.h>
#include <zephyr/logging/log.h>

#define LOG_MODULE_NAME bttester_ccp
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);

Expand Down Expand Up @@ -1162,11 +1164,46 @@ static const struct btp_handler tbs_handlers[] = {

uint8_t tester_init_tbs(void)
{
const struct bt_tbs_register_param gtbs_param = {
.provider_name = "Generic TBS",
.uci = "un000",
.uri_schemes_supported = "tel,skype",
.gtbs = true,
.authorization_required = false,
.technology = BT_TBS_TECHNOLOGY_3G,
.supported_features = CONFIG_BT_TBS_SUPPORTED_FEATURES,
};
const struct bt_tbs_register_param tbs_param = {
.provider_name = "TBS",
.uci = "un000",
.uri_schemes_supported = "tel,skype",
.gtbs = false,
.authorization_required = false,
/* Set different technologies per bearer */
.technology = BT_TBS_TECHNOLOGY_4G,
.supported_features = CONFIG_BT_TBS_SUPPORTED_FEATURES,
};
int err;

bt_tbs_register_cb(&tbs_cbs);

tester_register_command_handlers(BTP_SERVICE_ID_TBS, tbs_handlers,
ARRAY_SIZE(tbs_handlers));

err = bt_tbs_register_bearer(&gtbs_param);
if (err != 0) {
LOG_DBG("Failed to register GTBS: %d", err);

return BTP_STATUS_FAILED;
}

err = bt_tbs_register_bearer(&tbs_param);
if (err != 0) {
LOG_DBG("Failed to register TBS: %d", err);

return BTP_STATUS_FAILED;
}

return BTP_STATUS_SUCCESS;
}

Expand Down

0 comments on commit 57e90dc

Please sign in to comment.