A module for managing BLE bonding. This involves controlling encryption and pairing procedures as well as persistently storing different pieces of data that must be stored when bonded. More...
Modules | |
GATT Cache Manager | |
An internal module of Peer Manager. A module for managing persistent storing of GATT attributes. | |
GATT Client Cache Manager | |
An internal module of Peer Manager. A module for managing persistent storing of GATT attributes pertaining to the GATT client role of the local device. | |
GATT Server Cache Manager | |
An internal module of Peer Manager. A module for managing persistent storing of GATT attributes pertaining to the GATT server role of the local device. | |
ID Manager | |
An internal module of Peer Manager. A module for keeping track of peer identities (IRK and peer address). | |
Peer Data | |
An internal module of Peer Manager. This module defines the structure of the data that is managed by the Peer Manager. It also provides functions for parsing the data. | |
Peer Data Storage | |
An internal module of Peer Manager. This module provides a Peer Manager-specific API to the persistent storage. | |
Peer Database | |
An internal module of Peer Manager. A module for simple management of reading and writing of peer data into persistent storage. | |
Peer IDs | |
An internal module of Peer Manager. This module keeps track of which peer IDs are in use and which are free. | |
Buffer | |
An internal module of Peer Manager. This module provides a simple buffer. | |
Mutex | |
An internal module of Peer Manager. This module provides thread-safe mutexes. | |
Security Dispatcher | |
An internal module of Peer Manager. A module for streamlining pairing, bonding, and encryption, including flash storage of shared data. | |
Security Manager | |
An internal module of Peer Manager. A module for streamlining pairing, bonding, and encryption, including flash storage of shared data. | |
Data Structures | |
struct | pm_link_status_t |
Structure used to report the security status of a connection. More... | |
struct | pm_link_secured_evt_t |
Structure containing parameters specific to the PM_EVT_LINK_SECURED event. More... | |
struct | pm_sec_error_t |
Type describing all errors that can occur asynchronously when securing a link. More... | |
struct | pm_link_secure_failed_evt_t |
Structure containing parameters specific to the PM_EVT_LINK_SECURE_FAILED event. More... | |
struct | pm_peer_data_update_t |
Structure containing parameters specific to the PM_EVT_PEER_DATA_UPDATED event. More... | |
struct | pm_peer_data_update_failed_t |
Structure containing parameters specific to the PM_EVT_PEER_DATA_UPDATE_FAILED event. More... | |
struct | pm_error_unexpected_evt_t |
Structure containing parameters specific to the PM_EVT_ERROR_UNEXPECTED event. More... | |
struct | pm_evt_t |
Structure describing events from the Peer Manager module. More... | |
struct | pm_peer_data_bonding_t |
Data associated with a bond to a peer. More... | |
struct | pm_peer_data_local_gatt_db_t |
Data on a local GATT database. More... | |
struct | pm_peer_data_local_gatt_db_flash_t |
Data on a local GATT database, as formatted in flash. More... | |
struct | pm_peer_data_remote_gatt_db_t |
Data on a remote GATT database. More... | |
struct | pm_peer_data_remote_gatt_db_flash_t |
Data on a remote GATT database, as formatted in flash. More... | |
union | pm_peer_data_unit_t |
Union of all data associated with one peer. More... | |
union | pm_peer_data_unit_const_t |
Immutable version of pm_peer_data_unit_t. More... | |
union | pm_peer_data_unit_flash_t |
Data from pm_peer_data_unit_t, as mapped in flash. More... | |
struct | pm_peer_data_t |
One piece of data associated with a peer, together with the type. More... | |
struct | pm_peer_data_const_t |
Immutable version of pm_peer_data_t. More... | |
struct | pm_peer_data_flash_t |
Data from pm_peer_data_t, as mapped in flash. More... | |
Macros | |
#define | PM_PEER_ID_INVALID 0xFFFF |
#define | PM_PEER_ID_N_AVAILABLE_IDS 256 |
#define | PM_LOCAL_DB_LEN_OVERHEAD_BYTES offsetof(pm_peer_data_local_gatt_db_flash_t, p_data) |
#define | PM_REMOTE_DB_LEN_OVERHEAD_BYTES offsetof(pm_peer_data_remote_gatt_db_flash_t, p_data) |
Typedefs | |
typedef void(* | pm_evt_handler_t )(pm_evt_t const *p_event) |
Event handler for events from the Peer Manager module. More... | |
typedef uint16_t | pm_peer_id_t |
Handle to uniquely identify a peer for which we have persistently stored data. | |
typedef uint32_t | pm_prepare_token_t |
Typedef for type used for write prepares. Used to reserve space in flash. | |
typedef uint32_t | pm_store_token_t |
Typedef for type used to hold reference to stored item in flash. this token can be used for locking and validity check. | |
Enumerations | |
enum | pm_evt_id_t { PM_EVT_BONDED_PEER_CONNECTED, PM_EVT_LINK_SECURED, PM_EVT_LINK_SECURE_FAILED, PM_EVT_STORAGE_FULL, PM_EVT_ERROR_UNEXPECTED, PM_EVT_PEER_DATA_UPDATED, PM_EVT_PEER_DATA_UPDATE_FAILED, PM_EVT_ERROR_LOCAL_DB_CACHE_APPLY, PM_EVT_LOCAL_DB_CACHE_APPLIED, PM_EVT_SERVICE_CHANGED_INDICATION_SENT } |
Enum of the events that can come from the Peer Manager module. More... | |
enum | pm_error_type_t { PM_ERROR_TYPE_SEC_STATUS, PM_ERROR_TYPE_PM_SEC_ERROR } |
The different types of errors that can cause security establishment to fail. More... | |
enum | pm_peer_data_action_t { PM_PEER_DATA_ACTION_UPDATE, PM_PEER_DATA_ACTION_CLEAR } |
Actions that can be performed to peer data in persistent storage. More... | |
enum | pm_sec_error_code_t { PM_SEC_ERROR_CODE_PIN_OR_KEY_MISSING = BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING, PM_SEC_ERROR_CODE_MIC_FAILURE = BLE_HCI_CONN_TERMINATED_DUE_TO_MIC_FAILURE, PM_SEC_ERROR_SMP_TIMEOUT } |
Errors originating from the Peer Manager module. More... | |
enum | pm_sec_procedure_t { PM_LINK_SECURED_PROCEDURE_ENCRYPTION, PM_LINK_SECURED_PROCEDURE_BONDING, PM_LINK_SECURED_PROCEDURE_PAIRING } |
Enumeration describing the different procedures that can lead to an encrypted link. More... | |
enum | pm_peer_data_id_t { PM_PEER_DATA_ID_BONDING, PM_PEER_DATA_ID_SERVICE_CHANGED_PENDING, PM_PEER_DATA_ID_GATT_LOCAL, PM_PEER_DATA_ID_GATT_REMOTE, PM_PEER_DATA_ID_APPLICATION, PM_PEER_DATA_ID_INVALID } |
The different types of data associated with a peer. | |
Functions | |
ret_code_t | pm_init (void) |
Function for initializing the Peer Manager. More... | |
ret_code_t | pm_register (pm_evt_handler_t event_handler) |
Function for registering with the Peer Manager. More... | |
ret_code_t | pm_sec_params_set (ble_gap_sec_params_t *p_sec_params) |
Function for providing pairing and bonding parameters to use for pairing procedures. More... | |
void | pm_ble_evt_handler (ble_evt_t *p_ble_evt) |
Function for passing BLE events to the Peer Manager. More... | |
ret_code_t | pm_link_secure (uint16_t conn_handle, bool force_repairing) |
Function for encrypting a link, and optionally establishing a bond. More... | |
ret_code_t | pm_sec_params_reply (uint16_t conn_handle, ble_gap_sec_params_t *p_sec_params) |
Function for replying with desired security parameters for a specific link. More... | |
void | pm_local_database_has_changed (void) |
Function for manually informing that the local database has changed. More... | |
ret_code_t | pm_link_status_get (uint16_t conn_handle, pm_link_status_t *p_link_status) |
Function for getting the security status of a connection. More... | |
ret_code_t | pm_wlist_create (pm_peer_id_t *p_peer_ids, uint8_t n_peer_ids, ble_gap_whitelist_t *p_whitelist) |
Function for constructing a whitelist for use when advertising. More... | |
ret_code_t | pm_wlist_set (ble_gap_whitelist_t *p_whitelist) |
Function for informing this module of what whitelist will be used. More... | |
ret_code_t | pm_conn_handle_get (pm_peer_id_t peer_id, uint16_t *p_conn_handle) |
Function for getting the corresponding connection handle based on the Peer ID. More... | |
ret_code_t | pm_peer_id_get (uint16_t conn_handle, pm_peer_id_t *p_peer_id) |
Function for getting the corresponding peer ID based on the connection handle. More... | |
pm_peer_id_t | pm_next_peer_id_get (pm_peer_id_t prev_peer_id) |
Function for getting the next peer ID in the sequence of all used peer IDs. Can be used to loop through all used peer IDs. More... | |
uint32_t | pm_n_peers (void) |
Function for querying the number of valid peer IDs available (i.e the number of peers there exists data for in persistent storage). More... | |
ret_code_t | pm_peer_data_get (pm_peer_id_t peer_id, pm_peer_data_id_t data_id, pm_peer_data_t *p_peer_data) |
Function for retrieving (copying out) stored data for a peer. More... | |
ret_code_t | pm_peer_data_store (pm_peer_id_t peer_id, pm_peer_data_const_t *p_peer_data, pm_store_token_t *p_token) |
Function for setting/updating the stored data for a peer. More... | |
ret_code_t | pm_peer_data_clear (pm_peer_id_t peer_id, pm_peer_data_id_t data_id) |
Function for deleting a peer's stored data. More... | |
ret_code_t | pm_peer_new (pm_peer_data_bonding_t *p_bonding_data, pm_peer_id_t *p_new_peer_id, pm_store_token_t *p_token) |
Function for registering persistent storage for a new peer. More... | |
void | pm_peer_delete (pm_peer_id_t peer_id) |
Function for freeing persistent storage for a peer. More... | |
void | pm_peer_delete_all (void) |
Function for deleting all data stored for all peers. More... | |
static __INLINE uint16_t | PM_N_WORDS (uint16_t n_bytes) |
static __INLINE uint16_t | PM_BONDING_DATA_N_WORDS (void) |
Function for calculating the flash size of bonding data. More... | |
static __INLINE uint16_t | PM_SC_STATE_N_WORDS (void) |
Function for calculating the flash size of service changed pending state. More... | |
static __INLINE uint16_t | PM_LOCAL_DB_N_WORDS (uint16_t local_db_len) |
Function for calculating the flash size of local GATT database data. More... | |
static __INLINE uint16_t | PM_LOCAL_DB_LEN (uint16_t n_words) |
Function for calculating the length of a local GATT database attribute array. More... | |
static __INLINE uint16_t | PM_REMOTE_DB_N_WORDS (uint16_t service_count) |
Function for calculating the flash size of remote GATT database data. More... | |
static __INLINE bool | PM_PEER_DATA_ID_IS_VALID (pm_peer_data_id_t data_id) |
Macro saying whether a data_id is valid, i.e. one of the valid enum values. More... | |
A module for managing BLE bonding. This involves controlling encryption and pairing procedures as well as persistently storing different pieces of data that must be stored when bonded.
The API consists of functions for configuring the pairing/encryption behavior of the device, and functions for manipulation of the stored data.
#define PM_PEER_ID_INVALID 0xFFFF |
Invalid value for pm_peer_id_t.
#define PM_PEER_ID_N_AVAILABLE_IDS 256 |
The number of available peer IDs.
typedef void(* pm_evt_handler_t)(pm_evt_t const *p_event) |
Event handler for events from the Peer Manager module.
[in] | p_event | The event that has happened. |
enum pm_error_type_t |
The different types of errors that can cause security establishment to fail.
Enumerator | |
---|---|
PM_ERROR_TYPE_SEC_STATUS |
Error is in the range defined in GAP Security status. |
PM_ERROR_TYPE_PM_SEC_ERROR |
Error is of type pm_sec_error_code_t. |
enum pm_evt_id_t |
Enum of the events that can come from the Peer Manager module.
Enumerator | |
---|---|
PM_EVT_BONDED_PEER_CONNECTED |
A connected peer has been identified as one with which we have a bond. |
PM_EVT_LINK_SECURED |
A link has been encrypted, either as a result of a call to pm_link_secure, or of action by the peer. The event structure contains more information about the circumstances. |
PM_EVT_LINK_SECURE_FAILED |
A pairing or encryption procedure has failed. In most cases, this will mean that security is not possible on this link. |
PM_EVT_STORAGE_FULL |
There is no more room for peer data in flash storage. This must be mitigated by performing a compress procedure in FDS, possibly preceded by deleting some information. |
PM_EVT_ERROR_UNEXPECTED |
An operation failed with an unexpected error. The error is provided. This is possibly a fatal error. |
PM_EVT_PEER_DATA_UPDATED |
A piece of peer data was stored, updated, or cleared in flash storage. |
PM_EVT_PEER_DATA_UPDATE_FAILED |
A piece of peer data was attempted stored, updated, or cleared in flash storage, but failed. |
PM_EVT_ERROR_LOCAL_DB_CACHE_APPLY |
The stored local database values for a peer were rejected by the SoftDevice, which means the database has changed. |
PM_EVT_LOCAL_DB_CACHE_APPLIED |
The SoftDevice has been given local database values from the persistent cache, for one peer. |
PM_EVT_SERVICE_CHANGED_INDICATION_SENT |
A service changed indication has been sent to and confirmed by a peer. |
enum pm_sec_error_code_t |
Errors originating from the Peer Manager module.
enum pm_sec_procedure_t |
Enumeration describing the different procedures that can lead to an encrypted link.
void pm_ble_evt_handler | ( | ble_evt_t * | p_ble_evt | ) |
Function for passing BLE events to the Peer Manager.
[in] | p_ble_evt | BLE stack event being dispatched to the function. |
|
static |
Function for calculating the flash size of bonding data.
ret_code_t pm_conn_handle_get | ( | pm_peer_id_t | peer_id, |
uint16_t * | p_conn_handle | ||
) |
Function for getting the corresponding connection handle based on the Peer ID.
[out] | peer_id | Peer ID. |
[in] | p_conn_handle | Corresponding connection handle. BLE_INVALID_CONN_HANDLE if peer is not connected. |
NRF_SUCCESS | Connection handle retrieved successfully. |
NRF_ERROR_NULL | p_conn_handle was NULL. |
ret_code_t pm_init | ( | void | ) |
Function for initializing the Peer Manager.
NRF_SUCCESS | Initialization was successful. |
NRF_ERROR_INVALID_STATE | FDS not initialized. |
NRF_ERROR_NULL | p_init_params was NULL. |
NRF_ERROR_INTERNAL | An unexpected internal error occurred. |
ret_code_t pm_link_secure | ( | uint16_t | conn_handle, |
bool | force_repairing | ||
) |
Function for encrypting a link, and optionally establishing a bond.
The actions taken by this function is partly dictated by the parameters given in the pm_sec_params_set.
[in] | conn_handle | Connection handle of the link as provided by the SoftDevice. |
[in] | force_repairing | Whether to force a pairing procedure to happen regardless of whether an encryption key already exists. This argument is only relevant for the central role. Recommended value: false |
NRF_SUCCESS | Success. |
NRF_ERROR_TIMEOUT | There has been an SMP timeout, so no more SMP operations can be performed on this link. |
BLE_ERROR_INVALID_CONN_HANDLE | Invalid connection handle. |
NRF_ERROR_NOT_FOUND | Security parameters have not been set. |
NRF_ERROR_INVALID_STATE | Module is not initialized, or the peer is disconnected or in the process of disconnecting. |
NRF_ERROR_INTERNAL | An unexpected error occurred. |
ret_code_t pm_link_status_get | ( | uint16_t | conn_handle, |
pm_link_status_t * | p_link_status | ||
) |
Function for getting the security status of a connection.
[in] | conn_handle | Connection handle of the link as provided by the SoftDevice. |
[out] | p_link_status | Security status of the link. |
NRF_SUCCESS | Pairing initiated successfully. |
NRF_ERROR_INVALID_PARAM | conn_handle is invalid or does not refer to an active connection. |
NRF_ERROR_NULL | p_link_status was NULL. |
void pm_local_database_has_changed | ( | void | ) |
Function for manually informing that the local database has changed.
This causes a service changed indication to be sent to all bonded peers that subscribe to it.
|
static |
Function for calculating the length of a local GATT database attribute array.
[in] | n_words | The number of words the data takes in flash. |
|
static |
Function for calculating the flash size of local GATT database data.
[in] | local_db_len | The length of the database as reported by the SoftDevice. |
uint32_t pm_n_peers | ( | void | ) |
Function for querying the number of valid peer IDs available (i.e the number of peers there exists data for in persistent storage).
pm_peer_id_t pm_next_peer_id_get | ( | pm_peer_id_t | prev_peer_id | ) |
Function for getting the next peer ID in the sequence of all used peer IDs. Can be used to loop through all used peer IDs.
[in] | prev_peer_id | The previous peer ID. |
PM_PEER_ID_INVALID | if prev_peer_id was the last used peer ID. |
ret_code_t pm_peer_data_clear | ( | pm_peer_id_t | peer_id, |
pm_peer_data_id_t | data_id | ||
) |
Function for deleting a peer's stored data.
[in] | peer_id | Peer ID to clear info for. |
[in] | data_id | Which data to clear. Bonding data cannot be cleared, use pm_peer_delete |
NRF_SUCCESS | Data will be cleared in persistent storage ASAP. |
NRF_ERROR_INVALID_PARAM | Attempted to delete bonding data or data id was invalid. |
NRF_ERROR_NOT_FOUND | Nothing to clear for this data for this peer ID. |
NRF_ERROR_BUSY | Could not process request at this time. Reattempt later. |
NRF_ERROR_INVALID_STATE | Module is not initialized. |
ret_code_t pm_peer_data_get | ( | pm_peer_id_t | peer_id, |
pm_peer_data_id_t | data_id, | ||
pm_peer_data_t * | p_peer_data | ||
) |
Function for retrieving (copying out) stored data for a peer.
[in] | peer_id | Peer ID to get info for. |
[in] | data_id | Which piece of data to read. |
[in,out] | p_peer_data | Where to store the data. If the data to be read has variable length, the appropriate length field needs to reflect the available buffer space. On a successful read, the length field is updated to match the length of the read data. |
NRF_SUCCESS | Data successfully read. |
NRF_ERROR_INVALID_PARAM | Data ID or Peer ID was invalid or unallocated. |
NRF_ERROR_NULL | p_peer_data contained a NULL pointer. |
NRF_ERROR_NOT_FOUND | This data was not found for this peer ID. |
NRF_ERROR_DATA_SIZE | The provided buffer was not large enough. |
NRF_ERROR_INVALID_STATE | Module is not initialized. |
|
static |
Macro saying whether a data_id is valid, i.e. one of the valid enum values.
[in] | data_id | The data_id to check. |
ret_code_t pm_peer_data_store | ( | pm_peer_id_t | peer_id, |
pm_peer_data_const_t * | p_peer_data, | ||
pm_store_token_t * | p_token | ||
) |
Function for setting/updating the stored data for a peer.
[in] | peer_id | Peer ID to get info for. |
[in] | p_peer_data | Data to set. For values that are NULL, the stored data will not be touched. |
[out] | p_token | A token identifying this particular store operation. The token can be used to identify events pertaining to this operation. |
NRF_SUCCESS | Data will be written to persistent storage ASAP. |
NRF_ERROR_NULL | p_peer_data is NULL. |
NRF_ERROR_NOT_FOUND | No peer found for that peer ID. |
NRF_ERROR_BUSY | Bonding procedure is in progress, so data integrity cannot be guaranteed. |
void pm_peer_delete | ( | pm_peer_id_t | peer_id | ) |
Function for freeing persistent storage for a peer.
[in] | peer_id | Peer ID to be freed. |
void pm_peer_delete_all | ( | void | ) |
Function for deleting all data stored for all peers.
ret_code_t pm_peer_id_get | ( | uint16_t | conn_handle, |
pm_peer_id_t * | p_peer_id | ||
) |
Function for getting the corresponding peer ID based on the connection handle.
[in] | conn_handle | Connection handle as provided by the SoftDevice. |
[out] | p_peer_id | Corresponding peer ID. |
NRF_SUCCESS | Peer ID retrieved successfully. |
NRF_ERROR_NULL | p_peer_id was NULL. |
NRF_ERROR_NOT_FOUND | No peer ID was found for the connection handle. This means that there is no bond with the connected peer, or the conn_handle does not refer to an active connection. |
ret_code_t pm_peer_new | ( | pm_peer_data_bonding_t * | p_bonding_data, |
pm_peer_id_t * | p_new_peer_id, | ||
pm_store_token_t * | p_token | ||
) |
Function for registering persistent storage for a new peer.
[in] | p_bonding_data | The bonding data of the new peer. This must be provided to avoid inconsistencies (duplicate entries). Must contain a public/static address or a non-zero master ID. |
[out] | p_new_peer_id | Peer ID for the new peer, or an existing peer if a match was found. |
[out] | p_token | A token identifying this particular store operation (storing the bonding data). The token can be used to identify events pertaining to this operation. |
NRF_SUCCESS | Store operation for bonding data started successfully. |
NRF_ERROR_NULL | A parameter is NULL. |
NRF_ERROR_NO_MEM | No more space in persistent storage. New peer cannot be allocated. |
NRF_ERROR_BUSY | Operation cannot be performed at this time. Try again later. |
NRF_ERROR_INVALID_PARAM | Bonding data is invalid. |
NRF_ERROR_INVALID_STATE | Peer Manager not initialized. |
ret_code_t pm_register | ( | pm_evt_handler_t | event_handler | ) |
Function for registering with the Peer Manager.
[in] | event_handler | Callback for events from the Peer Manager module. |
NRF_SUCCESS | Initialization was successful. |
NRF_ERROR_INVALID_STATE | Peer Manager not initialized. |
NRF_ERROR_NULL | p_init_params was NULL. |
|
static |
Function for calculating the flash size of remote GATT database data.
[in] | service_count | The number of services in the service array. |
|
static |
Function for calculating the flash size of service changed pending state.
ret_code_t pm_sec_params_reply | ( | uint16_t | conn_handle, |
ble_gap_sec_params_t * | p_sec_params | ||
) |
Function for replying with desired security parameters for a specific link.
This function must be called if and only if a PM_EVT_SEC_PARAMS_REQ event was received. The PM_EVT_SEC_PARAMS_REQ is received only if the always_ask_for_sec_params option was set during initialization.
[in] | conn_handle | The link to set the security parameters for. |
[in] | p_sec_params | The security parameters to set for the link. |
NRF_SUCCESS | Successfully set security parameters. |
BLE_ERROR_INVALID_CONN_HANDLE | Connection handle does not refer to an active connection. |
NRF_ERROR_FORBIDDEN | Security parameters have not been requested on this link. |
NRF_ERROR_INVALID_PARAM | Invalid value or combination in security parameters. |
ret_code_t pm_sec_params_set | ( | ble_gap_sec_params_t * | p_sec_params | ) |
Function for providing pairing and bonding parameters to use for pairing procedures.
Until this is called, all bonding procedures initiated by the peer will be rejected. This function can be called multiple times, even with NULL p_sec_params, in which case it will go back to rejecting all procedures.
[in] | p_sec_params | Security parameters to be used for all security procedures. |
NRF_SUCCESS | Success. |
NRF_ERROR_INVALID_PARAM | Invalid combination of parameters. |
NRF_ERROR_INVALID_STATE | Module is not initialized. |
NRF_ERROR_INTERNAL | An unexpected internal error occurred. |
ret_code_t pm_wlist_create | ( | pm_peer_id_t * | p_peer_ids, |
uint8_t | n_peer_ids, | ||
ble_gap_whitelist_t * | p_whitelist | ||
) |
Function for constructing a whitelist for use when advertising.
Construct a whitelist containing the addresses and IRKs of the provided peer IDs. If p_peer_ids is NULL, the first (lowest) peer IDs will be chosen. If pp_addrs in p_whitelist is NULL, the whitelist will contain only IRKs, and vice versa.
[in] | p_peer_ids | The ids of the peers to be added to the whitelist. |
[in] | n_peer_ids | The number of peer ids in p_peer_ids. |
[in,out] | p_whitelist | The constructed whitelist. Note that p_adv_whitelist->pp_addrs must be NULL or point to an array with size BLE_GAP_WHITELIST_ADDR_MAX_COUNT and p_adv_whitelist->pp_irks must be NULL or point to an array with size BLE_GAP_WHITELIST_IRK_MAX_COUNT. |
NRF_SUCCESS | Whitelist successfully created. |
NRF_ERROR_NULL | p_whitelist was NULL. |
ret_code_t pm_wlist_set | ( | ble_gap_whitelist_t * | p_whitelist | ) |
Function for informing this module of what whitelist will be used.
This function is meant to be used when the app wants to use a custom whitelist. When using peer manager, this function must be used if a custom whitelist is used.
[in] | p_whitelist | The whitelist. |
NRF_SUCCESS | Whitelist successfully set. |
NRF_ERROR_NULL | p_whitelist was NULL. |
NRF_ERROR_NOT_FOUND | One or more of the whitelists irks was not found in the peer_database. |