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

◆ pm_peer_id_list()

uint32_t pm_peer_id_list ( uint16_t * peer_list,
uint32_t *const list_size,
uint16_t first_peer_id,
enum pm_peer_id_list_skip skip_id )

#include <peer_manager.h>

Retrieve a filtered list of peer IDs.

This function starts searching from first_peer_id. IDs ordering is the same as for pm_next_peer_id_get. If the first_peer_id is PM_PEER_ID_INVALID, the function starts searching from the first ID. The function looks for the ID's number specified by list_size. Only those IDs that match skip_id are added to the list. The number of returned elements is determined by list_size.

Warning
The size of the peer_list buffer must be equal or greater than list_size.
Parameters
[out]peer_listPointer to peer IDs list buffer.
[in,out]list_sizeThe amount of IDs to return / The number of returned IDs.
[in]first_peer_idThe first ID from which the search begins. IDs ordering is the same as for pm_next_peer_id_get.
[in]skip_idIt determines which peer ID will be added to the list.
Return values
NRF_SUCCESSIf the ID list has been filled out.
NRF_ERROR_INVALID_PARAMIf skip_id was invalid.
NRF_ERROR_NULLIf peer_list or list_size were NULL.
NRF_ERROR_INVALID_STATEIf the Peer Manager is not initialized.