Skip to content

Commit da31f90

Browse files
committed
Fix build when host based privacy is enabled without connection roles
1 parent e55ad90 commit da31f90

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/NimBLEDevice.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1069,18 +1069,16 @@ bool NimBLEDevice::setOwnAddrType(uint8_t type) {
10691069

10701070
m_ownAddrType = type;
10711071

1072+
# if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY)
10721073
if (type == BLE_OWN_ADDR_RPA_PUBLIC_DEFAULT || type == BLE_OWN_ADDR_RPA_RANDOM_DEFAULT) {
1073-
# ifdef CONFIG_IDF_TARGET_ESP32
10741074
// esp32 controller does not support RPA so we must use the random static for calls to the stack
10751075
// the host will take care of the random private address generation/setting.
10761076
m_ownAddrType = BLE_OWN_ADDR_RANDOM;
10771077
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_ENABLE_RPA);
1078-
# endif
10791078
} else {
1080-
# ifdef CONFIG_IDF_TARGET_ESP32
10811079
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_DISABLE_PRIVACY);
1082-
# endif
10831080
}
1081+
# endif
10841082

10851083
return rc == 0;
10861084
} // setOwnAddrType

0 commit comments

Comments
 (0)