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

What can cause BLE_HIDS_EVT_NOTIF_ENABLED not to be sent by Host.

I have situation as follows:

I have HOGP mouse device that does pair with Host (Linux, Windows). After pairing also the mouse does work. Now if I power the mouse off suddenly and power it on again, the reconnection does work but the host does not allow the mouse to send notifications. I.e. mouse does not receive the BLE_HIDS_EVT_NOTIF_ENABLED event from host. This does efficiently make the mouse unable to send events to host. This happens with Linux and W8. If I will send the movement events without getting the ...ENABLED event (i.e. ignoring it), I will receive NRF_ERROR_INVALID_STATE as return of sending datagram, the bluetooth connection is established at that point.

If I unpair the mouse and repair again, the mouse starts to work and the BLE_HIDS_EVT_NOTIF_ENABLED event will arraive to device.

I have been reading lots of documents around, and I have not been lucky to read the correct place if there is such a document available.

So, my question is, what can cause BLE_HIDS_EVT_NOTIF_ENABLED not to be sent by the Host on reconnect?

Parents
  • Hi Håkon, one issue was that I was not storing CCCD information properly. I also figured out that the BLE_HIDS_EVT_NOTIF_ENABLED will be sent as part of the pairing procedure only. Am I right? So, if the CCCD information is not stored properly, the device will not work on next power up.

    I use nRF51822 with nrf51_sdk_v5_1_0_36092 and s110_nrf51822_6.0.0_API

    My situation in reality is much more complex than I explained in my previous post. I do have combo device with many HOGP devices in it. Now I am waiting until all my HOGP devices report the BLE_HIDS_EVT_NOTIF_ENABLED event has been arrived and then I do the ble_bondmngr_sys_attr_store() call. This solved the situation on Linux host (it is running fine now). I still have a strange situation on Windows 8 Host in situation of Mouse+Keyboard.

    1. after pairing both will work fine.
    2. after power cycle of the device, only keyboard or mouse works.
    3. after next power cycle of the device, only mouse or keyboard works (some times mouse some times keyboard).

    I also tested it without power cycle by turning off the windows bluetooth device and turning it on again. This will produce connection loss event on my device and does force the connection information to be saved into flash with ble_bondmngr_bonded_centrals_store() when it has been changed after the ble_bondmngr_sys_attr_store() call. The result is same as above- only one of the devices will work.

Reply
  • Hi Håkon, one issue was that I was not storing CCCD information properly. I also figured out that the BLE_HIDS_EVT_NOTIF_ENABLED will be sent as part of the pairing procedure only. Am I right? So, if the CCCD information is not stored properly, the device will not work on next power up.

    I use nRF51822 with nrf51_sdk_v5_1_0_36092 and s110_nrf51822_6.0.0_API

    My situation in reality is much more complex than I explained in my previous post. I do have combo device with many HOGP devices in it. Now I am waiting until all my HOGP devices report the BLE_HIDS_EVT_NOTIF_ENABLED event has been arrived and then I do the ble_bondmngr_sys_attr_store() call. This solved the situation on Linux host (it is running fine now). I still have a strange situation on Windows 8 Host in situation of Mouse+Keyboard.

    1. after pairing both will work fine.
    2. after power cycle of the device, only keyboard or mouse works.
    3. after next power cycle of the device, only mouse or keyboard works (some times mouse some times keyboard).

    I also tested it without power cycle by turning off the windows bluetooth device and turning it on again. This will produce connection loss event on my device and does force the connection information to be saved into flash with ble_bondmngr_bonded_centrals_store() when it has been changed after the ble_bondmngr_sys_attr_store() call. The result is same as above- only one of the devices will work.

Children
Related