From da31f90436b75b260d63d888611fed02ddf62d5f Mon Sep 17 00:00:00 2001 From: h2zero Date: Fri, 25 Apr 2025 15:59:20 -0600 Subject: [PATCH] Fix build when host based privacy is enabled without connection roles --- src/NimBLEDevice.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/NimBLEDevice.cpp b/src/NimBLEDevice.cpp index 826e660..8578c48 100644 --- a/src/NimBLEDevice.cpp +++ b/src/NimBLEDevice.cpp @@ -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