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

Pairing(bonding) data communication PROBLEM

Hi, every developers,

I am testing the example of ble_app_hrs_c and ble_app_hrs using 2 nRF52840 (in SDK 15.3.0 VERSION).

My goal is that data communication with two DK in pairing state. The data to be sent is not a heart rate or a battery level but a string or byte data sequence.

I have chosen two examples that support bonding via pm_manager, but I am having difficulty using the function to send and receive data.

I tried to use pm_peer_data_load () and pm_peer_data_store () functions, but calling both functions will cause a connection security error.

ERROR : <info> peer_manager_handler: Connection security failed: role: Central, conn_handle: 0x0, procedure: Encryption, error: 4102

I declare the function PEER_ID and function usage of two functions as follows.

pm_peer_id_t p_peer_id;

ret_code_t error_code = pm_peer_id_get(m_conn_handle,&p_peer_id);

pm_store_token_t * p_token;
void const * p_data;
p_data = "TESTING";

pm_peer_data_store(p_peer_id,PM_PEER_DATA_ID_BONDING,p_data, 20, p_token);

Could someone help me with the proper use of the two functions or with the function to send and receive data in the BONDING state?

Thank you.

Parents Reply Children
Related