<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/96603/ble_hids_evt_notif_enabled-conditions</link><description>Hi guys. I have several questions when testing the ble_app_hids_keyboard_pca10056_s113 project from 17.1.0 nRF5 SDK. 
 
 I couldn&amp;#39;t find the part that explains when does the Bluetooth Central device enables the HID notification. 
 First, is it true that</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 22 Feb 2023 06:55:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/96603/ble_hids_evt_notif_enabled-conditions" /><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/411243?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 06:55:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:078d3ff8-769b-446f-bd36-537b3107c448</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Yes, the&lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fsdk_nrf5_v17.1.0%2Flib_pm_functionality.html&amp;amp;anchor=lib_pm_functionality_security"&gt; Managing peers section in the documentation&lt;/a&gt; states as follows:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;quot;&lt;span&gt;&lt;em&gt;After a bond to a new peer is established, the Peer Manager assigns a unique peer ID to the peer and stores the bonding and GATT data in flash. The application can later read or update this data, if required, but in most cases, it should be handled exclusively by the Peer Manager.&lt;/em&gt;&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Best regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Simon&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/411235?ContentTypeID=1</link><pubDate>Wed, 22 Feb 2023 04:54:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c5fb4c93-30c7-4acb-a3a7-4d9bdd4d1497</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Hello Simon. Then does this mean the CCCD information for enabling Input Report Notification is stored in the flash memory via peer manager?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/411163?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2023 15:18:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:25f981a1-32a8-450d-b778-b617fc93cad5</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;If the two devices are bonded and have enabled notifications once, I don&amp;#39;t think the Android device has&amp;nbsp;to enable notifications again upon reconnecting to a bonded device.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/411017?ContentTypeID=1</link><pubDate>Tue, 21 Feb 2023 08:11:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3aab1f8d-8fc9-4fba-ba99-2615c82737d7</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Hi Simon. Two last questions before closing this.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;When debugging this keyboard example,&lt;/p&gt;
&lt;p&gt;1) nRF52 is paired to an Android phone for the first time&lt;/p&gt;
&lt;p&gt;2) Android enables HID input report Notify&lt;/p&gt;
&lt;p&gt;3) nRF52 disconnects and reconnect&lt;/p&gt;
&lt;p&gt;4) this time, Android DOES NOT enable HID input report Notify&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Am I missing something or is it really true that central devices (Android, iOS, etc) doesn&amp;#39;t need to enable Notification again?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Interestingly, after the re-connection, the nRF52 was still able to send &amp;#39;hello&amp;#39; keys to the Android device without the Notify enable. Why is this possible?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you so much for your great help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/410810?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2023 08:45:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5dc0b7d3-46d4-4f7e-b35f-7a244716daf9</guid><dc:creator>Simonr</dc:creator><description>[quote user="MatthewKYEO"]&lt;p&gt;From the sniffer, the Android v12 sent two Notification enable for the Input Report.&lt;/p&gt;
&lt;p&gt;Where there any documentations from Google/Android explaining that&lt;/p&gt;[/quote]
&lt;p&gt;I&amp;#39;m sorry but we don&amp;#39;t know the Android stack by heart, so I think you should either contact the &lt;a href="https://developer.android.com/support"&gt;Android support team&lt;/a&gt; or ask in a forum with more expertise on Android development.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/410702?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 15:57:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3deac543-9601-40f8-8aea-298e01c37087</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Hi Simon.&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/96603/ble_hids_evt_notif_enabled-conditions/410660"]Notifications are commonly enabled after the scan request, see&lt;strong&gt; Scan_Request_Notification_Enable&amp;nbsp;BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2451&amp;nbsp;&lt;/strong&gt;for details on that. But they can also be enabled after pairing/bonding for example.[/quote]
&lt;p&gt;Thanks for pointing this part.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/96603/ble_hids_evt_notif_enabled-conditions/410660"]I&amp;#39;m not sure what you mean about a description of the &amp;quot;timing&amp;quot; of notifications being enabled,[/quote]
&lt;p&gt;You are right. I meant on the OS side.&lt;/p&gt;
&lt;p&gt;From the sniffer, the Android v12 sent two Notification enable for the Input Report.&lt;/p&gt;
&lt;p&gt;Where there any documentations from Google/Android explaining that&lt;/p&gt;
&lt;p&gt;-&amp;nbsp; two Notification enable will be sent for HID firmwares&lt;/p&gt;
&lt;p&gt;- when the Notification enables are sent to nRF52 HID (ex. after pairing complete, etc)&lt;/p&gt;
&lt;p&gt;?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I was trying to search this type of document for Android, iOS, Windows, Linux, etc but I couldn&amp;#39;t find it.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Appreciate your great help!&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/410660?ContentTypeID=1</link><pubDate>Fri, 17 Feb 2023 13:28:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ecf29bb-3639-4034-be5b-ad04aa124833</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Do you mean on the OS side of things? That I assume would be in the specification of the different OS&amp;#39;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&lt;strong&gt; Scan_Request_Notification_Enable&amp;nbsp;BLUETOOTH CORE SPECIFICATION Version 5.3 | Vol 4, Part E page 2451&amp;nbsp;&lt;/strong&gt;for details on that. But they can also be enabled after pairing/bonding for example.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what you mean about a description of the &amp;quot;timing&amp;quot; of notifications being enabled, so please clarify here.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;SImon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/410476?ContentTypeID=1</link><pubDate>Thu, 16 Feb 2023 21:47:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4230338f-4d3b-4939-9a26-b2e118b0cb83</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Thank you Simon.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks to the Nordic sniffer, I was able to detect two Notification enables and check the HID input since this default example was using JustWorks.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/96603/ble_hids_evt_notif_enabled-conditions/410055"]My guess is that the Android device does discovery, then enables notifications. [/quote]
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Back to my first part &amp;quot;I couldn&amp;#39;t find the part that explains when does the Bluetooth Central device enables the HID notification.&amp;quot;,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Is there a document that describes this &amp;quot;timing&amp;quot; when the Input Report Notification is enabled for each OSes (Android, iOS, Windows, Linux, etc)?&lt;/p&gt;
&lt;p&gt;Sadly, I couldn&amp;#39;t find this from the USB HID document. After finding the reference, let&amp;#39;s close this thread.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/410055?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2023 11:56:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b70c17f9-3774-4261-8afe-93b8498f31de</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Depending on the service and application, discovery is done before or after the pairing procedure. Some services, like the Glucose service used in our &lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/ble_sdk_app_gls.html"&gt;ble_app_gls application&lt;/a&gt;&amp;nbsp;requires pairing and bonding first. Most others don&amp;#39;t.&lt;/p&gt;
[quote user="MatthewKYEO"]In case for Android v12, do you mean the BLE_HIDS_EVT_NOTIF_ENABLED happens due to the service discovery?[/quote]
&lt;p&gt;Yes, I think so. My guess is that the Android device does discovery, then enables notifications. Afterwards it gets a pairing request and does the full pairing method before doing another service discovery and enables notifications again. This can be seen more easily if you&amp;#39;re able to capture a sniffer trace.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/409977?ContentTypeID=1</link><pubDate>Wed, 15 Feb 2023 05:24:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:247bf570-4be4-406e-b93e-771924dd45ef</guid><dc:creator>Matthew K</dc:creator><description>&lt;p&gt;Thank you Simon.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/96603/ble_hids_evt_notif_enabled-conditions/409740"]The service discovery is optional, and is done if the central accepts/requests it after pairing[/quote]
&lt;p&gt;Did you mean the service discovery is done after the pairing is completed?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
[quote userid="75734" url="~/f/nordic-q-a/96603/ble_hids_evt_notif_enabled-conditions/409740"]when using Android devices, as it tries to do service discovery upon connection before pairing[/quote]
&lt;p&gt;In case for Android v12, do you mean the BLE_HIDS_EVT_NOTIF_ENABLED happens due to the service discovery?&lt;/p&gt;
&lt;p&gt;So [1] Service discovery [2] Pairing complete&lt;/p&gt;
&lt;p&gt;are the reasons for seeing the BLE_HIDS_EVT_NOTIF_ENABLED, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_HIDS_EVT_NOTIF_ENABLED conditions</title><link>https://devzone.nordicsemi.com/thread/409740?ContentTypeID=1</link><pubDate>Tue, 14 Feb 2023 07:12:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1c3ce8d1-d075-42ec-b031-a205739b1748</guid><dc:creator>Simonr</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;Depending on the central side that the keyboard application connects to that is the device deciding when/if service discovery is done. The service discovery is optional, and is done if the central accepts/requests it after pairing, correct. If a paired/bonded device is disconnected, then service discovery can be done upon connection.&lt;/p&gt;
&lt;p&gt;In the nRF5 SDK, the&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v17.1.0/lib_peer_manager.html"&gt; peer manager&lt;/a&gt; is the library that manages BLE security, paring and bonding, so you can take a look there to see how these events are handled.&lt;/p&gt;
&lt;p&gt;I think seeing this event twice is something that&amp;#39;s common when using Android devices, as it tries to do service discovery upon connection before pairing, then either gets the pairing request or info that the device has to be paired to successfully do service discovery. To see exactly what happens on the air you can sniff the BLE packets either with a dedicated Bluetooth sniffer (&lt;a href="https://www.ellisys.com/products/btcompare.php"&gt;Ellisys &lt;/a&gt;for example) or a spare DK with the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;nRF Sniffer firmware&lt;/a&gt; and Wireshark.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Simon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>