<?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 the nus mode is automatically subcontracted and sent efficiently?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25493/how-the-nus-mode-is-automatically-subcontracted-and-sent-efficiently</link><description>Hi, there 
 
 NRF51822 
 SDK9.0.0 and S110 
 
 How to subcontract in uart nus mode to ensure that each packet does not exceed 20 bytes and is sent as quickly as possible? The official demo must pass the special character to distinguish the last packet</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Sep 2017 08:15:15 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25493/how-the-nus-mode-is-automatically-subcontracted-and-sent-efficiently" /><item><title>RE: How the nus mode is automatically subcontracted and sent efficiently?</title><link>https://devzone.nordicsemi.com/thread/100490?ContentTypeID=1</link><pubDate>Thu, 28 Sep 2017 08:15:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8553977d-a388-4546-b6a4-ccedddc3ee53</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Well that was quick;) So you mark the right answer and close the question????&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How the nus mode is automatically subcontracted and sent efficiently?</title><link>https://devzone.nordicsemi.com/thread/100487?ContentTypeID=1</link><pubDate>Thu, 28 Sep 2017 05:34:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86eded85-ee4d-4051-9686-1db3ed9dfaf5</guid><dc:creator>Corey</dc:creator><description>&lt;p&gt;Thanks.
Now it&amp;#39;s working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How the nus mode is automatically subcontracted and sent efficiently?</title><link>https://devzone.nordicsemi.com/thread/100489?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2017 13:04:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:55a36d5f-0764-4d5b-a432-e086beefddef</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;(2/2)&lt;/p&gt;
&lt;p&gt;... header to each bunch of data which you want to link together (e.g. length of subsequent data which will mean that receiving side should be waiting and buffering data packets as long as it is shorter then this value). And of course many other options, so many protocols solve it in so many ways... (e.g. ASN.1 BER-TLV system is designed exactly for such purposes;)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How the nus mode is automatically subcontracted and sent efficiently?</title><link>https://devzone.nordicsemi.com/thread/100488?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2017 13:02:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:427f7608-27fb-48dd-81a0-09cc2337d595</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Well NUS is unstructured serial line without flow control. So the question is: how would you handle the same transfer if that would be wire and not BLE? Minimum is to implement some FIFO mechanism which keeps track about offset in data buffer from where data already went over BLE link. Link Layer in the stack has typically several buffers (6+) so you can stack your 20-byte packets there and once lower layer says that no more Tx buffers are available then you need to wait for Tx completed event and continue in your state machine. This will be pretty easy to implement (many Q&amp;amp;S on this forum and similar things are shown in nRF5 SDK examples) but it will work only if higher layer will be able to interpret such stream of data. If not then you can either add some header to each packet (e.g. one byte which codes if that is start of the packet, middle or the end) or... (1/2)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How the nus mode is automatically subcontracted and sent efficiently?</title><link>https://devzone.nordicsemi.com/thread/100486?ContentTypeID=1</link><pubDate>Wed, 27 Sep 2017 03:35:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:71a1390b-3045-4a4f-932a-98ca937a56c3</guid><dc:creator>Corey</dc:creator><description>&lt;ol&gt;
&lt;li&gt;Yes, i&amp;#39;m using Nordic BLE UART Service (NUS) ,&lt;/li&gt;
&lt;li&gt;Be sending data mostly long 200B+,  the maximum packet can be up to 10KB+ sometime. But the master transmitter can set the length of the data to be sent.&lt;/li&gt;
&lt;li&gt;The main function is NUS, so the overhead is not high priority, the premise is to ensure fast enough and stable transmission.&lt;/li&gt;
&lt;li&gt;Maybe I still need a simple transfer protocol？&lt;/li&gt;
&lt;li&gt;If the length of the data to be sent is 128 bytes, then ble should be split into six 20-byte packets and an 8-byte packet, how to do it without any additional protocol ?&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How the nus mode is automatically subcontracted and sent efficiently?</title><link>https://devzone.nordicsemi.com/thread/100485?ContentTypeID=1</link><pubDate>Tue, 26 Sep 2017 18:40:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4575c211-51d2-4da8-8a62-a6ff8a36b6bd</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;What do you mean by &amp;quot;subcontract&amp;quot; and &amp;quot;nus mode&amp;quot;? If you want to say that you are using Nordic BLE UART Service (NUS) example and want to be sure that you always pass 20 bytes to it well then simply implement some logic on top of NUS data transfer function to be sure that longer data get fragmented properly. Of course there are plenty ways of making fragmentation, you can get inspiration from any networking protocol. All depends on your priorities: do you need to have the protocol easy to parse (= small code size) or you don&amp;#39;t care if it&amp;#39;s few bytes bigger FW image but you want to have as minimal overhead? And for what sizes you want to optimize your protocol (= will you be sending mostly small packets &amp;lt;20B or mostly some medium 20-200B or mostly long 200B+)?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>