This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

NRF_ERROR_INTERNAL from pm_peer_rank_highest... Central with Just Works Unauthenticated pairing

Hello, 

I'm working on a BLE central project where we want to utilize LESC Just Works Unauthenticated pairing. 

I followed the recommended usage guide at https://www.nordicsemi.com/DocLib/Content/SDK_Doc/nRF5_SDK/v15-0-0/lib_pm_usage

I configured the peer manager as follows:

memset(&sec_params, 0, sizeof(sec_params));
// Security parameters to be used for all security procedures.
sec_params.bond = 0;
sec_params.mitm = 0;
sec_params.lesc = 1;
sec_params.keypress = 0;
sec_params.io_caps = BLE_GAP_IO_CAPS_NONE;
sec_params.oob = 0;
sec_params.min_key_size = 7;
sec_params.max_key_size = 16;
sec_params.kdist_own.enc = 0;
sec_params.kdist_own.id = 0;
sec_params.kdist_peer.enc = 0;
sec_params.kdist_peer.id = 0;

err_code = pm_sec_params_set(&sec_params);
APP_ERROR_CHECK(err_code);

 I noticed the example code is not checking the return values of some of the calls. 

When I added reporting on err_code failure status, I discovered that calls to pm_peer_rank_highest are giving NRF_ERROR_INTERNAL.   I tracked the issue into peer_manager.c and discovered the issue originates as NRF_ERROR_INVALID_PARAM  from pdb_raw_store().

Should the pm_peer_rank_highest() be bypassed when performing pairing without bonding?

Thanks for you help!

Related