![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| uint32_t pm_id_addr_set | ( | const ble_gap_addr_t * | addr | ) |
#include <peer_manager.h>
Set the local Bluetooth identity address.
The local Bluetooth identity address is the address that identifies the device to other peers. The address type must be either BLE_GAP_ADDR_TYPE_PUBLIC or BLE_GAP_ADDR_TYPE_RANDOM_STATIC. The identity address cannot be changed while roles are running.
The SoftDevice sets a default address of type BLE_GAP_ADDR_TYPE_RANDOM_STATIC when it is enabled. This default address is a random number that is populated during the IC manufacturing process. It remains unchanged for the lifetime of each IC, but the application can use this function to assign a different identity address.
The identity address is distributed to the peer during bonding. Changing the identity address means that bonded devices might not recognize this device.
| [in] | addr | The GAP address to be set. |
| NRF_SUCCESS | If the identity address was set successfully. |
| NRF_ERROR_NULL | If addr is NULL. |
| NRF_ERROR_INVALID_ADDR | If the addr pointer is invalid. |
| BLE_ERROR_GAP_INVALID_BLE_ADDR | If the Bluetooth LE address is invalid. |
| NRF_ERROR_BUSY | If the SoftDevice was busy. Process SoftDevice events and retry. |
| NRF_ERROR_INVALID_STATE | If the Peer Manager is not initialized or if this function was called while advertising, scanning, or while connected. |
| NRF_ERROR_INTERNAL | If an internal error occurred. |