<?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>How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28526/how-to-receive-ble_evt_tx_complete-faster</link><description>Greatings! 
 I am sending a packet with data in it from my custom board with nrf51822 to my android phone using cahnged ble_app_uart. The packet is being sent 8 times before I receive event BLE_EVT_TX_COMPLETE . Is it possibile to reduce time for receiving</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 Dec 2017 14:00:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28526/how-to-receive-ble_evt_tx_complete-faster" /><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112960?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 14:00:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d95f51cf-6ca2-4ce4-9adf-5b71d6465566</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;@endnode used indication and waiting for  case	BLE_GATTS_EVT_HVC: event. After rereading I luckily made it. Thank you for your help.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112958?ContentTypeID=1</link><pubDate>Wed, 20 Dec 2017 13:57:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b23ad59-b7ab-4cff-9112-a56a2cbd6024</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;@run_ar @endnode I just solved the problem. By using indications instead of notifications. Thank you, guys, for suggesting all the possibilities. I was not able to understand how indications can be implemented. Fortunately after long rereading I figured what you meant all that time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112959?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 18:50:28 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5557d758-e973-4306-8a40-10184764f215</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Btw. &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v4.0.2/structble__gatts__evt__hvn__tx__complete__t.html?resultof=%22%62%6c%65%5f%67%61%74%74%73%5f%65%76%74%5f%68%76%6e%5f%74%78%5f%63%6f%6d%70%6c%65%74%65%5f%74%22%20"&gt;&lt;code&gt;BLE_GATTS_EVT_HVN_TX_COMPLETE&lt;/code&gt; makes &lt;code&gt;ble_gatts_evt_hvn_tx_complete_t&lt;/code&gt; structure available which says how many Tx packets went out in last connection interval&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112954?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 13:29:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a46eb76-e2d6-45be-8b4d-b9bc4006838c</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;(2/2) 3. Finally if this is still not enough for you then simply build your own &amp;quot;ack&amp;quot; mechanism on APP layer meaning that your application protocol commands will define flow where both sides will let the other side know that previous packet arrived and was processed.&lt;/p&gt;
&lt;p&gt;As you see you have plenty of options and each of them is really easy to achieve with nRF5 SDK and Nordic Soft Device API.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112953?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 13:26:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c0bfd8cf-c75d-4caf-aa69-b9e0cfbe7e5d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;So back to drawing board. In principle you have 3 independent mechanisms inside BLE stack which can serve as acknowledgement that peer device received the packet over radio:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Each LL PDU is acknowledged by sequence number of next incoming PDU from the other side. That&amp;#39;s what will cause TX_COMPLETE event callback from Nordic Soft Device. This is reason why so many people love BLE (because it&amp;#39;s simple and reliable) and that&amp;#39;s why almost nobody really cares about any true &amp;quot;ack&amp;quot; on higher layers = because it&amp;#39;s very unlikely and rare that BLE stack on any device would lose the packet before handing it over to higher layers.&lt;/li&gt;
&lt;li&gt;Anyway if you don&amp;#39;t trust (for whatever reason) ability of stack on the other side to deliver the packets you can use &amp;quot;ack&amp;quot; mechanism on (G)ATT layer by using Indications and Write with Response (instead of Notifications and Write without Response).&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;(1/2)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112952?ContentTypeID=1</link><pubDate>Tue, 12 Dec 2017 12:56:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dbb1700-b3db-4e8e-911d-30ff362882ba</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;@run_ar to be honest, I am confused at this point... I have check the tutorials. But it is still unclear for me how to send a data packet and receive acknowledgment from master about receid packet. In other words I would like to receive one packet by master.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112949?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 14:23:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f1c8ec67-0660-481c-94ae-a480dfad1a68</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;No, you should connect. Not sure what you are trying to achive. I would also recommend that you take a look at our &lt;a href="https://devzone.nordicsemi.com/tutorials/"&gt;tutorials&lt;/a&gt; if you have not done so already.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112956?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 12:37:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55f91bc2-247c-499f-9607-fa8e90b4f00c</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;@run_ar so, in this case I should rather use advertising packets to send information to master?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112955?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 12:17:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b077e2c0-62d7-4c7a-ba53-a4059a43ec61</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;@chocol8 Later on when you are receiving commands from the master, you will get an event from the softdevice, no need to use tx_complete_event for this. The tx_complete event will just tell you that the tx buffer (s) has been freed...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112951?ContentTypeID=1</link><pubDate>Sun, 10 Dec 2017 22:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9944d54-0c46-4060-a04c-f14183284222</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;(2/2)&lt;/p&gt;
&lt;p&gt;Indeed I don&amp;#39;t have time to gather any evidence that this is exactly what happens in your special case with S110 V7 or S130 V1/2 but I judge that based on my experience. You have simple options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Debug the thing on finer time scale to see exactly TX PDUs inside the connection interval and TX_COMPLETE events.&lt;/li&gt;
&lt;li&gt;Wait if someone else (e.g. Nordic support team) will invest their time into doing this for you.&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112950?ContentTypeID=1</link><pubDate>Sun, 10 Dec 2017 22:22:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:67398d95-f54f-4cee-a2db-a79f95ffe043</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;No, I haven&amp;#39;t said and I don&amp;#39;t think you will never get TX_COMPLETE event. There is actually no other way to know that something happened on GATT layer in outbound direction so you should keep using it (the only other way would be to &amp;quot;shoot into the dark&amp;quot; by simply trying to put more outgoing notifications any time your BLE event handler is triggered by any event or based on some timer). The only thing I said is that you shouldn&amp;#39;t expect as many TX_COMPLETE events as many packets you pushed because some of them may go through within one connection interval where there is no time for application processing between PDUs processed by Soft Device. I would simply expect that stack will trigger you as soon as at least one TX slot emptied and there is any time for APP layer processing.&lt;/p&gt;
&lt;p&gt;(1/2)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112947?ContentTypeID=1</link><pubDate>Sun, 10 Dec 2017 16:21:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9206e01-44ca-4c0a-ae34-bd03855ca4b4</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;@run_ar Thank you for helping me out. yes, I thought of this. But the thing is that later on I am planning to send comands from master device. This way peer must receive and decode them.&lt;/p&gt;
&lt;p&gt;@endnode thank you for your contribution and explaining this in detail. No, I do not have any reason for using old stack. I will try s130 on my spare and compare. Right now I understand that I can not receive TX_complete event. I used this because I was not aware of other ways to notify cpu when a data packet was received.&lt;/p&gt;
&lt;p&gt;Could you, guys, explain me how to use sd_ble_gatts_hvx to notify cpu that a packet was received, so it proceed further?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112948?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 13:18:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3652180a-faf5-4c17-a560-7eb2595e7209</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Btw. any reason why using so old stack? It looks like first 6 PDU/GATT packets are going inside first connection interval while remaining 2 in next. I would expect getting TX_COMPLETE right after first 6 packets but maybe S110 waits further (e.g. because it thinks there is no time for reasonable APP processing or simply bug/limitation of the old stack). Maybe someone can test this and then compare with S130 V2? Anyway it&amp;#39;s kind of evident that in this case you cannot expect TX_COMPLETE after each packet but only after first connection interval...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112957?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 12:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:60710c6d-8ec5-4cd4-a38d-e71b4c07bae2</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Have you considered using indications for this instead? I.e. application layer acknowledgement. The drawback is that it is slower than notification.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112946?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 11:28:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4ee33dec-07be-4918-832c-c6764ad78c82</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;It is my bad to not making it clear that I want it to send one time and then wait till I know that master have received it. After that while being in the same connection I would like to send more data. Would it be possibile using sd_ble_gatts_hvx? Should I use it as in [this example] ? (&lt;a href="https://devzone.nordicsemi.com/question/18803/how-to-send-20-bytes-using-sd_ble_gatts_hvx/)"&gt;devzone.nordicsemi.com/.../)&lt;/a&gt; or I should send it using ble_nus_send_string and wait for indication in sd_ble_gatts_hvx? Could make explain more details how should I use sd_ble_gatts_hvx ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112945?ContentTypeID=1</link><pubDate>Fri, 08 Dec 2017 09:37:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c48e5d52-ebac-4b94-88a0-322ad9117f55</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Not sure I understand the problem here. But why would you use the tx_complete event to determine when to send another packet? I.e. If you only want to send the packet once, you should only call the sd_ble_gatts_hvx one time. The packet is buffered in the SD until it&amp;#39;s received by the peer or the connection is disconnected.&lt;/p&gt;
&lt;p&gt;If you want to send one packet per connection event you could use radio notifications to let your application know when to prepare the next packet.&lt;/p&gt;
&lt;p&gt;If you want to send data as fast as possible, just loop through your date until the Softdevice buffers are full (7 or 6 if you sent packets in the previous connection event.)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112943?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 12:31:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a99f5c5-2993-4763-95c7-d5e1b193e3a4</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Which SoftDevice and SDK version are you using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to receive BLE_EVT_TX_COMPLETE faster?</title><link>https://devzone.nordicsemi.com/thread/112944?ContentTypeID=1</link><pubDate>Thu, 07 Dec 2017 09:48:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fe8bbc92-0478-4b76-8191-d53a7f0178bf</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Do you have any real-time trace where you would correlate on-air packets and SoftDevice BLE events? Because you will typically get the event after connection interval is over and if your stack transports more then on PDU in the interval there is now way to have this event in between (but also that&amp;#39;s not an issue for you because there is no time to do anything with it anyway, timing during the ongoing connection event is too strict and fast for application processing between packets). But 8 PDUs look suspicious because that should need more then one connection interval even if your stack sends multiple packets (because typical limit is 6 not 8).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>