Nordic nrf51 sdk sources. Mirrored from https://github.com/ARMmbed/nrf51-sdk.
Peer IDs
[Peer_manager]
An internal module of Peer_manager. 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. | |
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. | |
bool | peer_id_is_allocated (pm_peer_id_t peer_id) |
Function for finding out whether a peer ID is in use. | |
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. | |
uint32_t | peer_id_n_ids (void) |
Function for querying the number of valid peer IDs available. |
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 ) |
void peer_id_init | ( | void | ) |
bool peer_id_is_allocated | ( | pm_peer_id_t | peer_id ) |
uint32_t peer_id_n_ids | ( | void | ) |
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.
Generated on Tue Jul 12 2022 15:06:00 by 1.7.2