nRF Connect SDK Bare Metal API 2.0.99
Loading...
Searching...
No Matches

◆ pm_peer_delete()

uint32_t pm_peer_delete ( uint16_t peer_id)

#include <peer_manager.h>

Delete all data stored for a peer and free the peer ID.

This function deletes every piece of data that is associated with the specified peer and frees the peer ID to be used for another peer. The deletion happens asynchronously, and the peer ID is not freed until the data is deleted. When the operation finishes, a PM_EVT_PEER_DELETE_SUCCEEDED or PM_EVT_PEER_DELETE_FAILED event is sent.

Warning
Use this function only when not connected to or connectable for the peer that is being deleted. If the peer is or becomes connected or data is manually written in storage during this procedure (until the success or failure event happens), the behavior is undefined.
Parameters
[in]peer_idPeer ID to be freed and have all associated data deleted.
Return values
NRF_SUCCESSIf the operation was initiated successfully.
NRF_ERROR_INVALID_PARAMIf the peer ID was not valid.
NRF_ERROR_INVALID_STATEIf the Peer Manager is not initialized.