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

◆ pm_peer_data_load()

uint32_t pm_peer_data_load ( uint16_t peer_id,
enum pm_peer_data_id data_id,
void * data,
uint32_t * len )

#include <peer_manager.h>

Retrieve the stored data of a peer.

Note
The length of the provided buffer must be a multiple of 4 bytes.
Parameters
[in]peer_idPeer ID to get data for.
[in]data_idWhich type of data to read.
[out]dataWhere to put the retrieved data. The documentation for pm_peer_data_id specifies what data type each data ID is stored as.
[in,out]lenIn: The length in bytes of data. Out: The length in bytes of the read data, if the read was successful.
Return values
NRF_SUCCESSIf the data was read successfully.
NRF_ERROR_INVALID_PARAMIf the data type or the peer ID was invalid or unallocated.
NRF_ERROR_NULLIf a pointer parameter was NULL.
NRF_ERROR_NOT_FOUNDIf no stored data was found for this peer ID/data ID combination.
NRF_ERROR_DATA_SIZEIf the provided buffer was not large enough. The data is still copied, filling the provided buffer. Note that this error can occur even if loading the same size as was stored, because the underlying layers round the length up to the nearest word (4 bytes) when storing.
NRF_ERROR_INVALID_STATEIf the Peer Manager is not initialized.