<?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>GATTS Handle Value Indication - packet retry interval</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/39558/gatts-handle-value-indication---packet-retry-interval</link><description>Hi, 
 What is the timing of the indication retry mechanism (SDK14.2, nRF52832) ? 
 
 App use sd_ble_gatts_hvx() to schedule message for sending 
 At the next connection interval (T0) the message is xmitted (Peripheral--&amp;gt;Central) 
 The Central&amp;#39;s stack</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 23 Oct 2018 07:13:04 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/39558/gatts-handle-value-indication---packet-retry-interval" /><item><title>RE: GATTS Handle Value Indication - packet retry interval</title><link>https://devzone.nordicsemi.com/thread/153967?ContentTypeID=1</link><pubDate>Tue, 23 Oct 2018 07:13:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:58fc222f-3551-40e3-aa61-a669e0c510a6</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;yes, your understanding above is correct.&lt;/p&gt;
&lt;p&gt;The packets doesn&amp;#39;t necessarily need to be dummy packets, they could have some data also. But I think you get the point now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATTS Handle Value Indication - packet retry interval</title><link>https://devzone.nordicsemi.com/thread/153856?ContentTypeID=1</link><pubDate>Mon, 22 Oct 2018 14:02:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18a39b48-e6dc-4237-af63-bc285d32c9e9</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So the supervision timeout (in the example above) shall occur after losing 500 dummy LL packets sequentially ?&lt;/p&gt;
&lt;p&gt;If a single dummy packet is ack&amp;#39;d after 499 have been lost, will it reset the supervision timeout counter (until 500 dummy packets are lost is sequence) ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATTS Handle Value Indication - packet retry interval</title><link>https://devzone.nordicsemi.com/thread/153807?ContentTypeID=1</link><pubDate>Mon, 22 Oct 2018 12:37:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:95c69235-9311-4f0a-9c54-2c365630c66f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sorry for the late reply,&lt;/p&gt;
&lt;p&gt;1) Correct&lt;/p&gt;
&lt;p&gt;2) correct&lt;/p&gt;
&lt;p&gt;3) BLE_GATTS_EVT_HVN_TX_COMPLETE is used only for notification and not for indication. For indication you will get&amp;nbsp;BLE_GATTS_EVT_HVC when the peer has confirmed that the indication has been received. The timings of this depends on peer but should happen within 30 seconds of transmission of Indication else a BLE_GATTS_EVT_TIMEOUT is received on the peripheral side. It is upto the application how it wants to handle the timeout. In our SDK examples, we do a disconnect from peer, but you can change this code easily to try to retransmit the indiation packet again.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="eyalasko"]In such case does the app notified by an event (before the 30 sec elapses) ?[/quote]
&lt;p&gt;no, app will only be notified after the timeout has occurred and not before that.&amp;nbsp;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote user="eyalasko"]Assuming, for example, connection interval of 20ms (50/sec) and supervision timeout = 10 sec. Will&amp;nbsp;BLE_GAP_EVT_TIMEOUT be triggered after 50(CI/sec) * 10(sec) = 500 missed LL packets ?[/quote]
&lt;p&gt;supervision timeout is link layer specific. That is if your peripheral is not getting any replies to its sent packet at the link layer level, then after the supervision timeout, the link gets disconnected.&lt;/p&gt;
&lt;p&gt;You seems to be mixing up two things.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;1) The link layer keeps sending dummy packets to peer every CI to check that the peer is ACKing/NACKing those packets. This is different from&amp;nbsp;&lt;/p&gt;
&lt;p&gt;2) peer responding to Indication.&lt;/p&gt;
&lt;p&gt;The peer might be in a state that it is able to send keep the connection by responding to the LL packets but the app on the peer is too busy to respond to the indication received.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;So the supervision timeout happens due to non responsive nature in the LL level communication and the&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_TIMEOUT&amp;nbsp;could happen due to app on the peer being too busy to respond in time or being unresponsive.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATTS Handle Value Indication - packet retry interval</title><link>https://devzone.nordicsemi.com/thread/153500?ContentTypeID=1</link><pubDate>Thu, 18 Oct 2018 14:00:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed84685b-462d-434e-9013-39e179c4faff</guid><dc:creator>eyalasko</dc:creator><description>&lt;p&gt;Hi Aryan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;So the &amp;#39;Normal&amp;#39; Indication sequence as I understand it goes as follows:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Peripheral calls&amp;nbsp;&lt;span style="background-color:transparent;color:#11171a;float:none;font-family:&amp;#39;GT Eesti&amp;#39;,&amp;#39;Helvetica&amp;#39;,Arial,sans-serif;font-size:16px;font-style:normal;font-weight:400;letter-spacing:normal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;sd_ble_gatts_hvx()&lt;/span&gt; to schedule an Indication packet to the next connection interval&lt;/li&gt;
&lt;li&gt;GATT &amp;#39;hands&amp;#39; the packet to the LL to be sent out on the next CI&lt;/li&gt;
&lt;li&gt;On next CI the LL transmits the packet to the central.&amp;nbsp;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;list-style-type:decimal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Peripheral&amp;nbsp;&lt;/span&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;list-style-type:decimal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE evet fired (?)&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;LL successfully transmits (LL ack&amp;#39;ed) the packet to the central.&amp;nbsp;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;list-style-type:decimal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt;Peripheral BLE_GATTS_EVT_HVC&lt;/span&gt;&lt;span style="background-color:transparent;color:#000000;float:none;font-family:Verdana,Arial,Helvetica,sans-serif;font-size:12px;font-style:normal;font-weight:400;letter-spacing:normal;list-style-type:decimal;text-align:left;text-decoration:none;text-indent:0px;text-transform:none;white-space:normal;"&gt; evet fired (?)&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Is this sequence correct ?&lt;/p&gt;
&lt;p&gt;if LL xfer above (stage 3) does not get LL ack (stage 4), will the LL retry sending the packet?&lt;/p&gt;
&lt;p&gt;In such case does the app notified by an event (before the 30 sec elapses) ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;=========================&lt;/p&gt;
&lt;p&gt;My other question on the original post (question 4) refers to the condition that leads to&amp;nbsp;BLE_GAP_EVT_TIMEOUT (Supervision timeout, correct?)&lt;/p&gt;
&lt;p&gt;Assuming, for example, connection interval of 20ms (50/sec) and supervision timeout = 10 sec. Will&amp;nbsp;BLE_GAP_EVT_TIMEOUT be triggered after 50(CI/sec) * 10(sec) = 500 missed LL packets ?&lt;/p&gt;
&lt;p&gt;What if LL packet goes through and acknowledged after 499 missed ones. Will the supervision timeout be deferred for another 10 sec (500 missed CIs)?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thanks for your prompt response&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: GATTS Handle Value Indication - packet retry interval</title><link>https://devzone.nordicsemi.com/thread/153485?ContentTypeID=1</link><pubDate>Thu, 18 Oct 2018 13:09:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:35946a76-a4e4-402d-98d6-02a7bc70bf11</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user=""]What is the timing of the indication retry mechanism (SDK14.2, nRF52832) ?[/quote]
&lt;p&gt;BLE_GATTS_EVT_TIMEOUT which is 30 seconds according to&amp;nbsp;&lt;span&gt;the spec. See Vol 3 (Host) - Part F (ATT) - 3.3.3 (Transaction).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In our SDK examples we normally do a disconnect on this timeout instead of doing a retry. You can change this behavior by doing a retry of sending the indication instead of doing a disconnect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1) could be anything between next connection interval to 30 seconds, hard to say as this will be based on the quality of connection you have, which is in turn based on your surroundings.&lt;/span&gt;&lt;/p&gt;
[quote user=""]e.g. - Does the peripheral expect &amp;#39;GATT level ACQ&amp;#39; within 1/2/3/4/other connection intervals&amp;nbsp; ?[/quote]
&lt;p&gt;No, it does expect to get an ACK in 30 seconds.&lt;/p&gt;
&lt;p&gt;2. With indication you get&amp;nbsp;&amp;nbsp;&lt;span&gt;BLE_GATTS_EVT_TIMEOUT and the app knows that the attempt failed. With notifications you will not know this in the GATT level.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3) I am now confused as to which level of ACK you are talking. There are two levels of acknowledgement that happens. First is the link layer level packet acknowledgement based on SN and NESN. The other is the GATT level acknowledgement which needs to done and received by application explicitly. In the LL , any packet miss will be immediately known when the peer NACK a packet and the packet is re transmitted again. But in GATT level it will take 30 seconds to know that the indication packet or any other write with response has been lost.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>