Skip to content

Commit a4d628e

Browse files
Thalleyfabiobaltieri
authored andcommitted
tests: Bluetooth: tester: Implement TBS registration
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]>
1 parent 2423312 commit a4d628e

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/bluetooth/tester/src/audio/btp_ccp.c

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111

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

14+
#include <zephyr/bluetooth/audio/tbs.h>
1415
#include <zephyr/logging/log.h>
16+
1517
#define LOG_MODULE_NAME bttester_ccp
1618
LOG_MODULE_REGISTER(LOG_MODULE_NAME, CONFIG_BTTESTER_LOG_LEVEL);
1719

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

11631165
uint8_t tester_init_tbs(void)
11641166
{
1167+
const struct bt_tbs_register_param gtbs_param = {
1168+
.provider_name = "Generic TBS",
1169+
.uci = "un000",
1170+
.uri_schemes_supported = "tel,skype",
1171+
.gtbs = true,
1172+
.authorization_required = false,
1173+
.technology = BT_TBS_TECHNOLOGY_3G,
1174+
.supported_features = CONFIG_BT_TBS_SUPPORTED_FEATURES,
1175+
};
1176+
const struct bt_tbs_register_param tbs_param = {
1177+
.provider_name = "TBS",
1178+
.uci = "un000",
1179+
.uri_schemes_supported = "tel,skype",
1180+
.gtbs = false,
1181+
.authorization_required = false,
1182+
/* Set different technologies per bearer */
1183+
.technology = BT_TBS_TECHNOLOGY_4G,
1184+
.supported_features = CONFIG_BT_TBS_SUPPORTED_FEATURES,
1185+
};
1186+
int err;
1187+
11651188
bt_tbs_register_cb(&tbs_cbs);
11661189

11671190
tester_register_command_handlers(BTP_SERVICE_ID_TBS, tbs_handlers,
11681191
ARRAY_SIZE(tbs_handlers));
11691192

1193+
err = bt_tbs_register_bearer(&gtbs_param);
1194+
if (err < 0) {
1195+
LOG_DBG("Failed to register GTBS: %d", err);
1196+
1197+
return BTP_STATUS_FAILED;
1198+
}
1199+
1200+
err = bt_tbs_register_bearer(&tbs_param);
1201+
if (err < 0) {
1202+
LOG_DBG("Failed to register TBS: %d", err);
1203+
1204+
return BTP_STATUS_FAILED;
1205+
}
1206+
11701207
return BTP_STATUS_SUCCESS;
11711208
}
11721209

0 commit comments

Comments
 (0)