ble_app_hids_keyboard will not run if SEC_PARAM_BOND = 0

Hi Nordic Team,

We have no problem with using ble_app_hids_keyboard app,

However, in some use cases, we would like the application to run as "Just Works" to access other characteristics, say battery voltage characteristics for example. And well in some cases depending on the connected client HID can work without bonding too.

 Testing this just with nrf52 DVK,   When SEC_PARAM_BOND  = 0, the firmware faults.

In debug, runs to the last call in Main.c peer_manager_init();

Appears to be in the peer manager  pm_init(void)?

Any thoughs on how we can get this to run?

Regards,

Eric

Parents
  • Hi

    Okay, we ran a test on our end as well, and found out why this is. When you disable bonding, the application still tries to do the following actions, which are only done on bonding, not pairing. If you set all these to 0 it seems to work.

        sec_param.kdist_own.enc  = 0;
        sec_param.kdist_own.id   = 0;
        sec_param.kdist_peer.enc = 0;
        sec_param.kdist_peer.id  = 0;

    Best regards,

    Simon

Reply
  • Hi

    Okay, we ran a test on our end as well, and found out why this is. When you disable bonding, the application still tries to do the following actions, which are only done on bonding, not pairing. If you set all these to 0 it seems to work.

        sec_param.kdist_own.enc  = 0;
        sec_param.kdist_own.id   = 0;
        sec_param.kdist_peer.enc = 0;
        sec_param.kdist_peer.id  = 0;

    Best regards,

    Simon

Children
  • OK, this does not crash. Thanks! 
    As a test whether I can connect using just works, I try to read the battery service. I'm (using Android BLE Scanner, or on Windows 10  nrfCOnnect DeskTop). Can connect, but when  I auth battery service notification -  pairing is requested. of course with current setting this will fail. Happily does not crash the application to that looks solved.
    bas_init() & hids_init()  all look to be set to  SEC_JUST_WORKS

    <info> app: Connected
    <info> peer_manager_handler: Connection security failed: role: Peripheral, conn_handle: 0x0, procedure: Bonding, error:  1
    addtional
     once just works connected, I eneable break point in  pm_evt_handler at switch (p_evt->evt_id, then auth battery service notification. Event is PM_EVT_CONN_SEC_START
    - I just noted that I can read write to generic access 0x1800, promising
    Though would like to stop pairing requests.in general

Related