<?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>Check NUS paket is sent ( Data &amp;gt; 23 bytes ) and redy for new transmission</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/30300/check-nus-paket-is-sent-data-23-bytes-and-redy-for-new-transmission</link><description>Hello, 
 we have two custom boards with nRF51822. 
 We use NUS. 
 If our pakets under 23 Bytes everthing is fine .... 
 If we want to sent paket with 140bytes, the central hangs ... 
 We know the problem is the MTU of 23bytes. 
 Because of future compability</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 07 Feb 2018 12:46:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/30300/check-nus-paket-is-sent-data-23-bytes-and-redy-for-new-transmission" /><item><title>RE: Check NUS paket is sent ( Data &gt; 23 bytes ) and redy for new transmission</title><link>https://devzone.nordicsemi.com/thread/120105?ContentTypeID=1</link><pubDate>Wed, 07 Feb 2018 12:46:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d6fb0878-8d46-4afb-9fc6-5ae0d415fd31</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;you need to wait for the&amp;nbsp;BLE_EVT_TX_COMPLETE event, in addition hold a variable which has the buffer length.&lt;/p&gt;
&lt;p&gt;then every time you send a package, you substract to know the offset to sent the next bytes from and increment the offset.&lt;br /&gt;and do it all over until the connection&amp;nbsp;breaks or the buffer is empty.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case BLE_EVT_TX_COMPLETE:
        	if(m_DataOffset &amp;lt; m_DataSize){ // have we reached the end of buffer
        		m_ble_nus_c.conn_handle = p_ble_evt-&amp;gt;evt.common_evt.conn_handle; // Multi connection handling
        		SendNUSData(&amp;amp;m_ble_nus_c); // here the data is sent
        	}
        	break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps&lt;/p&gt;
&lt;p&gt;Martin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>