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

◆ pm_peer_ranks_get()

uint32_t pm_peer_ranks_get ( uint16_t * highest_ranked_peer,
uint32_t * highest_rank,
uint16_t * lowest_ranked_peer,
uint32_t * lowest_rank )

#include <peer_manager.h>

Find the highest and lowest ranked peers.

The rank is saved in non-volatile storage under the data ID PM_PEER_DATA_ID_PEER_RANK.

The interpretation of rank is up to the user, because the rank is only updated by calling pm_peer_rank_highest or by manipulating the value using a PM_PEER_DATA_FUNCTIONS function.

Note
Peers with no stored rank are not considered.
Any argument that is NULL is ignored.
Parameters
[out]highest_ranked_peerThe peer ID with the highest rank of all peers, for example, the most recently used peer.
[out]highest_rankThe highest rank.
[out]lowest_ranked_peerThe peer ID with the lowest rank of all peers, for example, the least recently used peer.
[out]lowest_rankThe lowest rank.
Return values
NRF_SUCCESSIf the operation completed successfully.
NRF_ERROR_NOT_FOUNDIf no peer with stored peer rank was found.
NRF_ERROR_INVALID_STATEIf the Peer Manager is not initialized.
NRF_ERROR_INTERNALIf an internal error occurred.
NRF_ERROR_NOT_SUPPORTEDIf the peer rank functionality has been disabled via the CONFIG_PM_PEER_RANKS Kconfig option.