![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| uint32_t pm_peer_data_store | ( | uint16_t | peer_id, |
| enum pm_peer_data_id | data_id, | ||
| const void * | data, | ||
| uint32_t | len, | ||
| uint32_t * | token ) |
#include <peer_manager.h>
Set or update stored data of a peer.
data_id PM_PEER_DATA_ID_GATT_REMOTE PM_PEER_DATA_ID_APPLICATION is never (over)written internally.| [in] | peer_id | Peer ID to set data for. |
| [in] | data_id | The type of data to set. |
| [in] | data | New value to set. The documentation for pm_peer_data_id specifies what data type each data ID should be stored as. |
| [in] | len | The length in bytes of data. |
| [out] | token | A token that identifies this particular store operation. The token can be used to identify events that pertain to this operation. This parameter can be NULL. |
| NRF_SUCCESS | If the data is scheduled to be written to persistent storage. |
| NRF_ERROR_NULL | If data is NULL. |
| NRF_ERROR_NOT_FOUND | If no peer was found for the peer ID. |
| NRF_ERROR_INVALID_ADDR | If data is not word-aligned (4 bytes). |
| NRF_ERROR_BUSY | If the underlying storage handler is busy with other storage operations. Try again after receiving a Peer Manager event. |
| NRF_ERROR_RESOURCES | If there is not enough space in non-volatile storage. |
| NRF_ERROR_FORBIDDEN | If data ID is PM_PEER_DATA_ID_BONDING and the new bonding data also corresponds to another bonded peer. No data is written so duplicate entries are avoided. |
| NRF_ERROR_INVALID_STATE | If the Peer Manager is not initialized. |