Peer IDs

nRF5 SDK v10.0.0

nRF51 SDK v10.0.0

An internal module of Peer Manager . This module keeps track of which peer IDs are in use and which are free. More...

Functions

void peer_id_init (void)
Function for initializing the module.
pm_peer_id_t peer_id_allocate ( pm_peer_id_t peer_id)
Function for claiming an unused peer ID. More...
void peer_id_free ( pm_peer_id_t peer_id)
Function for freeing a peer ID and clearing all data associated with it in persistent storage. More...
bool peer_id_is_allocated ( pm_peer_id_t peer_id)
Function for finding out whether a peer ID is in use. More...
pm_peer_id_t peer_id_next_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 peer_id_n_ids (void)
Function for querying the number of valid peer IDs available. I.E the number of peers in persistent storage. More...

Detailed Description

An internal module of Peer Manager . This module keeps track of which peer IDs are in use and which are free.

Function Documentation

pm_peer_id_t peer_id_allocate ( pm_peer_id_t peer_id )

Function for claiming an unused peer ID.

Parameters
peer_id The peer ID to allocate. If this is PM_PEER_ID_INVALID , the first available will be allocated.
Returns
The allocated peer ID.
Return values
PM_PEER_ID_INVALID If no peer ID could be allocated or module is not initialized.
void peer_id_free ( pm_peer_id_t peer_id )

Function for freeing a peer ID and clearing all data associated with it in persistent storage.

Parameters
[in] peer_id Peer ID to free.
bool peer_id_is_allocated ( pm_peer_id_t peer_id )

Function for finding out whether a peer ID is in use.

Parameters
[in] peer_id The peer ID to inquire about.
Return values
true peer_id is in use.
false peer_id is free, or the module is not initialized.
uint32_t peer_id_n_ids ( void )

Function for querying the number of valid peer IDs available. I.E the number of peers in persistent storage.

Returns
The number of valid peer IDs, or 0 if module is not initialized.
pm_peer_id_t peer_id_next_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.

Note
PM_PEER_ID_INVALID is considered to be before the first and after the last ordinary peer ID.
Parameters
[in] prev_peer_id The previous peer ID.
Returns
The next peer ID.
The first used peer ID if prev_peer_id was PM_PEER_ID_INVALID .
Return values
PM_PEER_ID_INVALID if prev_peer_id was the last ordinary peer ID or the module is not initialized.

Please send us your feedback about the documentation! For technical questions, visit the Nordic Developer Zone .