tests: bluetooth: tester: Adjust Directed Advertising to latest BTP
This makes implementation in sync with autopts. Signed-off-by: Szymon Janc <szymon.janc@codecoup.pl>
This commit is contained in:
parent
addfef959a
commit
03487ec592
2 changed files with 9 additions and 4 deletions
|
@ -228,12 +228,15 @@ struct gap_passkey_confirm_cmd {
|
|||
uint8_t match;
|
||||
} __packed;
|
||||
|
||||
#define GAP_START_DIRECTED_ADV_HD 0x0001
|
||||
#define GAP_START_DIRECTED_ADV_OWN_ID 0x0002
|
||||
#define GAP_START_DIRECTED_ADV_PEER_RPA 0x0004
|
||||
|
||||
#define GAP_START_DIRECTED_ADV 0x15
|
||||
struct gap_start_directed_adv_cmd {
|
||||
uint8_t address_type;
|
||||
uint8_t address[6];
|
||||
uint8_t high_duty;
|
||||
uint8_t own_id_addr;
|
||||
uint16_t options;
|
||||
} __packed;
|
||||
struct gap_start_directed_adv_rp {
|
||||
uint32_t current_settings;
|
||||
|
|
|
@ -494,10 +494,12 @@ static void start_directed_advertising(const uint8_t *data, uint16_t len)
|
|||
const struct gap_start_directed_adv_cmd *cmd = (void *)data;
|
||||
struct gap_start_directed_adv_rp rp;
|
||||
struct bt_le_adv_param adv_param;
|
||||
uint16_t options = sys_le16_to_cpu(cmd->options);
|
||||
const bt_addr_le_t *peer = (bt_addr_le_t *)data;
|
||||
|
||||
adv_param = *BT_LE_ADV_CONN_DIR((bt_addr_le_t *)data);
|
||||
adv_param = *BT_LE_ADV_CONN_DIR(peer);
|
||||
|
||||
if (cmd->high_duty == 0) {
|
||||
if (!(options & GAP_START_DIRECTED_ADV_HD)) {
|
||||
adv_param.options |= BT_LE_ADV_OPT_DIR_MODE_LOW_DUTY;
|
||||
adv_param.interval_max = BT_GAP_ADV_FAST_INT_MAX_2;
|
||||
adv_param.interval_min = BT_GAP_ADV_FAST_INT_MIN_2;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue