Skip to content

Commit

Permalink
Merge branch 'bugfix/ble_fix_reconnect_failed_when_using_rpa_public_a…
Browse files Browse the repository at this point in the history
…ddress' into 'master'

Bugfix/ble fix reconnect failed when using rpa public address

Closes BT-1680

See merge request espressif/esp-idf!13741
  • Loading branch information
wmy-espressif committed May 28, 2021
2 parents dd0c1c7 + 8919322 commit 3a7dc7a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
11 changes: 9 additions & 2 deletions components/bt/host/bluedroid/stack/btu/btu_hcif.c
Original file line number Diff line number Diff line change
Expand Up @@ -2071,6 +2071,8 @@ static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len)
UINT8 num_reports = {0};
//UINT8 legacy_event_type = 0;
UINT16 evt_type = 0;
uint8_t addr_type;
BD_ADDR bda;

if (!p) {
HCI_TRACE_ERROR("%s, Invalid params.", __func__);
Expand Down Expand Up @@ -2102,8 +2104,13 @@ static void btu_ble_ext_adv_report_evt(UINT8 *p, UINT16 evt_len)
}
}

STREAM_TO_UINT8(ext_adv_report.addr_type, p);
STREAM_TO_BDADDR(ext_adv_report.addr, p);
STREAM_TO_UINT8(addr_type, p);
STREAM_TO_BDADDR(bda, p);
#if (defined BLE_PRIVACY_SPT && BLE_PRIVACY_SPT == TRUE)
btm_identity_addr_to_random_pseudo(bda, &addr_type, FALSE);
#endif
ext_adv_report.addr_type = addr_type;
memcpy(ext_adv_report.addr, bda, 6);
STREAM_TO_UINT8(ext_adv_report.primary_phy, p);
STREAM_TO_UINT8(ext_adv_report.secondry_phy, p);
STREAM_TO_UINT8(ext_adv_report.sid, p);
Expand Down
2 changes: 1 addition & 1 deletion components/bt/host/bluedroid/stack/l2cap/l2c_ble.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,7 +829,7 @@ BOOLEAN l2cble_init_direct_conn (tL2C_LCB *p_lcb)

#endif // (!CONTROLLER_RPA_LIST_ENABLE)

#if (CONTROLLER_RPA_LIST_ENABLE && CONFIG_BT_CTRL_ESP32)
#if (CONTROLLER_RPA_LIST_ENABLE)

if (p_dev_rec->ble.in_controller_list & BTM_RESOLVING_LIST_BIT) {
if (btm_cb.ble_ctr_cb.privacy_mode >= BTM_PRIVACY_1_2) {
Expand Down

0 comments on commit 3a7dc7a

Please sign in to comment.