<?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>Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/71103/why-are-notifications-slower-than-indications-with-softdevice-s130-on-nrf51822</link><description>This question stems from this discussion 
 https://devzone.nordicsemi.com/f/nordic-q-a/71044/notifications-how-to-know-who-is-consuming-tx-buffers-most-efficient-way-of-sending-a-sequence-what-error-conditions-are-received 
 but is so important as a new</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Feb 2021 08:00:09 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/71103/why-are-notifications-slower-than-indications-with-softdevice-s130-on-nrf51822" /><item><title>RE: Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/thread/293028?ContentTypeID=1</link><pubDate>Fri, 05 Feb 2021 08:00:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7df1ba84-391c-45ee-b228-85accd39ed36</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;I understand. Let us know if you have any further questions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/thread/292847?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 09:26:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39fa2626-a9ad-4750-86c8-f03d1daf5b85</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;At the moment I am stuck on the nRF51822 as that is what is being used on the production device and s130 is the best we got (they used to use s110 but I was able to upgrade that). s110 had issues with the flash writes (it didn&amp;#39;t write) that simply moving to s130 solved without code changes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/thread/292831?ContentTypeID=1</link><pubDate>Thu, 04 Feb 2021 08:44:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05d4c270-8649-4ad1-8cdc-7293baf33c94</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Yes, it&amp;#39;s always hard to document these things in a good way. I usually look at the message sequence charts for the SD to see what is going on. For the S130 this is a bit limited: &lt;span&gt;&lt;a title="GATTS Handle Value Notification" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___b_l_e___g_a_t_t_s___h_v_n___m_s_c.html?cp=5_7_2_2_2_4_3_4"&gt;GATTS Handle Value Notification&lt;/a&gt;&lt;/span&gt;. But we have more details for newer softdevices: &lt;span&gt;&lt;a title="GATTS Handle Value Notification" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_s___h_v_n___m_s_c.html?cp=4_7_3_1_2_4_3_5"&gt;GATTS Handle Value Notification&lt;/a&gt;&lt;/span&gt; (Newer message sequence charts are not necessarily valid for older SD versions)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/thread/292450?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 11:28:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef4c10dc-fd7f-4a57-a5cb-afbc444e70c7</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Thanks. I am well aware of the documentation. But it is not always clear on these critical points. My understanding is now that the NRF_ERROR_BUSY&amp;#39; is ONLY for indications. What was not clear when the&amp;nbsp;&lt;span&gt;BLE_ERROR_NO_TX_PACKETS&amp;nbsp;error came was if the packet was internally queued but before you send another you have to wait for the event. I have noted that the &amp;#39;count&amp;#39; returned with the event is most frequently one. So I guess there is an attempt to make a one-to-one correspondence between the sd_ble_gatts_hvx call and the event but that is not always possible.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;It would help if there was more in the documentation about how indications and notifications work in SoftDevice as that does influence code design. Its also pretty central in data transfer. I understand its impossible to clarify everything, but in my case I came away with more questions than answers after reading the documentation. I can also understand that sd_* documentation has lower priority as most are probably using the SDK and they are hidden from this stuff.&lt;/p&gt;
&lt;p&gt;But by far and away, the best thing about Nordic is the responsiveness they have on this forum!&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/thread/292403?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 09:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cea80c62-d345-4c27-8997-f7f095e8cee9</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;For reference: &lt;span&gt;&lt;a title="sd_ble_gatts_hvx" href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s130.api.v2.0.1/group___b_l_e___g_a_t_t_s___f_u_n_c_t_i_o_n_s.html?cp=5_7_2_2_2_4_2_3#ga313fe43c2e93267da668572e885945db"&gt;sd_ble_gatts_hvx&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;1. Most likely you would only see this for indications.&lt;/p&gt;
&lt;p&gt;2. Yes, if you get this error it means there was no available buffers, so you need to resend that particular packet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/thread/292083?ContentTypeID=1</link><pubDate>Sun, 31 Jan 2021 15:20:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26989079-d9e6-4990-a3e7-72a5a14c3e8d</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Okay, didn&amp;#39;t know that was how it worked. I assumed that was just a queue and under the hood it would send and generate a response event for each packet in the queue. But if one can stuff 6 packets in a connection interval and that generates only one event, then its an entirely different story! I guess I&amp;#39;ll find out! Thanks for the suggestion.&lt;/p&gt;
&lt;p&gt;I did that and it sure made a difference! Thanks for pointing that out for me. Had no idea it worked like that!&lt;/p&gt;
&lt;p&gt;There is NOT a one to one correspondence between packets and events as I assumed. There are far fewer events than packets! However, I did note that the event has a parameter indicating how many packets were sent so you still know if everything you queued at least went out the door. This statement in the documentation led me astray&lt;/p&gt;
&lt;p&gt;&lt;span&gt;It is important to note that a notification will&amp;nbsp;&lt;/span&gt;&lt;b&gt;consume an application buffer&lt;/b&gt;&lt;span&gt;, and will therefore generate a&amp;nbsp;&lt;/span&gt;&lt;a class="el" href="https://devzone.nordicsemi.com/f/nordic-q-a/71103/why-are-notifications-slower-than-indications-with-softdevice-s130-on-nrf51822/group___b_l_e___c_o_m_m_o_n___e_n_u_m_e_r_a_t_i_o_n_s.html#ggaa55e423bfea45f03764a636f2cec7a8ba408a77f131a2d314fbf477cdb2d1e0f6"&gt;BLE_EVT_TX_COMPLETE&lt;/a&gt;&lt;span&gt;&amp;nbsp;event when the packet has been transmitted.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I still have some questions:&lt;/p&gt;
&lt;p&gt;1. Can I get an NRF_ERROR_BUSY when doing notifications?&lt;/p&gt;
&lt;p&gt;2. If I get a&amp;nbsp;BLE_ERROR_NO_TX_PACKETS response do I have to resend the packet after I wait for the event?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Why are notifications slower than indications with SoftDevice s130 on nRF51822?</title><link>https://devzone.nordicsemi.com/thread/292078?ContentTypeID=1</link><pubDate>Sun, 31 Jan 2021 12:52:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81fc749a-441b-43aa-9613-e01a76e34880</guid><dc:creator>Dmitry</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;what I can see from debug log - the time is exactly the same for notifications and indications (97-98 ms), except for&amp;nbsp;the first packet that&amp;#39;s not in sync with connection timeline.&lt;/p&gt;
[quote userid="83646" url="~/f/nordic-q-a/71103/why-are-notifications-slower-than-indications-with-softdevice-s130-on-nrf51822"]All events handled app checks send data flag. It is set, app calls&amp;nbsp;sd_ble_gatts_hvx() to send first chunk and clears flag[/quote]
&lt;p&gt;Then you have exactly one packet per connection interval, no matter whether it&amp;#39;s a&amp;nbsp;&lt;span&gt;notification or indication.&amp;nbsp;&lt;/span&gt;Try to change your algorithm to call&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() until it returns&amp;nbsp;BLE_ERROR_NO_TX_PACKETS, to fill notification queue and allow SoftDevice to send as many packets in a connection event as it can.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>