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
  • Hi, Simon

    I want the two modules to be paired via the peer manager to send and receive data.

    However, the two functions mentioned in the text (pm_peer_data_load and pm_peer_data_store) that update and retrieve the data received from the peer, not related to transport the data.

    So, I asked if you know about the functions that send and receive data from the two paired modules. 

    In the multilink_central example, do I need to send data to paired peers like the lbs(Led Button Service) handler?

    Thank you.

Children
Related