<?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>Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25986/connection-alive-by-empty-data-pdu-instead-of-notifications</link><description>Hi, 
 Central nrf52840 
 peripheral nrf52840 
 adv. interval: 25ms 
 adv. timeout 180 seconds 
 connection interval (both min and max) 10ms 
 scan interval 50 ms 
 scan windows 25ms 
 scan timeout 0 
 connection supervision timeout 4s 
 My question</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 23 Oct 2017 08:09:12 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25986/connection-alive-by-empty-data-pdu-instead-of-notifications" /><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102403?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 08:09:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a51097eb-c91c-41fa-81f0-1a391d6fb52a</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;Yes, indeed when I restart the central sometimes it can receive the notifications and sometimes, the service discovery fails and hence there are no notifications received. I have not tested just with the ble_app_hrs. I will try it and let you know. Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102408?ContentTypeID=1</link><pubDate>Mon, 23 Oct 2017 07:40:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d0153466-fda7-42a0-84ea-73ad4f7c3c63</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Nivetha,&lt;/p&gt;
&lt;p&gt;We need to debug why service discovery wasn&amp;#39;t started. We need to check if it&amp;#39;s actually called on the central or not. If you restart the central instead of restarting the peripheral, do you see the same problem ?&lt;/p&gt;
&lt;p&gt;Could you confirm you can reproduce the issue using the ble_app_hrs_c and ble_app_hrs (with no modification) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102402?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 15:34:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9c613d1-8266-46f7-8a9b-826a9338d4c9</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;In those times, BLE DB Discovery is failed as well. I am not sure why!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102401?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 15:26:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa52cdd8-a48b-4428-83a2-8aadc066fe02</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;Yeah, I understand. Although I am able to connect after disconnection, the discovery of services is successful only at times. Rest, it follows the empty data pdu.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102400?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 14:41:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b39d4d9-7c25-4885-9d82-d593bd78c7ad</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;When one device reset, the connection will be disconnected. There is no way to re-establish connection without doing advertising.&lt;/p&gt;
&lt;p&gt;It&amp;#39;s depends on your application, most application will just advertising after the connection is lost (on the peripheral side)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102406?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 14:13:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:020b2ace-91c6-4f0a-bee2-18fa88dfc4d2</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;@Hung Bui. When there is a power cycle, how does the peer device handle it? Does it consider as disconnection and adv every time or does it continue with the data transmission?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102405?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 13:21:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a0c0e09-38a6-421c-ac8c-92031eb555f1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Could you confirm you can reproduce the issue with the unmodified ble_hrs_c and ble_app_hrs examples in the SDK ? How many time you need to reset the board for the problem to appear ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102407?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 11:57:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:61293c1e-6587-472f-978a-c44fb846f95d</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;I have just tested with the battery and temperature service too. The same problem appears.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102399?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 11:05:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c135d78a-5acc-4abd-9fda-fc940ab2578a</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;Thanks a lot. I am using SDK 13. However, I looked at the ble_hrs_c example of SDK 14 and added retry for the ble_discovery. I&amp;#39;m puzzled as to sometimes, it connects and receives the notifications and sometimes it does not.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102398?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 10:47:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5fb14fbd-e6c4-4247-a983-a4ad964fc326</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Nivetha,
Thanks for the trace, it has quite good information.&lt;/p&gt;
&lt;p&gt;What I&amp;#39;m seeing in the trace is that on the first 2 connection everything is fine. The link is not encrypted, and the central do service discovery and then enable notification as normal. But on the last connection, the service discovery didn&amp;#39;t start properly.
There is a Find by type value request sent from the master and then there is a response from slave. But then after that there was no characteristic discovery. This result in what you observer, the two device just stayed in idle, sending empty packet.&lt;/p&gt;
&lt;p&gt;We need to debug how the service discovery is executed on the central side in your code.&lt;/p&gt;
&lt;p&gt;Which SDK did you  use ? Do you base you code on any example ? Do you use ble_db_discovery.c library ? Do you modify anything related to it ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102404?ContentTypeID=1</link><pubDate>Thu, 19 Oct 2017 08:37:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d50abb69-372b-4946-94f7-4fcd19a60203</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;@Hung Bui I have attached the new sniffer trace with all the above requirements satisfied. Please have a look at it. &lt;a href="https://www.dropbox.com/s/zdhw0o8ybkx6mvi/reconnection_log_19_10.pcapng?dl=0"&gt;sniffer_log&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102410?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 15:42:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb7566fe-41dc-4ddd-8579-c8387026fd38</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Please try to capture a full sniffer trace, including when the connection is established, (advertising packet, then connect request) after that notifications are sent. Then central/peripheral reset, and connection re-established and no notification just empty packet.&lt;/p&gt;
&lt;p&gt;The sniffer above didn&amp;#39;t tell much about the situation.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102409?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 15:24:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0cf56278-0d54-4b7b-95a6-e76b9c8378ff</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;please find the sniffer trace &lt;a href="https://www.dropbox.com/s/1vkp1oem61adddq/reconnection_testing.pcapng?dl=0"&gt;here&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102397?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 13:40:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78c96308-c74a-4474-b49a-0411ba5bfee1</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Then bonding is required. If not peer manager won&amp;#39;t be able to re-establish CCCD.
I would suggest you to capture &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF-Sniffer/"&gt;a sniffer trace.&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102396?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 13:02:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34847d8c-007f-463f-afb1-1a8d4af664a8</guid><dc:creator>Nivetha</dc:creator><description>&lt;p&gt;Yeah, sure. I have implemented the peer manager at the central device.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connection alive by empty data pdu instead of notifications</title><link>https://devzone.nordicsemi.com/thread/102395?ContentTypeID=1</link><pubDate>Tue, 17 Oct 2017 10:44:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba624017-b199-47e3-88d7-6a1911c3b7e5</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Nivetha,&lt;/p&gt;
&lt;p&gt;It&amp;#39;s not very clear what you meant by &amp;quot; I want the notifications to continue by advertising and scanning etc.&amp;quot;&lt;/p&gt;
&lt;p&gt;I assume your question is , why in some cases the connection was re-established and the notification started automatically when in some other cases there were no notification, just empty packets.&lt;/p&gt;
&lt;p&gt;We need to look into how the notification be sent. You can only send notification when the CCCD (Client Characteristic Configuration Descriptor) is enabled by writing 1 to the CCCD characteristic.
If there was nothing written or initialized in CCCD when you call hvx command, you will receive BLE_ERROR_GATTS_SYS_ATTR_MISSING (0x3401). This is described in the documentation of the sd_ble_gatts_hvx command.&lt;/p&gt;
&lt;p&gt;If your 2 devices are bonded, the CCCD should be enabled automatically when they re-connect. But it&amp;#39;s up to the application code (or the peer manager if you use peer manager)&lt;/p&gt;
&lt;p&gt;Or, the central should set the CCCD right away after the connection re-established. This should be implemented in the central code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>