![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| uint32_t pm_peer_new | ( | uint16_t * | new_peer_id, |
| struct pm_peer_data_bonding * | bonding_data, | ||
| uint32_t * | token ) |
#include <peer_manager.h>
Manually add a peer to the non-volatile storage.
This function allocates a new peer ID and stores bonding data for the new peer. The bonding data is necessary to prevent ambiguity/inconsistency in peer data.
| [out] | new_peer_id | Peer ID for the new peer, or an existing peer if a match was found. |
| [in] | bonding_data | The bonding data of the new peer (must contain a public/static address or a non-zero IRK). |
| [out] | token | A token that identifies this particular store operation (storing the bonding data). The token can be used to identify events that pertain to this operation. This parameter can be NULL. |
| NRF_SUCCESS | If the store operation for bonding data was initiated successfully. |
| NRF_ERROR_NULL | If bonding_data or new_peer_id are NULL. |
| NRF_ERROR_INVALID_ADDR | If bonding_data is not word-aligned (4 bytes). |
| NRF_ERROR_RESOURCES | If there is not enough space in non-volatile storage. |
| NRF_ERROR_NO_MEM | If there are no more available peer IDs. |
| NRF_ERROR_BUSY | If the underlying storage is busy with other storage operations. Try again after receiving a Peer Manager event. |
| NRF_ERROR_INVALID_STATE | If the Peer Manager is not initialized. |
| NRF_ERROR_INTERNAL | If an internal error occurred. |