<?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>Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/35088/keyboard-example-failure-in-sending-keys-after-power-cycle-with-android-kitkat</link><description>Hello 
 
 We are facing problem and please help us how to solve this problem. 
 &amp;gt; Condition, 
 - NRF52 DK - SDK version: nRF5_SDK_14.2.0_17b948a - Examble: ble_peripheral\ble_app_hids_keyboard 
 
 &amp;gt; Problem: 
 - Pairing to Android KitKat 4.4.2 or 4.4</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Jul 2018 07:55:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/35088/keyboard-example-failure-in-sending-keys-after-power-cycle-with-android-kitkat" /><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/138681?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 07:55:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7163dd6f-529b-4691-8701-22e9fc61facc</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi Kim,&lt;/p&gt;
&lt;p&gt;I have compared your logs and I only found two differences between working and not-working logs&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Not-working device does an LLCP feature exchange where as on working, there is no LLCP feature exchange.&lt;/li&gt;
&lt;li&gt;On working the notification is reached to the slave the second time it is connected, but on not working your button press is not visible in air, so for some reason, with notWorking phone, when you press the button, it is not sending notification. I do not know why.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I am not sure but it could be because of the incompatibility of some vendors able to support the value of 0 for WinOffset in the connect request parameter. Try the below code while initializing softdevice&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;ble_opt_t ble_opt;
memset(&amp;amp;ble_opt, 0, sizeof(ble_opt));

ble_opt.gap_opt.compat_mode_1.enable = 1;

err_code = sd_ble_opt_set(BLE_GAP_OPT_COMPAT_MODE_2,&amp;amp;ble_opt); 
APP_ERROR_CHECK(err_code);&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;The documentation for that can be found &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s132.api.v4.0.2%2Fstructble__gap__opt__compat__mode__1__t.html&amp;amp;cp=2_3_1_1_2_2_1_4_53"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/138644?ContentTypeID=1</link><pubDate>Tue, 03 Jul 2018 05:37:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44109d8b-25f7-4f7b-9736-c10031274d93</guid><dc:creator>MJin</dc:creator><description>&lt;p&gt;Hello Nordic,&lt;/p&gt;
&lt;p&gt;We got a support from local channel FAE.&lt;br /&gt;Their opinion is that KitKat seems to be wrong.&lt;br /&gt;The logs with Ellisys analyzer were attatched.&lt;br /&gt;Could you help us what the problem is?&lt;/p&gt;
&lt;p&gt;Sincerely yours,&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/test-logs.zip"&gt;devzone.nordicsemi.com/.../test-logs.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/137056?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 10:34:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:10a939ee-c93a-4410-acd7-8e890ec2991c</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Your log is showing only the data packets and seems like it cannot be filtered based on protocol. I cannot debug it since to do that i need to decode each and every data packet. I am not an expert in wireshark, but there must be a way where your output log will allow me to filter packets based on protocol (for example, L2CAP or HCI etc)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/136978?ContentTypeID=1</link><pubDate>Thu, 21 Jun 2018 03:46:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30bc73c6-0ea4-4d1b-a4d7-382031f4bf94</guid><dc:creator>MJin</dc:creator><description>&lt;p&gt;Hello Aryan&lt;/p&gt;
&lt;p&gt;It took a time getting a log.&lt;/p&gt;
&lt;p&gt;Hear are logs with normal Window10 and strange KitKat 4.4.2.&lt;/p&gt;
&lt;p&gt;Please give me a tip why nRF52 could not send &amp;quot;hello&amp;quot; in second connection.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;Sincerely yours,&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;nRF52DK MAC: 81:bd:6a:a1:59:c1&lt;br /&gt;Win10 BT MAC: B0-35-9F-81-D6-83&lt;br /&gt;KitKat 4.4.2 BT MAC: BC:72:B1:CF:C5:56 &amp;lt;-- Not visible in log&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/8688.2018.6.18-nRF-Sniffer-Test.zip"&gt;devzone.nordicsemi.com/.../8688.2018.6.18-nRF-Sniffer-Test.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/135915?ContentTypeID=1</link><pubDate>Wed, 13 Jun 2018 11:59:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec490e19-af78-4e7e-b7a1-f0522ee9a734</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;kitkat is quite old and&amp;nbsp; it is very likely that the ble stack on the phone with kitkat probably has some bugs.&amp;nbsp;errors like this are easily pinpointed if you get some sniffer log of the BLE traffic from these devices.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/135060?ContentTypeID=1</link><pubDate>Thu, 07 Jun 2018 06:54:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:056f2660-3cc2-4dba-82b7-089c617429c0</guid><dc:creator>MJin</dc:creator><description>&lt;p&gt;If you test&amp;nbsp;&lt;span&gt;&amp;quot;nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hids_keyboard&amp;quot; with KitKat, you can see it.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/135059?ContentTypeID=1</link><pubDate>Thu, 07 Jun 2018 06:52:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67ba1a59-966b-4cdc-bb2e-4660687c7892</guid><dc:creator>MJin</dc:creator><description>&lt;p&gt;1.&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() returns&amp;nbsp;NRF_ERROR_INVALID_STATE when&amp;nbsp;c&lt;/span&gt;onnection is okey, there is no&amp;nbsp;BLE_GAP_EVT_DISCONNECTED event.&lt;/p&gt;
&lt;p&gt;2. I&amp;#39;ve compared to Android KitKat and others(windows 10)&lt;/p&gt;
&lt;p&gt;In KitKat, BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST event&amp;nbsp;was not received.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;What Should I check?, please help me.&lt;/p&gt;
&lt;p&gt;-----------------------------------------------------------------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;Following is a dump trace of &amp;quot;nRF5_SDK_14.2.0_17b948a\examples\ble_peripheral\ble_app_hids_keyboard&amp;quot;&lt;/p&gt;
&lt;p&gt;I Added a trace in&amp;nbsp;nrf_ble_gatt_on_ble_evt() like this&lt;/p&gt;
&lt;p&gt;void nrf_ble_gatt_on_ble_evt(ble_evt_t const * p_ble_evt, void * p_context)&lt;br /&gt;{&lt;br /&gt; nrf_ble_gatt_t * p_gatt = (nrf_ble_gatt_t *)p_context;&lt;br /&gt; uint16_t conn_handle = p_ble_evt-&amp;gt;evt.common_evt.conn_handle;&lt;/p&gt;
&lt;p&gt;if (conn_handle &amp;gt;= NRF_BLE_GATT_LINK_COUNT)&lt;br /&gt; {&lt;br /&gt; return;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;NRF_LOG_INFO(&amp;quot;[%s:%d] p_ble_evt-&amp;gt;header.evt_id: 0x%02x&amp;quot;, __func__, __LINE__, p_ble_evt-&amp;gt;header.evt_id);&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;switch (p_ble_evt-&amp;gt;header.evt_id)&lt;br /&gt; {&lt;br /&gt; case BLE_GAP_EVT_CONNECTED:&lt;br /&gt; &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;NRF_LOG_INFO(&amp;quot;BLE_GAP_EVT_CONNECTED&amp;quot;);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; on_connected_evt(p_gatt, p_ble_evt);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;case BLE_GAP_EVT_DISCONNECTED:&lt;br /&gt; &lt;span style="text-decoration:underline;"&gt;&lt;strong&gt;NRF_LOG_INFO(&amp;quot;BLE_GAP_EVT_DISCONNECTED&amp;quot;);&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt; on_disconnected_evt(p_gatt, p_ble_evt);&lt;br /&gt; break;&lt;/p&gt;
&lt;p&gt;------------------------------------------------------------------------------------------------------------------------------&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;1. Windows 10 after power-cycle&lt;/p&gt;
&lt;p&gt;0&amp;gt; &amp;lt;info&amp;gt; app: HID Keyboard example started.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; app: pm_whitelist_get returns 1 addr in whitelist and 1 irk whitelist&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising with whitelist.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x10&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: BLE_GAP_EVT_CONNECTED&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Connected to a previously bonded device.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [on_connect:105] p_hids-&amp;gt;conn_handle : 0&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Connected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x23&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: BLE_GAP_EVT_DATA_LENGTH_UPDATE_REQUEST&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: Peer on connection 0x0 requested a data length of 251 bytes.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: Updating data length to 27 bytes on connection 0x0.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x24&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: BLE_GAP_EVT_DATA_LENGTH_UPDATE&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: Data length updated to 27 on connection 0x0.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: max_rx_octets: 27&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: max_tx_octets: 27&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: max_rx_time: 328&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: max_tx_time: 328&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x14&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x1A&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Connection secured: role: 1, conn_handle: 0x0, procedure: 0.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x55&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: BLE_GATTS_EVT_EXCHANGE_MTU_REQUEST&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: Peer on connection 0x0 requested an ATT MTU of 525 bytes.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; ble_gatt: Updating ATT MTU to 23 bytes (desired: 23) on connection 0x0.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x50&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x57&lt;/p&gt;
&lt;p&gt;///////////////////////////////////////////////////////////////////////////////////////////////////////&lt;/p&gt;
&lt;p&gt;2. KitKat 4.4.2 after power-cycle&lt;/p&gt;
&lt;p&gt;0&amp;gt; &amp;lt;info&amp;gt; app: HID Keyboard example started.&lt;br /&gt; 0&amp;gt; &amp;lt;debug&amp;gt; app: pm_whitelist_get returns 1 addr in whitelist and 1 irk whitelist&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Fast advertising with whitelist.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x10&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: BLE_GAP_EVT_CONNECTED&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Connected to a previously bonded device.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [on_connect:105] p_hids-&amp;gt;conn_handle : 0&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Connected&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x14&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; ble_gatt: [nrf_ble_gatt_on_ble_evt:499] p_ble_evt-&amp;gt;header.evt_id: 0x1A&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: Connection secured: role: 1, conn_handle: 0x0, procedure: 0.&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [ble_hids_inp_rep_send:1282] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [ble_hids_inp_rep_send:1300] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [send_key_scan_press_release:920] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: 8 = keys_send(1)&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [ble_hids_inp_rep_send:1282] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [ble_hids_inp_rep_send:1300] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [send_key_scan_press_release:920] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: 8 = keys_send(1)&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [ble_hids_inp_rep_send:1282] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [ble_hids_inp_rep_send:1300] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: [send_key_scan_press_release:920] err_code:8&lt;br /&gt; 0&amp;gt; &amp;lt;info&amp;gt; app: 8 = keys_send(1)&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Keyboard example failure in sending keys after power-cycle with Android KitKat</title><link>https://devzone.nordicsemi.com/thread/134756?ContentTypeID=1</link><pubDate>Tue, 05 Jun 2018 13:30:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb2ef0c4-7ef0-4107-abf3-09b70d506594</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;hvx will return invalid state error if there is no connection. Can you please make sure that you are calling hvx while you are still in connection? It seems that there could be a disconnect event that has been ignored?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>