forked from h2zero/esp-nimble-cpp
Fix build when host based privacy is enabled without connection roles
This commit is contained in:
@ -1069,18 +1069,16 @@ bool NimBLEDevice::setOwnAddrType(uint8_t type) {
|
||||
|
||||
m_ownAddrType = type;
|
||||
|
||||
# if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY)
|
||||
if (type == BLE_OWN_ADDR_RPA_PUBLIC_DEFAULT || type == BLE_OWN_ADDR_RPA_RANDOM_DEFAULT) {
|
||||
# ifdef CONFIG_IDF_TARGET_ESP32
|
||||
// esp32 controller does not support RPA so we must use the random static for calls to the stack
|
||||
// the host will take care of the random private address generation/setting.
|
||||
m_ownAddrType = BLE_OWN_ADDR_RANDOM;
|
||||
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_ENABLE_RPA);
|
||||
# endif
|
||||
} else {
|
||||
# ifdef CONFIG_IDF_TARGET_ESP32
|
||||
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_DISABLE_PRIVACY);
|
||||
# endif
|
||||
}
|
||||
# endif
|
||||
|
||||
return rc == 0;
|
||||
} // setOwnAddrType
|
||||
|
Reference in New Issue
Block a user