mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2025-07-30 10:27:14 +02:00
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;
|
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) {
|
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
|
// 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.
|
// the host will take care of the random private address generation/setting.
|
||||||
m_ownAddrType = BLE_OWN_ADDR_RANDOM;
|
m_ownAddrType = BLE_OWN_ADDR_RANDOM;
|
||||||
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_ENABLE_RPA);
|
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_ENABLE_RPA);
|
||||||
# endif
|
|
||||||
} else {
|
} else {
|
||||||
# ifdef CONFIG_IDF_TARGET_ESP32
|
|
||||||
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_DISABLE_PRIVACY);
|
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_DISABLE_PRIVACY);
|
||||||
# endif
|
|
||||||
}
|
}
|
||||||
|
# endif
|
||||||
|
|
||||||
return rc == 0;
|
return rc == 0;
|
||||||
} // setOwnAddrType
|
} // setOwnAddrType
|
||||||
|
Reference in New Issue
Block a user