Skip to content

Commit

Permalink
Merge branch 'bugfix/fix_own_addr_is_rap_random_err' into 'master'
Browse files Browse the repository at this point in the history
Fixed no error report when own address type is rpa_random and no random address setting

Closes BLEQABR23-159

See merge request espressif/esp-idf!23363
  • Loading branch information
Weijian-Espressif committed Apr 26, 2023
2 parents 782acb1 + 7d1e7d2 commit 0b5b952
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 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 @@ -1068,7 +1068,18 @@ uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *
#else
uint32_t BTM_BleUpdateOwnType(uint8_t *own_bda_type, tBTM_START_ADV_CMPL_CBACK *cb)
{
if((*own_bda_type == BLE_ADDR_RANDOM) || (*own_bda_type == BLE_ADDR_RANDOM_ID)) {
if((btm_cb.ble_ctr_cb.addr_mgnt_cb.exist_addr_bit & BTM_BLE_GAP_ADDR_BIT_RANDOM) != BTM_BLE_GAP_ADDR_BIT_RANDOM) {
BTM_TRACE_ERROR("No random address yet, please set random address and try\n");
if(cb) {
(* cb)(HCI_ERR_ESP_VENDOR_FAIL);
}
return BTM_ILLEGAL_VALUE;
}
}

btm_cb.ble_ctr_cb.addr_mgnt_cb.own_addr_type = *own_bda_type;

return BTM_SUCCESS;
}
#endif
Expand Down

0 comments on commit 0b5b952

Please sign in to comment.