Skip to content

Commit

Permalink
bluetooth: tester: Add support for flags in BTP_GAP_PADV_CREATE_SYNC
Browse files Browse the repository at this point in the history
This allows for more tuning regarding Periodic Advertising Sync
behavior.

Required by GAP/PADV/PASE/BV-01-C qualification test case.

Signed-off-by: Szymon Janc <[email protected]>
  • Loading branch information
sjanc authored and fabiobaltieri committed Dec 4, 2023
1 parent 1aac715 commit bc97d1e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
3 changes: 3 additions & 0 deletions tests/bluetooth/tester/src/btp/btp_gap.h
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,9 @@ struct btp_gap_padv_set_data_cmd {
uint8_t data[];
} __packed;

#define BTP_GAP_PADV_CREATE_SYNC_FLAG_REPORTS_DISABLED 0x01
#define BTP_GAP_PADV_CREATE_SYNC_FLAG_FILTER_DUPLICATES 0x02

#define BTP_GAP_PADV_CREATE_SYNC 0x26
struct btp_gap_padv_create_sync_cmd {
bt_addr_le_t address;
Expand Down
10 changes: 9 additions & 1 deletion tests/bluetooth/tester/src/btp_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -1592,11 +1592,19 @@ static uint8_t padv_create_sync(const void *cmd, uint16_t cmd_len,
struct bt_le_per_adv_sync_param create_params = {0};

bt_addr_le_copy(&create_params.addr, &cp->address);
create_params.options = BT_LE_PER_ADV_SYNC_OPT_FILTER_DUPLICATE;
create_params.options = BT_LE_PER_ADV_SYNC_OPT_NONE;
create_params.sid = cp->advertiser_sid;
create_params.skip = cp->skip;
create_params.timeout = cp->sync_timeout;

if (cp->flags & BTP_GAP_PADV_CREATE_SYNC_FLAG_REPORTS_DISABLED) {
create_params.options |= BT_LE_PER_ADV_SYNC_OPT_REPORTING_INITIALLY_DISABLED;
}

if (cp->flags & BTP_GAP_PADV_CREATE_SYNC_FLAG_FILTER_DUPLICATES) {
create_params.options |= BT_LE_PER_ADV_SYNC_OPT_FILTER_DUPLICATE;
}

err = tester_gap_padv_create_sync(&create_params);
if (err != 0) {
return BTP_STATUS_FAILED;
Expand Down

0 comments on commit bc97d1e

Please sign in to comment.