diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.cpp b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.cpp index e63345900e..fec4ff6885 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.cpp +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.cpp @@ -208,11 +208,8 @@ nRF5xSecurityManager::get_resolving_list() { ); } -bool nRF5xSecurityManager::resolve_address( - const address_t& resolvable_address, - advertising_peer_address_type_t& resolved_address_type, - address_t& resolved_address -) { +const nRF5xSecurityManager::resolving_list_entry_t* +nRF5xSecurityManager::resolve_address(const address_t& resolvable_address) { typedef byte_array_t hash_t; for (size_t i = 0; i < resolving_list_entry_count; ++i) { @@ -233,14 +230,14 @@ bool nRF5xSecurityManager::resolve_address( // parameter. If they are equal then the IRK of the entry has been used // to generate the resolvable address. if (memcmp(hash_generated.data(), resolvable_address.data(), CryptoToolbox::hash_size_) == 0) { - resolved_address_type = entry.peer_identity_address_type; - resolved_address = entry.peer_identity_address; - return true; + return &entry; } } - return false; + return NULL; } + + //////////////////////////////////////////////////////////////////////////// // Pairing // diff --git a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.h b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.h index d358af79b2..bd9206b790 100644 --- a/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.h +++ b/features/FEATURE_BLE/targets/TARGET_NORDIC/TARGET_NRF5/source/nRF5xPalSecurityManager.h @@ -109,14 +109,11 @@ public: * Try to resolve a private resolvable address. * * @param resolvable_address The address to resolve. - * @param resolved_address_type The type of the identity address resolved. - * @param resolved_address The identity address resolved. - * @return True if the address has been resolved and false otherwise. + * + * @return Pointer to the entry found if any. */ - bool resolve_address( - const address_t& resolvable_address, - advertising_peer_address_type_t& resolved_address_type, - address_t& resolved_address + const resolving_list_entry_t* resolve_address( + const address_t& resolvable_address );