mirror of https://github.com/ARMmbed/mbed-os.git
expose identity address used by controller
parent
d6a5bd2825
commit
94a6cac838
|
@ -967,6 +967,22 @@ public:
|
|||
return impl()->set_private_address_timeout(timeout_in_seconds);
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the identity address used by the controller
|
||||
*
|
||||
* @param address Will contain the address retrieved.
|
||||
* @param public_address will be true if the address is public and false
|
||||
* otherwise.
|
||||
* @return BLE_ERROR_NONE On success, else an error code indicating the reason
|
||||
* of the failure
|
||||
*/
|
||||
ble_error_t get_identity_address(
|
||||
address_t& address,
|
||||
bool& public_address
|
||||
) {
|
||||
return impl()->get_identity_address_(address, public_address);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Keys
|
||||
//
|
||||
|
|
|
@ -212,6 +212,11 @@ public:
|
|||
*/
|
||||
ble_error_t set_private_address_timeout_(uint16_t timeout_in_seconds);
|
||||
|
||||
/**
|
||||
* @see ::ble::pal::SecurityManager::get_identity_address
|
||||
*/
|
||||
ble_error_t get_identity_address_(address_t& address, bool& public_address);
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Keys
|
||||
//
|
||||
|
|
|
@ -279,6 +279,20 @@ ble_error_t CordioSecurityManager<EventHandler>::set_private_address_timeout_(
|
|||
return BLE_ERROR_NONE;
|
||||
}
|
||||
|
||||
/**
|
||||
* @see ::ble::pal::SecurityManager::get_identity_address
|
||||
*/
|
||||
template <class EventHandler>
|
||||
ble_error_t CordioSecurityManager<EventHandler>::get_identity_address_(
|
||||
address_t& address,
|
||||
bool& public_address
|
||||
) {
|
||||
// On cordio, the public address is hardcoded as the identity address.
|
||||
address = address_t(HciGetBdAddr());
|
||||
public_address = true;
|
||||
return BLE_ERROR_NONE;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////
|
||||
// Keys
|
||||
//
|
||||
|
|
Loading…
Reference in New Issue