Skip to content

Commit 18193b8

Browse files
Thalleykartben
authored andcommitted
tests: Bluetooth: Tester: Validate PBP features
Add validation of the PBP features in the pbp_set_public_broadcast_announcement function. Signed-off-by: Emil Gydesen <emil.gydesen@nordicsemi.no>
1 parent 181a023 commit 18193b8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,13 @@ static uint8_t pbp_set_public_broadcast_announcement(const void *cmd, uint16_t c
196196
const struct btp_pbp_set_public_broadcast_announcement_cmd *cp = cmd;
197197
int err = -EINVAL;
198198

199+
if (cp->features == 0U || cp->features > (BT_PBP_ANNOUNCEMENT_FEATURE_ENCRYPTION |
200+
BT_PBP_ANNOUNCEMENT_FEATURE_STANDARD_QUALITY |
201+
BT_PBP_ANNOUNCEMENT_FEATURE_HIGH_QUALITY)) {
202+
LOG_DBG("Invalid features: %u", cp->features);
203+
return BTP_STATUS_FAILED;
204+
}
205+
199206
if (cp->metadata_len <= PBP_EXT_ADV_METADATA_LEN_MAX) {
200207
pbp_features_cached = cp->features;
201208
pbp_metadata_cached_len = cp->metadata_len;

0 commit comments

Comments
 (0)