Skip to content

Commit

Permalink
fix(ble/bluedroid): Fixed BLE set adv param check
Browse files Browse the repository at this point in the history
  • Loading branch information
esp-zhp committed Jul 10, 2024
1 parent 095a0dd commit c3af6db
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions components/bt/host/bluedroid/stack/btm/btm_ble_gap.c
Original file line number Diff line number Diff line change
Expand Up @@ -388,6 +388,12 @@ void BTM_BleUpdateAdvFilterPolicy(tBTM_BLE_AFP adv_policy)
&p_cb->adv_addr_type);
}

uint8_t null_addr[BD_ADDR_LEN] = {0};
if ((p_cb->evt_type == 0x01 || p_cb->evt_type == 0x04) && memcmp(p_addr_ptr, null_addr, BD_ADDR_LEN) == 0) {
/* directed advertising */
return;
}

btsnd_hcic_ble_write_adv_params ((UINT16)(p_cb->adv_interval_min ? p_cb->adv_interval_min :
BTM_BLE_GAP_ADV_SLOW_INT),
(UINT16)(p_cb->adv_interval_max ? p_cb->adv_interval_max :
Expand Down

0 comments on commit c3af6db

Please sign in to comment.