<?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>Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25751/can-you-specifically-set-the-amount-of-packets-per-interval</link><description>Hi! 
 I have an implementation running with a peripheral sending notifications to a central at 27.5 ms. They are both configured with HIGH BW. Sending of notifications is activated by pressing a button. I now see that when the button is pressed, the</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 10 Oct 2017 09:44:31 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25751/can-you-specifically-set-the-amount-of-packets-per-interval" /><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101442?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2017 09:44:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5320bf99-d8fd-496b-87a0-014694968bde</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;No problem Mathias, I&amp;#39;m glad to help!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101445?ContentTypeID=1</link><pubDate>Tue, 10 Oct 2017 08:45:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:07d959b5-483f-4daa-bf96-defdf36f3891</guid><dc:creator>Mathias</dc:creator><description>&lt;p&gt;Okay, I don&amp;#39;t know what went wrong a while ago when I developed the application but now it seems to work while counting! Thanks very much for your help and really sorry that I wasted your time :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101446?ContentTypeID=1</link><pubDate>Mon, 09 Oct 2017 09:13:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71d31698-d80b-47df-92ed-69f357481e5a</guid><dc:creator>Mathias</dc:creator><description>&lt;p&gt;Well, I thought that was an issue at the time but I&amp;#39;ll make simple count to six case and see if I get the problem again. I&amp;#39;ll let you know what I get tomorrow, right now I need to finish some other work :) Thanks already for your time so far!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101440?ContentTypeID=1</link><pubDate>Sun, 08 Oct 2017 17:40:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53f26231-66d3-4f3f-9b0e-177f392d768f</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Yes, I believe that you don&amp;#39;t need to overflow anything, simply when connection interval comes stack (Soft Device) will look to Tx buffers and tries to send as many as possible. If it has bandwidth to send 6 and there are 6 prepared by higher application layers they should get through. I&amp;#39;m afraid I don&amp;#39;t understand your &amp;quot;sending not sending sending not sending&amp;quot; comment. Does it mean that you got how many PDUs through in case you provisioned how many through &lt;code&gt;sd_ble_gatts_hvx&lt;/code&gt; calls? I&amp;#39;m sorry but I don&amp;#39;t see any indication in the Q&amp;amp;A you linked that you would need to provision Tx packets up to receiving &lt;code&gt;BLE_ERROR_NO_TX_PACKETS&lt;/code&gt; status code from SD to get certain number of packets through on next connection event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101439?ContentTypeID=1</link><pubDate>Sun, 08 Oct 2017 17:11:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c60a4442-2bb7-4efd-90a2-ae0076ef17e1</guid><dc:creator>Mathias</dc:creator><description>&lt;p&gt;But you&amp;#39;re saying that you get 6 packets each interval without overflowing the buffer but by just counting to six? Because I did try that I while ago and that didn&amp;#39;t work. I got the sending, not sending, sending , not sending ... intervals problem so I then starting looking for a solution on the dev zone and bumped into the question I send you..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101438?ContentTypeID=1</link><pubDate>Sun, 08 Oct 2017 17:09:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1d4e4ec7-dce0-4a19-8cc1-1e255b90e2ba</guid><dc:creator>Mathias</dc:creator><description>&lt;p&gt;This comment in the answer to the question states what I mean: &amp;quot;As you already mentioned, the nature of BLE doesn&amp;#39;t support realtime requirement. All packet will be transmitted I assume that you want to only update the latest sample on each connection interval, my suggestion for you is to try to keep track of the number of packet in the buffer by using the number of packet you queue, minus the number of packet sent reported in BLE_EVT_TX_COMPLETE. If in one BLE_EVT_TX_COMPLETE you have the number of packet in the buffer is full, you would need to queue at least 7 packets (if the max number of packet per connection interval is 6). This is to make sure you will have at least 1 packet to be sent in the connection after the next one. So that we will not get into the situation with one connection event with packet sent and one without.&lt;/p&gt;
&lt;p&gt;But anyway, it will have a 7.5ms latency because you can&amp;#39;t have a packet sent immediately but will have to wait for the next connection interval.&amp;quot;&lt;/p&gt;
&lt;p&gt;So what I&amp;#39;m saying is that to have 6 PDU&amp;#39;s every interval, I need to put a 7th as well, that overflows the buffer and makes sure that the next interval is also used to empty the then again refilled TX buffers. And the issue that I&amp;#39;m having is that in the first interval, 7 packets can apparently be tried to send with an 8th overflowing the buffer. If I would just count to 6, the buffer wouldn&amp;#39;t overflow and thus I would get interval sending, next not sending, next sending ... If I would count to 7 you might say, then I do overflow the buffer but not in the first interval, that requires 8 packets to overflow... So that&amp;#39;s my issue :/&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101437?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 19:50:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcd1aac9-c8f6-43ca-ab61-80efde873779</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Sorry, I don&amp;#39;t see the link with &amp;quot;calling HVX inside radio notification handler&amp;quot;. Can you point me exactly to the spot in whole thread? I still believe that using single connection link and 7.5ms works for me in terms of achieving full 6 PDUs (but I can understand that these 1-2ms left for application might not give you enough time to process/prepare these data so going with connection interval in 10-20ms range might be solution, still better then what you use today).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101444?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 12:27:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b44a79c4-2f6f-4494-b3e6-5a84547c1dfb</guid><dc:creator>Mathias</dc:creator><description>&lt;p&gt;It&amp;#39;s around 5.3 ms when I tested it :) I&amp;#39;m just rounding a little bit. Well, I already once tried with the counting to six but then I got issues that I don&amp;#39;t overflow the buffer and thus the next interval is not used to send user made packets because the previous interval the buffer wasn&amp;#39;t overflowed (as stated in this question &lt;a href="https://devzone.nordicsemi.com/question/47561/calling-sd_ble_gatts_hvx-in-radio-notification/)"&gt;devzone.nordicsemi.com/.../)&lt;/a&gt;. Indeed, only one connection and no timeslots or other kind of tricks :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101443?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 12:22:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6a544a1-129c-4d7a-981a-58814f17463f</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Not sure that I do follow your architecture but I would do it as follow: your FW needs to know what data it wants to send when which translates into number of packets. If you want to send just 6 then count to six and push the next after you receive TX_COMPLETED event or later (e.g. triggered by some application timer well before next event). Note that 6 PDUs of basic size (37B on LL, 23 on ATT, 20 on GATT) will go out within ~5ms (that&amp;#39;s what I remember although I didn&amp;#39;t run such throughput test recently) so there should be plenty of space to a) lower the connection interval and b) do other long-lasting tasks like UART/SPI/I2C communication. ll assuming this is the only connection you maintain (and no time slots or other tricks which restrict MCU availability)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101436?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 12:18:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e9d6dc30-7cd6-4631-bd23-fff79824c6ef</guid><dc:creator>Mathias</dc:creator><description>&lt;p&gt;And so each next interval, only 6 tx buffers will be free and available for use? I did what you asked with the GPIO pin in TX_COMPLETE event and added a figure to the question. So as the figure shows, only 6 packets are really send each interval. What&amp;#39;s also strange is that the first two intervals are respectively a bit more then 27.5 ms (around 29 ms) and the other one a bit less (around 25 ms). After that all the intervals are 27.5, like they should be. Do you guys maybe know why this could be?&lt;/p&gt;
&lt;p&gt;But the problem for me with the 8 packets until overflow in the first interval is that it also takes more time to measure all that data and put it in the buffer then with 7 until overflow. If all intervals would just be 6 packets and a 7th that overflows, I could choose an even lower connection interval. This is positive because every ms that I don&amp;#39;t do I2C, I lose a measurement done by the sensor and a radio event already takes around 5 à 6 ms for 6 packet sending but also because the first interval needs a bit more time, the other intervals have some useless free time left (around 1 à 2 ms) before a radio event happens. But I can&amp;#39;t choose a lower connection interval, otherwise I get problems because the first interval that does 8 instead of 7 packets doesn&amp;#39;t get enough time then.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101441?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 08:31:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:54767e22-012c-49ad-89dc-fe2801281b10</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Actually there are 7 tx buffers so 7 will be sent in the first event. But because of the &amp;quot;lazy ack&amp;quot; scheme only 6 buffers will be freed, the last buffer will be acked by the master in the first packet in the next connection event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101435?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 08:25:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f276b9ce-da7b-4825-af7e-ebb2c59e79da</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;I believe it actually transports 6 packets over the radio, note that Tx buffers inside SD aren&amp;#39;t necessarily linked to number of packets transported over radio link. Do you have some confidence by looking into radio analyzer/sniffer trace that different numbers are going through the link in each interval? otherwise if you push 7 packets to the stack and then 6 of them are &amp;quot;cleaned&amp;quot; so you can push 6 more it indicates that 6 are going over the radio... can you make some GPIO counter on TX_COMPLETED event if their count corresponds to the numbers?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Can you specifically set the amount of packets per interval?</title><link>https://devzone.nordicsemi.com/thread/101434?ContentTypeID=1</link><pubDate>Fri, 06 Oct 2017 08:22:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04119f27-fb3f-4a1a-bc27-caa14af5716c</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Not really possible. But you could count the number of packets to see how many you place in the buffers. The tx_complete event will tell you how many packets are actually sent. I guess you could use radio notifications to start filling the buffers prior to the event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>