Skip to content

Commit

Permalink
temporarely run with more logging
Browse files Browse the repository at this point in the history
  • Loading branch information
Frodevan committed Jan 9, 2025
1 parent f30996d commit e9f7c58
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tests/bluetooth/tester/src/audio/btp_pbp.c
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,8 @@ static uint8_t pbp_read_supported_commands(const void *cmd, uint16_t cmd_len,
{

Check notice on line 97 in tests/bluetooth/tester/src/audio/btp_pbp.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

tests/bluetooth/tester/src/audio/btp_pbp.c:97 -static uint8_t pbp_read_supported_commands(const void *cmd, uint16_t cmd_len, - void *rsp, uint16_t *rsp_len) +static uint8_t pbp_read_supported_commands(const void *cmd, uint16_t cmd_len, void *rsp, + uint16_t *rsp_len)
struct btp_pbp_read_supported_commands_rp *rp = rsp;

LOG_DBG("Reading supported PBP commands...");

tester_set_bit(rp->data, BTP_PBP_READ_SUPPORTED_COMMANDS);
tester_set_bit(rp->data, BTP_PBP_SET_PUBLIC_BROADCAST_ANNOUNCEMENT);
tester_set_bit(rp->data, BTP_PBP_SET_BROADCAST_NAME);
Expand All @@ -121,6 +123,8 @@ static int pbp_broadcast_source_adv_setup(void)

Check notice on line 123 in tests/bluetooth/tester/src/audio/btp_pbp.c

View workflow job for this annotation

GitHub Actions / Run compliance checks on patch series (PR)

You may want to run clang-format on this change

tests/bluetooth/tester/src/audio/btp_pbp.c:123 - struct bt_le_adv_param param = BT_LE_ADV_PARAM_INIT(0, BT_GAP_ADV_FAST_INT_MIN_2, - BT_GAP_ADV_FAST_INT_MAX_2, NULL); - uint32_t gap_settings = BIT(BTP_GAP_SETTINGS_DISCOVERABLE) | - BIT(BTP_GAP_SETTINGS_EXTENDED_ADVERTISING); + struct bt_le_adv_param param = + BT_LE_ADV_PARAM_INIT(0, BT_GAP_ADV_FAST_INT_MIN_2, BT_GAP_ADV_FAST_INT_MAX_2, NULL); + uint32_t gap_settings = + BIT(BTP_GAP_SETTINGS_DISCOVERABLE) | BIT(BTP_GAP_SETTINGS_EXTENDED_ADVERTISING); uint32_t broadcast_id; - NET_BUF_SIMPLE_DEFINE(ad_buf, - BT_UUID_SIZE_16 + BT_AUDIO_BROADCAST_ID_SIZE); + NET_BUF_SIMPLE_DEFINE(ad_buf, BT_UUID_SIZE_16 + BT_AUDIO_BROADCAST_ID_SIZE);
int err = bt_rand(&broadcast_id, BT_AUDIO_BROADCAST_ID_SIZE);

LOG_DBG("Setting up extended advertisement for PBP...");

if (err) {
LOG_ERR("Unable to generate broadcast ID: %d\n", err);
return -EINVAL;
Expand Down Expand Up @@ -161,6 +165,8 @@ static uint8_t pbp_set_public_broadcast_announcement(const void *cmd, uint16_t c
const struct btp_pbp_set_public_broadcast_announcement_cmd *cp = cmd;
int err = -EINVAL;

LOG_DBG("setting public broadcast anouncement...");

if (cp->metadata_len <= PBP_EXT_ADV_METADATA_LEN_MAX) {
pbp_name_cached_len = cp->metadata_len;
memcpy(pbp_metadata_cached, cp->metadata, cp->metadata_len);
Expand All @@ -179,6 +185,8 @@ static uint8_t pbp_set_broadcast_name(const void *cmd, uint16_t cmd_len,
const struct btp_pbp_set_broadcast_name_cmd *cp = cmd;
int err = -EINVAL;

LOG_DBG("setting broadcast name...");

if (cp->name_len <= BT_AUDIO_BROADCAST_NAME_LEN_MAX) {
pbp_metadata_cached_len = cp->name_len;
memcpy(pbp_broadcast_name_cached, cp->name, cp->name_len);
Expand Down Expand Up @@ -258,6 +266,9 @@ uint8_t tester_init_pbp(void)
{
pbp_metadata_cached_len = 0;
pbp_name_cached_len = 0;

LOG_DBG("Init PBP...");

tester_register_command_handlers(BTP_SERVICE_ID_PBP, pbp_handlers,
ARRAY_SIZE(pbp_handlers));

Expand All @@ -268,5 +279,7 @@ uint8_t tester_init_pbp(void)

uint8_t tester_unregister_pbp(void)
{
LOG_DBG("Unregister PBP...");

return BTP_STATUS_SUCCESS;
}

0 comments on commit e9f7c58

Please sign in to comment.