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

Bonding is working only first time

I am working in sdk12.2 nrf52832 . When build and run the project it will work smoothly with ble connectivity... But the problem is it will bond only once when the softdevice is just burned... I am using eclipse for programing. When it uses device manager for bond it works perfectly.. but when it is replaced by peer manager the problem will starts... Only after re burning the softdevice will solve the problem... Please help me

Parents
  • Hi,

    the peer manager will by default reject pairing requests from already bonded peer centrals, but you can set the .allow_repairing flag to true if you want to allow it:

    static void pm_evt_handler(pm_evt_t const * p_evt)
    {
         case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
            // Reject pairing request from an already bonded peer.
            pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
            pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
        } break;
    
        ....
    
Reply
  • Hi,

    the peer manager will by default reject pairing requests from already bonded peer centrals, but you can set the .allow_repairing flag to true if you want to allow it:

    static void pm_evt_handler(pm_evt_t const * p_evt)
    {
         case PM_EVT_CONN_SEC_CONFIG_REQ:
        {
            // Reject pairing request from an already bonded peer.
            pm_conn_sec_config_t conn_sec_config = {.allow_repairing = true};
            pm_conn_sec_config_reply(p_evt->conn_handle, &conn_sec_config);
        } break;
    
        ....
    
Children
Related