This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Re-bonding with Android HID

Hello.

nRF52832

nRF5_SDK_17.1.0_ddde560

target ble_app_hids_keyboard

1. I made bonding between nRF52 and Android. and connected.

2. I remove bonding in nRF52.

3. Reboot nRF52

4. Android connect to nRF52 but failed to connect

5. If Android remove bonding, and make bonding again, it works.

My expectation

nRF52 should make bonding again. 

Currently Android have no popup, so that end user cannot know nRF52's bonding information is removed.

My previous project with "Cypress" can do that.

I reviewed many of cases with bonding in google. But I cannot find any solution.

Please let me know how nRF52 make bonding again. (Please provide sample code)

Parents
  • Thanks for your update.

    I already test it but It was not effective at all.

  • PM_EVT_CONN_SEC_CONFIG_REQ is 5.

    Android try to connect but no pm 5 was found.

    static void pm_evt_handler(pm_evt_t const * p_evt)
    {
    ...
    NRF_LOG_INFO("pm %x", p_evt->evt_id);

    }

    <info> app_timer: RTC: initialized.
    <info> app: HID Keyboard example started.
    <info> app: m_whitelist_peer_cnt 1, MAX_PEERS_WLIST 8
    <info> app: Fast advertising.
    <info> app: pm 1
    <info> app: Connected
    <info> app: pm 2
    <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Encryption, error: 4102
    <warning> peer_manager_handler: Disconnecting conn_handle 0.
    <info> app: pm 4
    <info> app: Fast advertising.
    <info> app: Disconnected
    <info> app: pm 1
    <info> app: Connected
    <info> app: pm 2
    <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Encryption, error: 4102
    ...

  • Hi,

    From the error code I can find:

    #define PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING (PM_CONN_SEC_ERROR_BASE + 0x06) /**< @brief Encryption failed because the peripheral has lost the LTK for this bond. See also @ref BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING and Table 3.7 ("Pairing Failed Reason Codes") in the Bluetooth Core Specification 4.2, section 3.H.3.5.5 (@linkBLEcore). */

    I suspect you are calling pm_handler_disconnect_on_sec_failure() in pm_evt_handler(), this will automatically disconnect on failure. I suggest to comment out that pm_handler_disconnect_on_sec_failure().

    Kenneth

Reply
  • Hi,

    From the error code I can find:

    #define PM_CONN_SEC_ERROR_PIN_OR_KEY_MISSING (PM_CONN_SEC_ERROR_BASE + 0x06) /**< @brief Encryption failed because the peripheral has lost the LTK for this bond. See also @ref BLE_HCI_STATUS_CODE_PIN_OR_KEY_MISSING and Table 3.7 ("Pairing Failed Reason Codes") in the Bluetooth Core Specification 4.2, section 3.H.3.5.5 (@linkBLEcore). */

    I suspect you are calling pm_handler_disconnect_on_sec_failure() in pm_evt_handler(), this will automatically disconnect on failure. I suggest to comment out that pm_handler_disconnect_on_sec_failure().

    Kenneth

Children
Related