<?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>send data over uart without losing connection</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12648/send-data-over-uart-without-losing-connection</link><description>hi all,
i have a electronic device having a button which sends continous data till i keep button pressed.
i want to send these data without losing connection.
i can across this tutorial 
where it is written that i can send data using ble_nus_c_string_send</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 21 Mar 2016 19:29:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12648/send-data-over-uart-without-losing-connection" /><item><title>RE: send data over uart without losing connection</title><link>https://devzone.nordicsemi.com/thread/48042?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2016 19:29:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2df621c1-469b-4f9e-aba4-015bc814a119</guid><dc:creator>Christopher</dc:creator><description>&lt;p&gt;Many users already asked for you problem (&lt;a href="https://devzone.nordicsemi.com/questions/scope:all/sort:relevance-desc/page:1/query:BLE_ERROR_NO_TX_BUFFERS/"&gt;see here some search results&lt;/a&gt;). Here is a &lt;a href="https://devzone.nordicsemi.com/question/54683/ble_nus_send_string-ble_error_no_tx_buffers-error/"&gt;Nordic&amp;#39;s answer&lt;/a&gt;, and &lt;a href="https://devzone.nordicsemi.com/question/70360/ble-tx-buffer-overflow/"&gt;here is another one&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;As &lt;a href="https://infocenter.nordicsemi.com/index.jsp?topic=%2Fcom.nordic.infocenter.sdk51.v10.0.0%2Fgroup__nus__c__functions.html"&gt;described here&lt;/a&gt;, you can send up to 20 bytes in each notification packets. Depending on the SoftDevice you use, you can send one or more BLE packets per connection interval.&lt;/p&gt;
&lt;p&gt;To send a large chunk of data, you have to use the &lt;code&gt;BLE_EVT_TX_COMPLETE&lt;/code&gt; event. A simple solution consist of sending as many bytes as you can until you get the &lt;code&gt;BLE_ERROR_NO_TX_BUFFERS&lt;/code&gt;, and then wait for the &lt;code&gt;BLE_EVT_TX_COMPLETE&lt;/code&gt; event to send again as much as data as you can. Another solution consist of tracking the number of available TX buffers/packets (using &lt;code&gt;p_ble_evt-&amp;gt;evt.common_evt.params.tx_complete.count&lt;/code&gt;).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: send data over uart without losing connection</title><link>https://devzone.nordicsemi.com/thread/48041?ContentTypeID=1</link><pubDate>Mon, 21 Mar 2016 13:14:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ed0e922a-99fe-4369-8386-f89546f9de56</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;You need a buffer (or &amp;quot;queue&amp;quot;) to hold the data that&amp;#39;s awaiting transmission.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>