Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests: Bluetooth: tester: Implement TBS registration #79266

Merged
merged 1 commit into from
Oct 4, 2024
Merged
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
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
Loading