![]() |
nRF Connect SDK Bare Metal API 2.0.99
|
| 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.
| [out] | highest_ranked_peer | The peer ID with the highest rank of all peers, for example, the most recently used peer. |
| [out] | highest_rank | The highest rank. |
| [out] | lowest_ranked_peer | The peer ID with the lowest rank of all peers, for example, the least recently used peer. |
| [out] | lowest_rank | The lowest rank. |
| NRF_SUCCESS | If the operation completed successfully. |
| NRF_ERROR_NOT_FOUND | If no peer with stored peer rank was found. |
| NRF_ERROR_INVALID_STATE | If the Peer Manager is not initialized. |
| NRF_ERROR_INTERNAL | If an internal error occurred. |
| NRF_ERROR_NOT_SUPPORTED | If the peer rank functionality has been disabled via the CONFIG_PM_PEER_RANKS Kconfig option. |