Hi,
I am looking at and testing the ble_app_hrs_c_pca10040_s132 example.
When the whitelist ist set up with the "whitelist request" we execute the following two lines:
peer_list_get(peers, &peer_cnt); ret = pm_whitelist_set(peers, peer_cnt);
However, the function "peer_list_get" does not return the peers in the order of their rank according to my observations and also the documentation page of pm_next_peer_id_get which is called by "peer_list_get": The order in which peer IDs are returned should be considered unpredictable
So this means we just add the first 8 peers in the peer list which probably just correspond to the first 8 peers ever connected.
I think the example should use something like:
pm_peer_data_load(p_all_peer_ids[all_peers_cnt-1], PM_PEER_DATA_ID_PEER_RANK, &rank, &rankLenght);
to get the peer ranks and then order the peers accordingly before adding them to the whitelist.
Are those observations and conclusions correct?
Thank you for your response.