<?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 Disconnect packet loss</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73255/ble-disconnect-packet-loss</link><description>Nordic NUS - uart service; both SDK 15.3 and 17.0.2. Packet loss on repeated BLE disconnect - connect cycles; seeking clarification of my understanding. 
 &amp;quot;If there are untransmitted packets in the TX buffer where there is a disconnect, those packets</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 12 Apr 2021 08:49:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73255/ble-disconnect-packet-loss" /><item><title>RE: BLE Disconnect packet loss</title><link>https://devzone.nordicsemi.com/thread/304202?ContentTypeID=1</link><pubDate>Mon, 12 Apr 2021 08:49:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:533acbf9-5b6c-45b8-8c25-2328d46f63bc</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;This might clear things up:&lt;br /&gt;&lt;br /&gt;For WRITE there is both with and without response, and for HVX there is both with and without confirmation.&amp;nbsp;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=4_7_3_1_2_4_2_4#ga313fe43c2e93267da668572e885945db" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=4_7_3_1_2_4_2_4#ga313fe43c2e93267da668572e885945db" rel="noopener noreferrer" target="_blank"&gt;sd_ble_gatts_hvx&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a title="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_c___f_u_n_c_t_i_o_n_s.html?cp=4_7_3_1_2_2_2_11#ga90298b8dcd8bbe7bbe69d362d1133378" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_c___f_u_n_c_t_i_o_n_s.html?cp=4_7_3_1_2_2_2_11#ga90298b8dcd8bbe7bbe69d362d1133378" rel="noopener noreferrer" target="_blank"&gt;sd_ble_gattc_write&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;So since you want to know what been received then RSP is the a way to check.&amp;nbsp;&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/0434.pastedimage1618217320564v1.png" alt=" " /&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect packet loss</title><link>https://devzone.nordicsemi.com/thread/302250?ContentTypeID=1</link><pubDate>Sat, 27 Mar 2021 22:44:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5f129db8-e34b-4428-98ef-5b6982b98109</guid><dc:creator>hmolesworth</dc:creator><description>&lt;p&gt;Thanks, although the answer you refer to says the buffer is emptied - ie all queued data sent over BLE - before transmission is cleanly ended, not what happens if the BLE connection drops unexpectedly and not by request or negotiation. I suspect you are correct, however, but don&amp;#39;t find any reference to this in the documentation.&lt;/p&gt;
&lt;p&gt;As I mention in my question, &lt;em&gt;_TX_COMPLETE&lt;/em&gt; does not help as it only indicates data was transmitted, not that it was received; the act of transmission may well be the event that causes BLE connection loss to be recognised by the Peripheral, since if so the L2 layer does not respond even though &lt;em&gt;_TX_COMPLETE&lt;/em&gt; is set. It seems &lt;em&gt;_WRITE_RSP&lt;/em&gt; is the only safe way to ensure every packet was delivered, and increasing the buffer makes tings worse since if emptied on disconnect than all the pending packets have to be re-queued. I expected that to be handled in the Softdevice, not the application.&lt;/p&gt;
&lt;p&gt;Maybe Zephyr stack works differently, any experience with that?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect packet loss</title><link>https://devzone.nordicsemi.com/thread/302162?ContentTypeID=1</link><pubDate>Fri, 26 Mar 2021 14:15:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51e3c856-04dd-4016-9687-fa019fa6c37e</guid><dc:creator>JONATHAN LL</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]The question is probably best posed as is the BLE TX buffer discarded regardless of contents on a BLE disconnect event?[/quote]
&lt;p&gt;The buffer is emptied on disconnect:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/56085/is-the-tx-buffer-flushed-cleared-on-a-disconnect"&gt;Is the TX buffer flushed/cleared on a disconnect? - Nordic Q&amp;amp;A - Nordic DevZone - Nordic DevZone (nordicsemi.com)&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You do get an event when transmitted : &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.s140.api.v7.2.0%2Fgroup___b_l_e___g_a_t_t_s___e_n_u_m_e_r_a_t_i_o_n_s.html&amp;amp;anchor=ggae537647902af1b05c1e32f12d6b401c7afab96bfa9918017082235f7664919f9d"&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&lt;/a&gt;&amp;nbsp;then the application has to take care of handling what data it has given to the SD with&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx(), vs&amp;nbsp;&lt;/span&gt;&lt;span&gt;&lt;em&gt;ble_gatts_evt_hvn_tx_complete_t::count events&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Regards,&lt;br /&gt;Jonathan&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>