<?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>Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>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</link><description>I am going to send a sequence of notifications and the documentation provides this information 
 The API functions that may consume an application packet depending on the parameters supplied to them can be found below: 
 
 sd_ble_gattc_write (write without</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 02 Feb 2021 14:47:45 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="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" /><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292515?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 14:47:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:354cd876-e3f4-4523-8e5b-e3e6001a1dd6</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;For the old S130 this was done differently, please check out:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__conn__bw__counts__t.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v3.0.0/structble__conn__bw__counts__t.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/21483/6-notifications-in-one-connection-interval-related-issue/84287#84287"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/21483/6-notifications-in-one-connection-interval-related-issue/84287#84287&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292453?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 11:39:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9be29395-4e75-414f-af0d-9e0a8a88c926</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Okay, that is interesting. I automatically assumed that the entire connection interval would be used. In this case I am using the minimum MTU (developing a new standard and want to assure it works under minimal conditions) and letting the peer set the connection parameters (because as I understand it the central can do what it wants and ignore the peripheral&amp;#39;s requests).&lt;/p&gt;
&lt;p&gt;So what you are saying is that maybe the default configuration is not making full use of the connection interval. (occasionally I do get a 2 in the count). ... and I have the power to change this. Well, I&amp;#39;ll certainly need to look into that!&lt;/p&gt;
&lt;p&gt;Never mind! I am using SoftDevice s130 and according to the documentation the method&amp;nbsp;&lt;code&gt;sd_ble_cfg_set&amp;nbsp;&lt;/code&gt;does not exist. There might be another way to do it, but I note that the ble_cfg structure does not exist either. Is there another way to do this in s130?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292411?ContentTypeID=1</link><pubDate>Tue, 02 Feb 2021 09:39:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:624302a1-fc21-4dc4-9d2a-56498c14a3d1</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;You should be able to get more than count=1 for each complete event, however it may be that you have not configured the BLE event to have time for more than 1 packet. You can find this thread useful on how to increase the event length:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/22698/setting-gap-connection-event-length---ble-hrs-c-demo"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/22698/setting-gap-connection-event-length---ble-hrs-c-demo&lt;/a&gt;&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292342?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 19:30:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09861199-7d3b-4596-be6f-bab3044f2f5b</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;One more question, if I send 5 packets by notifications in a loop how many&amp;nbsp;&lt;span&gt;&amp;nbsp;BLE_EVT_TX_COMPLETE events will I get? It appears I will get 5. I was expecting to get 1 with a count of 5 in that event. How does this work? But I am never seeing a count greater than 1.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I have the feeling one has to do something like this&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;1. For every notification, increment a count by one&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;2. For every&amp;nbsp;BLE_EVT_TX_COMPLETE event, decrement the count by the count returned in the event.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;3. When 0, all indications have been sent.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292332?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 17:32:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1ff516fe-8736-4c3f-9e82-7a0941769fb5</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Only indications.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292281?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 14:29:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ce18450e-504f-42ef-9664-bbf7f858cb6b</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;Will I ever get an NRF_ERROR_BUSY event using notifications or will that only happen on indications?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292280?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 14:26:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e552760-712b-4743-8fcc-0d4afaf697db</guid><dc:creator>Kenneth</dc:creator><description>[quote user="brianreinhold"]do I have to send the same packet again AFTER the BLE_EVT_TX_COMPLETE event[/quote]
&lt;p&gt;On any error you need to call &lt;span&gt;sd_ble_gatts_hvx() with the same packet again later yes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Kenneth&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292152?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 09:28:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:47546a3d-4dea-4710-852c-d2480017615e</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;In this case I don&amp;#39;t think it would have helped. I was basing my code on what I understood the behavior of the API to be. On the air I tend to look at the packets, not the packets in a time sequence with respect to the connection intervals. (Im sure the front line sniffer can do this but that is not where I would be looking.) My problem was from the description of the method I assumed a one to one relation between call and event.&lt;/p&gt;
&lt;p&gt;At the moment I still don&amp;#39;t know what happens when I make the call and get a BLE_ERROR_NO_TX_PACKETS response ... do I have to send the same packet again AFTER the BLE_EVT_TX_COMPLETE event or is it sufficient just to wait for the event and THEN send the next packet? At the moment I have not run into the problem as I have not had a sufficiently long sequence to run out of buffers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292134?ContentTypeID=1</link><pubDate>Mon, 01 Feb 2021 08:38:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1f116a4a-0b06-47e7-aa04-9ca197c58c76</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Typically an on-air sniffer log, such as nRF sniffer, may be helpful to find what may be the limiting the throughput.&lt;/p&gt;
&lt;p&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/292054?ContentTypeID=1</link><pubDate>Fri, 29 Jan 2021 22:03:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f13b429-0de8-4522-a88a-1461071b259f</guid><dc:creator>brianreinhold</dc:creator><description>&lt;p&gt;I did an experiment where I changed indications to notifications and in all cases the data transfer was slower with notifications. I am trying to understand why.&lt;/p&gt;
&lt;p&gt;In my case I have a long characteristic of 90 or so bytes that are either indicated one after the other or notified one after the other. When using indications I indicated one hunk (MTU = min size 23) waited for the Indication done event, BLE_GATTS_EVT_HVC, and indicated the next hunk and so on. In the notification case the procedure was the same except I waited for the BLE_EVT_TX_COMPLETE event before sending the next notification.&lt;/p&gt;
&lt;p&gt;The wait procedure was the same in both cases, sd_app_evt_wait() and then on wake up do the sd_ble_evt_get() loop. All this was done in the main thread.&lt;/p&gt;
&lt;p&gt;Its not the greatest test given the size of data indicated or notified was not that big, but in all cases the indication case was faster; completely unexpected. Is that some fluke about the handling of the TX buffers that makes it slower?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Notifications: How to know who is consuming tx buffers, most efficient way of sending a sequence, what error conditions are received?</title><link>https://devzone.nordicsemi.com/thread/291856?ContentTypeID=1</link><pubDate>Thu, 28 Jan 2021 16:17:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c91959df-61bc-4802-95a2-7dd492968bd6</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;The softdevice will try to send packets as fast possible, depending on the connection parameters, peer capabilities, other procedures, and packet loss. The simplest may be to have an app_timer that run slightly faster than the connection interval, and just write&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx() until you receive an error code from the timeout handler. It is also possible to wait for&amp;nbsp;BLE_EVT_TX_COMPLETE before calling&amp;nbsp;sd_ble_gatts_hvx(), however that presumes you have called&amp;nbsp;sd_ble_gatts_hvx() previously, else the&amp;nbsp;BLE_EVT_TX_COMPLETE&amp;nbsp;is not triggered. But both can work.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The&amp;nbsp;NRF_ERROR_BUSY&amp;nbsp;may happen if you are sending indications (not notifications).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>