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

"Pairing rejected by Nordic_HRM"

While I am going to pair with my android 9 Asus mobile phone with SDK 17 nRF52840. It in my mobile showing "Pairing rejected by Nordic_HRM". After that  I have added a some code line to

static void peer_manager_init(bool erase_bonds);

sec_param.bond = false;
sec_param.mitm = false;
sec_param.lesc = 0;
sec_param.keypress = 0;
sec_param.oob = false;
sec_param.min_key_size = 7;
sec_param.max_key_size = 16;
sec_param.kdist_own.enc = 0;
sec_param.kdist_own.id = 0;
sec_param.kdist_peer.enc = 0;
sec_param.kdist_peer.id = 0;
And getting same "Pairing rejected by Nordic_HRM"
After that I have added this code,
sec_param.bond = true;
sec_param.mitm = false;
sec_param.lesc = 0;
sec_param.keypress = 0;
sec_param.io_caps = BLE_GAP_IO_CAPS_NONE;
sec_param.oob = false;
sec_param.min_key_size = 7;
sec_param.max_key_size = 16;
sec_param.kdist_own.enc = 1;
sec_param.kdist_own.id = 1;
sec_param.kdist_peer.enc = 1;
sec_param.kdist_peer.id = 1;
And getting same "Pairing rejected by Nordic_HRM"
Please give some solution.
Parents
  • Hi

    There are a few ways around this. The simplest one is likely to just erase bonding information on the nRF side as well upon a reset of the device, via a button, or whenever it fails to connect due to rejected pairing. deleting bonds can be done by a function like this for example.

    static void delete_bonds(void)
    {
        ret_code_t err_code;
    
        NRF_LOG_INFO("Erase bonds!");
    
        err_code = pm_peers_delete();
        APP_ERROR_CHECK(err_code);
    }

    Note that most examples, by default, checks during start-up if button 2 on the DK is pressed down, and if true calls this delete_bonds() function.

    Best regards,

    Simon

Reply
  • Hi

    There are a few ways around this. The simplest one is likely to just erase bonding information on the nRF side as well upon a reset of the device, via a button, or whenever it fails to connect due to rejected pairing. deleting bonds can be done by a function like this for example.

    static void delete_bonds(void)
    {
        ret_code_t err_code;
    
        NRF_LOG_INFO("Erase bonds!");
    
        err_code = pm_peers_delete();
        APP_ERROR_CHECK(err_code);
    }

    Note that most examples, by default, checks during start-up if button 2 on the DK is pressed down, and if true calls this delete_bonds() function.

    Best regards,

    Simon

Children
Related