From bc97d1ead04f39cea0d9c20159ff8e8f6c576713 Mon Sep 17 00:00:00 2001 From: Szymon Janc Date: Fri, 1 Dec 2023 11:11:34 +0100 Subject: [PATCH] bluetooth: tester: Add support for flags in BTP_GAP_PADV_CREATE_SYNC 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 --- tests/bluetooth/tester/src/btp/btp_gap.h | 3 +++ tests/bluetooth/tester/src/btp_gap.c | 10 +++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/bluetooth/tester/src/btp/btp_gap.h b/tests/bluetooth/tester/src/btp/btp_gap.h index a727ffce4e46..fd7826aab0fb 100644 --- a/tests/bluetooth/tester/src/btp/btp_gap.h +++ b/tests/bluetooth/tester/src/btp/btp_gap.h @@ -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; diff --git a/tests/bluetooth/tester/src/btp_gap.c b/tests/bluetooth/tester/src/btp_gap.c index fd5307fcc373..db179c8f2f10 100644 --- a/tests/bluetooth/tester/src/btp_gap.c +++ b/tests/bluetooth/tester/src/btp_gap.c @@ -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;