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

Pairing and bonding after deleting synchronization

Good morning,

I'm developing a new product based on nRF52840 and S140 (v6.1.0). I'm able to connect using my smartphone using the following data:

sec_param.bond = SEC_PARAM_BOND; //1
sec_param.oob = SEC_PARAM_OOB;     //1
sec_param.mitm = SEC_PARAM_MITM; //Static Key: 1
sec_param.io_caps = SEC_PARAM_IO_CAPABILITIES;  //BLE_GAP_IO_CAPS_DISPLAY_ONLY
sec_param.kdist_own.enc = 1;
sec_param.kdist_own.id = 1;
sec_param.kdist_peer.enc = 1;
sec_param.kdist_peer.id = 1;

When connecting the first time with a Smartphone, I'm asked to introduce the pin number.

Nevertheless, if I erase synchornization information in my smartphone, when I try to syncrhonize again with same device, I'm asked to syncronize but I'm not able to introduce the pin number. Do you know why? I suppose it has to do with bonding information saved in the nRF52-based device. 

How can I proceed to solve this?

Best regards,

Dani

Parents
  • Hi Dani,

    The peer manager which handles pairing requests will for security reasons reject new pairing requests from an already bonded peer device. It sounds like this may be the problem here.  

    You may add the following event handling to the PM callback if you want to allow repairing:

           case PM_EVT_CONN_SEC_CONFIG_REQ: 
           {
                pm_conn_sec_config_t config = {.allow_repairing = true};
                pm_conn_sec_config_reply(p_evt->conn_handle, &config);
           }

    The other alternative is to actually delete the bond from the nRF device. For the SDK examples, you can delete all bonds by pressing board button 2 while resetting the device.

    Best regards,

    Vidar

Reply
  • Hi Dani,

    The peer manager which handles pairing requests will for security reasons reject new pairing requests from an already bonded peer device. It sounds like this may be the problem here.  

    You may add the following event handling to the PM callback if you want to allow repairing:

           case PM_EVT_CONN_SEC_CONFIG_REQ: 
           {
                pm_conn_sec_config_t config = {.allow_repairing = true};
                pm_conn_sec_config_reply(p_evt->conn_handle, &config);
           }

    The other alternative is to actually delete the bond from the nRF device. For the SDK examples, you can delete all bonds by pressing board button 2 while resetting the device.

    Best regards,

    Vidar

Children
Related