Skip to content
Closed
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions tests/bluetooth/tester/overlay-le-audio.conf
Original file line number Diff line number Diff line change
Expand Up @@ -147,3 +147,6 @@ CONFIG_BT_TBS_SUPPORTED_FEATURES=3

# TMAP
CONFIG_BT_TMAP=y

# PBP
CONFIG_BT_PBP=y
4 changes: 4 additions & 0 deletions tests/bluetooth/tester/src/audio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -67,3 +67,7 @@ endif()
if(CONFIG_BT_TMAP)
target_sources(app PRIVATE btp_tmap.c)
endif()

if(CONFIG_BT_PBP)
target_sources(app PRIVATE btp_pbp.c)
endif()
46 changes: 46 additions & 0 deletions tests/bluetooth/tester/src/audio/btp/btp_pbp.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/* btp_pbp.c - Bluetooth PBP Tester */

/*
* Copyright (c) 2025 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/

/* This is main.h */

#define BTP_PBP_READ_SUPPORTED_COMMANDS 0x01
struct btp_pbp_read_supported_commands_rp {

Check notice on line 12 in tests/bluetooth/tester/src/audio/btp/btp_pbp.h

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/btp_pbp.h:12 -#define BTP_PBP_READ_SUPPORTED_COMMANDS 0x01 +#define BTP_PBP_READ_SUPPORTED_COMMANDS 0x01
uint8_t data[0];
} __packed;

#define BTP_PBP_SET_PUBLIC_BROADCAST_ANNOUNCEMENT 0x02
struct btp_pbp_set_public_broadcast_announcement_cmd {
uint8_t features;
uint8_t metadata_len;
uint8_t metadata[];
} __packed;

#define BTP_PBP_SET_BROADCAST_NAME 0x03
struct btp_pbp_set_broadcast_name_cmd {
uint8_t name_len;
uint8_t name[];
} __packed;

#define BTP_PBP_BROADCAST_SCAN_START 0x04
struct btp_pbp_broadcast_scan_start_cmd {
} __packed;

#define BTP_PBP_BROADCAST_SCAN_STOP 0x05
struct btp_pbp_broadcast_scan_stop_cmd {
} __packed;

#define BTP_PBP_EV_PUBLIC_BROADCAST_ANOUNCEMENT_FOUND 0x80
struct btp_pbp_ev_public_broadcast_anouncement_found_rp {
bt_addr_le_t address;
uint8_t broadcast_id[BT_AUDIO_BROADCAST_ID_SIZE];
uint8_t advertiser_sid;
uint16_t padv_interval;
uint8_t pba_features;
uint8_t broadcast_name_len;
uint8_t broadcast_name[];
} __packed;
47 changes: 25 additions & 22 deletions tests/bluetooth/tester/src/audio/btp_cap.c
Original file line number Diff line number Diff line change
Expand Up @@ -542,30 +542,33 @@
struct bt_data base_ad[2];
struct bt_data per_ad;

err = bt_cap_initiator_broadcast_get_id(source->cap_broadcast, &source->broadcast_id);
if (err != 0) {
LOG_DBG("Unable to get broadcast ID: %d", err);

return -EINVAL;
}
if (tester_gap_ext_adv_get() == NULL) {
err = bt_cap_initiator_broadcast_get_id(source->cap_broadcast, &source->broadcast_id);

Check warning on line 546 in tests/bluetooth/tester/src/audio/btp_cap.c

View workflow job for this annotation

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

LONG_LINE

tests/bluetooth/tester/src/audio/btp_cap.c:546 line length of 102 exceeds 100 columns
if (err != 0) {

Check notice on line 547 in tests/bluetooth/tester/src/audio/btp_cap.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_cap.c:547 - err = bt_cap_initiator_broadcast_get_id(source->cap_broadcast, &source->broadcast_id); + err = bt_cap_initiator_broadcast_get_id(source->cap_broadcast, + &source->broadcast_id);
LOG_DBG("Unable to get broadcast ID: %d", err);

*gap_settings = BIT(BTP_GAP_SETTINGS_DISCOVERABLE) |
BIT(BTP_GAP_SETTINGS_EXTENDED_ADVERTISING);
/* Setup extended advertising data */
net_buf_simple_add_le16(&ad_buf, BT_UUID_BROADCAST_AUDIO_VAL);
net_buf_simple_add_le24(&ad_buf, source->broadcast_id);
base_ad[0].type = BT_DATA_SVC_DATA16;
base_ad[0].data_len = ad_buf.len;
base_ad[0].data = ad_buf.data;
base_ad[1].type = BT_DATA_NAME_COMPLETE;
base_ad[1].data_len = sizeof(CONFIG_BT_DEVICE_NAME) - 1;
base_ad[1].data = CONFIG_BT_DEVICE_NAME;
err = tester_gap_create_adv_instance(&param, BTP_GAP_ADDR_TYPE_IDENTITY, base_ad, 2, NULL,
0, gap_settings);
if (err != 0) {
LOG_DBG("Failed to create extended advertising instance: %d", err);
return -EINVAL;
}

return -EINVAL;
*gap_settings = BIT(BTP_GAP_SETTINGS_DISCOVERABLE) |
BIT(BTP_GAP_SETTINGS_EXTENDED_ADVERTISING);
/* Setup extended advertising data */
net_buf_simple_add_le16(&ad_buf, BT_UUID_BROADCAST_AUDIO_VAL);
net_buf_simple_add_le24(&ad_buf, source->broadcast_id);
base_ad[0].type = BT_DATA_SVC_DATA16;
base_ad[0].data_len = ad_buf.len;
base_ad[0].data = ad_buf.data;
base_ad[1].type = BT_DATA_NAME_COMPLETE;
base_ad[1].data_len = sizeof(CONFIG_BT_DEVICE_NAME) - 1;
base_ad[1].data = CONFIG_BT_DEVICE_NAME;

err = tester_gap_create_adv_instance(&param, BTP_GAP_ADDR_TYPE_IDENTITY, base_ad,
2, NULL, 0, gap_settings);
if (err != 0) {

Check notice on line 567 in tests/bluetooth/tester/src/audio/btp_cap.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_cap.c:567 - err = tester_gap_create_adv_instance(&param, BTP_GAP_ADDR_TYPE_IDENTITY, base_ad, - 2, NULL, 0, gap_settings); + err = tester_gap_create_adv_instance(&param, BTP_GAP_ADDR_TYPE_IDENTITY, base_ad, 2, + NULL, 0, gap_settings);
LOG_DBG("Failed to create extended advertising instance: %d", err);

return -EINVAL;
}
}

err = tester_gap_padv_configure(BT_LE_PER_ADV_PARAM(BT_GAP_PER_ADV_FAST_INT_MIN_2,
Expand Down
Loading
Loading