BLE_HIDS_EVT_NOTIF_ENABLED conditions

Hi guys. I have several questions when testing the ble_app_hids_keyboard_pca10056_s113 project from 17.1.0 nRF5 SDK.

I couldn't find the part that explains when does the Bluetooth Central device enables the HID notification.

First, is it true that the central device enables HID input report characteristic's notification when pairing is completed with the nRF52 HID keyboard?

(EX: Android v12 / iOS phone / Windows laptop etc connects with the nRF52 first time, pairing is successful, then BLE_HIDS_EVT_NOTIF_ENABLED happens)

Then what about the nRF52 that was paired previously? Since it was already paired, does the BLE_HIDS_EVT_NOTIF_ENABLED happen right after BLE_GAP_EVT_CONNECTED?

Next, When the nRF52 connects with an Android 12 smartphone the first time,

on_hids_evt() - BLE_HIDS_EVT_NOTIF_ENABLED happened twice, when the Android phone pairs with the nRF52.

Is it normal to see this being enabled 2 times?

Parents
  • Hi

    Do you mean on the OS side of things? That I assume would be in the specification of the different OS's. Where they enable/request notifications will be stated there. In the Bluetooth core specification you can for example see that Notifications are commonly enabled after the scan request, see Scan_Request_Notification_Enable BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2451 for details on that. But they can also be enabled after pairing/bonding for example.

    I'm not sure what you mean about a description of the "timing" of notifications being enabled, so please clarify here.

    Best regards,

    SImon

  • Hi Simon.

    Notifications are commonly enabled after the scan request, see Scan_Request_Notification_Enable BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2451 for details on that. But they can also be enabled after pairing/bonding for example.

    Thanks for pointing this part.

    I'm not sure what you mean about a description of the "timing" of notifications being enabled,

    You are right. I meant on the OS side.

    From the sniffer, the Android v12 sent two Notification enable for the Input Report.

    Where there any documentations from Google/Android explaining that

    -  two Notification enable will be sent for HID firmwares

    - when the Notification enables are sent to nRF52 HID (ex. after pairing complete, etc)

    ?

    I was trying to search this type of document for Android, iOS, Windows, Linux, etc but I couldn't find it.

    Appreciate your great help!

Reply
  • Hi Simon.

    Notifications are commonly enabled after the scan request, see Scan_Request_Notification_Enable BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2451 for details on that. But they can also be enabled after pairing/bonding for example.

    Thanks for pointing this part.

    I'm not sure what you mean about a description of the "timing" of notifications being enabled,

    You are right. I meant on the OS side.

    From the sniffer, the Android v12 sent two Notification enable for the Input Report.

    Where there any documentations from Google/Android explaining that

    -  two Notification enable will be sent for HID firmwares

    - when the Notification enables are sent to nRF52 HID (ex. after pairing complete, etc)

    ?

    I was trying to search this type of document for Android, iOS, Windows, Linux, etc but I couldn't find it.

    Appreciate your great help!

Children
  • Matthew K said:

    From the sniffer, the Android v12 sent two Notification enable for the Input Report.

    Where there any documentations from Google/Android explaining that

    I'm sorry but we don't know the Android stack by heart, so I think you should either contact the Android support team or ask in a forum with more expertise on Android development.

    Best regards,

    Simon

  • Hi Simon. Two last questions before closing this.

    When debugging this keyboard example,

    1) nRF52 is paired to an Android phone for the first time

    2) Android enables HID input report Notify

    3) nRF52 disconnects and reconnect

    4) this time, Android DOES NOT enable HID input report Notify

    Am I missing something or is it really true that central devices (Android, iOS, etc) doesn't need to enable Notification again?

    Interestingly, after the re-connection, the nRF52 was still able to send 'hello' keys to the Android device without the Notify enable. Why is this possible?

    Thank you so much for your great help!

Related