mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Add function to set the identity address used by the controller/platform.
The function to get it has been removed as this operation is driven by the security manager.pull/13759/head
parent
5cb05958a9
commit
0b98682109
|
@ -220,21 +220,6 @@ ble_error_t PalSecurityManager::set_private_address_timeout(
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @see ::ble::PalSecurityManager::get_identity_address
|
|
||||||
*/
|
|
||||||
|
|
||||||
ble_error_t PalSecurityManager::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
|
// Keys
|
||||||
//
|
//
|
||||||
|
@ -288,6 +273,17 @@ ble_error_t PalSecurityManager::set_irk(const irk_t &irk)
|
||||||
return BLE_ERROR_NONE;
|
return BLE_ERROR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ble_error_t PalSecurityManager::set_identity_address(
|
||||||
|
const address_t &address,
|
||||||
|
bool public_address
|
||||||
|
)
|
||||||
|
{
|
||||||
|
DmSecSetLocalIdentityAddr(
|
||||||
|
address.data(),
|
||||||
|
public_address ? DM_ADDR_PUBLIC : DM_ADDR_RANDOM
|
||||||
|
);
|
||||||
|
return BLE_ERROR_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
ble_error_t PalSecurityManager::set_csrk(
|
ble_error_t PalSecurityManager::set_csrk(
|
||||||
const csrk_t &csrk,
|
const csrk_t &csrk,
|
||||||
|
|
|
@ -183,11 +183,6 @@ public:
|
||||||
*/
|
*/
|
||||||
ble_error_t set_private_address_timeout(uint16_t timeout_in_seconds) final;
|
ble_error_t set_private_address_timeout(uint16_t timeout_in_seconds) final;
|
||||||
|
|
||||||
/**
|
|
||||||
* @see ::ble::PalSecurityManager::get_identity_address
|
|
||||||
*/
|
|
||||||
ble_error_t get_identity_address(address_t &address, bool &public_address) final;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Keys
|
// Keys
|
||||||
//
|
//
|
||||||
|
@ -214,6 +209,13 @@ public:
|
||||||
*/
|
*/
|
||||||
ble_error_t set_irk(const irk_t &irk) final;
|
ble_error_t set_irk(const irk_t &irk) final;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @see ::ble::PalSecurityManager::set_identity_address
|
||||||
|
*/
|
||||||
|
ble_error_t set_identity_address(
|
||||||
|
const address_t &address, bool public_address
|
||||||
|
) final;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @see ::ble::PalSecurityManager::set_csrk
|
* @see ::ble::PalSecurityManager::set_csrk
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -761,20 +761,6 @@ public:
|
||||||
uint16_t timeout_in_seconds
|
uint16_t timeout_in_seconds
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
/**
|
|
||||||
* 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
|
|
||||||
*/
|
|
||||||
virtual ble_error_t get_identity_address(
|
|
||||||
address_t& address,
|
|
||||||
bool& public_address
|
|
||||||
) = 0;
|
|
||||||
|
|
||||||
////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////
|
||||||
// Keys
|
// Keys
|
||||||
//
|
//
|
||||||
|
@ -814,6 +800,18 @@ public:
|
||||||
virtual ble_error_t set_irk(
|
virtual ble_error_t set_irk(
|
||||||
const irk_t &irk
|
const irk_t &irk
|
||||||
) = 0;
|
) = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set the local identity address.
|
||||||
|
*
|
||||||
|
* @param[in] address identity address of the device
|
||||||
|
* @param[in] public_address true if a public address is used and false otherwise.
|
||||||
|
* @return BLE_ERROR_NONE On success, else an error code indicating reason for failure
|
||||||
|
*/
|
||||||
|
virtual ble_error_t set_identity_address(
|
||||||
|
const address_t &address, bool public_address
|
||||||
|
) = 0;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the local CSRK.
|
* Set the local CSRK.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in New Issue