nrf sample peripheral_hids_mouse does not connect to desktop with BT_HIDS_SECURITY_ENABLED=n, disconnected reason 19

Hi there,

I am trying to achieve "just works" pairing between the peripheral_hids_mouse example and my desktop computer, without the need for a passkey. The peripheral_hids_mouse example does work with a passkey in it's default configuration with BT_HIDS_SECURITY_ENABLED=y however when this is set to BT_HIDS_SECURITY_ENABLED=n is does not connect, with the example returning "Disconnected (reason 19)".

This is how I have configured BT_HIDS_SECURITY_ENABLED=n

And have commented out the references to authentication callbacks in main()

No other changes to the sample have been made.

This is the failure message output when disconnecting with reason 19:

I am running this sample on the NRF52 DK, and my desktop is running Windows 10.

Any help trying to achieve "just works" connection without a passkey for a hids peripheral is appreciated.

Regards,

Bryn

  • Hi Einar,

    It looks like the nRF power cycling connection problem was on my end. Restarting my PC and allowing more time for the nRF to connect automatically after a power cycle has it working properly as you describe.

    And that is good to know regarding the default configuration to not allow re-pairing for unauthenticated bonding. Is this documented anywhere? I cannot seem to find much documentation on Zephyr's BLE connection nuances like this one.

    Overall I consider my issue solved. Many thanks for your help.

    Kind regards,

    Bryn

  • For anyone looking at this with sdk 2.4.2, you need to make one additional change so that you don't get stuck in a hardfault loop.

    Move 

        if (IS_ENABLED(CONFIG_SETTINGS)) {
            settings_load();
        }
    to be called just before
    hid_init();
Related