Hello DevZone,
I am planning on making a system that uses peer manager ranking to determine which oldest bond I need to delete to make room for a new one.
I am using the function
ret_code_t pm_peer_rank_highest(pm_peer_id_t peer_id);to set the rank upon successful connection and use
ret_code_t pm_peer_ranks_get(pm_peer_id_t * p_highest_ranked_peer,
uint32_t * p_highest_rank,
pm_peer_id_t * p_lowest_ranked_peer,
uint32_t * p_lowest_rank); to find out which rank is the lowest.
I've read that pm_peer_rank_highest may return NRF_ERROR_RESOURCES when the rank is equal to UINT32_MAX and that I should manually update the ranks back from 0.
I have not found a way to do this correctly since the variable m_current_highest_peer_rank is static inside the peer manager and I did not found any way to set this back to 0.
Am I missing the function to reset this variable?
I am using SDK 17.0.2 with softdevice 7.2