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

Problem with delete HID bonding on the nrf52832.

Hi!

nRF52832, s132, 6.0, SDK15

I have strange behavior with delete all bonding devices include HID bonding.

Step by step:

I transfer HID keyboard project to my project. Changed peer_manager_init() to the next:

#define SEC_PARAM_BOND 1 
#define SEC_PARAM_MITM 0

#define SEC_PARAM_IO_CAPABILITIES   BLE_GAP_IO_CAPS_DISPLAY_ONLY  

static void peer_manager_init(void)
{
    ble_gap_sec_params_t sec_param;
    ret_code_t err_code;

    err_code = pm_init();
    APP_ERROR_CHECK(err_code);

    memset(&sec_param, 0, sizeof(ble_gap_sec_params_t));

    // Security parameters to be used for all security procedures.
    sec_param.bond           = SEC_PARAM_BOND;
    sec_param.mitm           = SEC_PARAM_MITM;

    sec_param.lesc           = SEC_PARAM_LESC;
    sec_param.keypress       = SEC_PARAM_KEYPRESS;
    sec_param.io_caps        = SEC_PARAM_IO_CAPABILITIES;
    
    sec_param.oob            = SEC_PARAM_OOB;
    sec_param.min_key_size   = SEC_PARAM_MIN_KEY_SIZE;
    sec_param.max_key_size   = SEC_PARAM_MAX_KEY_SIZE;
    sec_param.kdist_own.enc  = 1;
    sec_param.kdist_own.id   = 1;
    sec_param.kdist_peer.enc = 1;
    sec_param.kdist_peer.id  = 1;

    err_code = pm_sec_params_set(&sec_param);
    APP_ERROR_CHECK(err_code);

    err_code = pm_register(pm_evt_handler);
    APP_ERROR_CHECK(err_code);
}

Seems works fine. When from android phone I try to pair with HID, appears passkey entry window where should enter correct passkey.

All fine. All works.

call 

pm_peer_count();

shows 1 bonded device.

Now I want to delete this bonded devices from nrf52, I call

APP_ERROR_CHECK(pm_peers_delete());
 

after reboot 0 bonded devices. Note! Bonded pair from android was not deleted. Only deleted pair from nrf52.

And if now try to press connect on the android to the stored HID device, connect will success and nrf52 will make bonded pair without!!! any passkey entry.

Why? I suppose that is not correct behavior. 

Parents Reply Children
Related