Skip to content

Commit a0a4cdb

Browse files
committed
Fix build when host based privacy is enabled without connection roles
1 parent 89a3b45 commit a0a4cdb

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/NimBLEDevice.cpp

+2-4
Original file line numberDiff line numberDiff line change
@@ -1038,18 +1038,16 @@ bool NimBLEDevice::setOwnAddrType(uint8_t type) {
10381038

10391039
m_ownAddrType = type;
10401040

1041+
# if MYNEWT_VAL(BLE_HOST_BASED_PRIVACY)
10411042
if (type == BLE_OWN_ADDR_RPA_PUBLIC_DEFAULT || type == BLE_OWN_ADDR_RPA_RANDOM_DEFAULT) {
1042-
# ifdef CONFIG_IDF_TARGET_ESP32
10431043
// esp32 controller does not support RPA so we must use the random static for calls to the stack
10441044
// the host will take care of the random private address generation/setting.
10451045
m_ownAddrType = BLE_OWN_ADDR_RANDOM;
10461046
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_ENABLE_RPA);
1047-
# endif
10481047
} else {
1049-
# ifdef CONFIG_IDF_TARGET_ESP32
10501048
rc = ble_hs_pvcy_rpa_config(NIMBLE_HOST_DISABLE_PRIVACY);
1051-
# endif
10521049
}
1050+
# endif
10531051

10541052
return rc == 0;
10551053
} // setOwnAddrType

0 commit comments

Comments
 (0)