<?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>NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/16865/nrf-uart-service-long-data-to-send</link><description>Hi, 
 Today, i try to use the UART SERVICE from nordic on both smartphone and NRF51.
I succeed to send data between the two.
But now, i want to send data longer than 20 bytes. 
 My idea is to cut the long data in lot of 20 bytes data.
I need a response</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 10 Oct 2016 13:39:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/16865/nrf-uart-service-long-data-to-send" /><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64588?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 13:39:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:37083f1d-5768-4b38-813e-e7aaae63a87f</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Yes, it&amp;#39;s that one!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64587?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 13:36:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24a0ac9a-4e54-4f90-a5e7-c2c82d7217d1</guid><dc:creator>jean.oriano</dc:creator><description>&lt;p&gt;is this ? &lt;a href="https://github.com/NordicSemiconductor/Android-nRF-Toolbox"&gt;github.com/.../Android-nRF-Toolbox&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64586?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 12:31:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cfbb71ca-982c-404f-90a9-d9d725f5e0c8</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Try to use the code from the UART application in the nRFToolbox instead, because the standalone nRF UART app is quite old..&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64585?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 11:57:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac6c8442-7bd4-4f18-b9ac-2fb33a09a248</guid><dc:creator>jean.oriano</dc:creator><description>&lt;p&gt;no, i use the NrfUart android application&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64584?ContentTypeID=1</link><pubDate>Mon, 10 Oct 2016 11:43:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36d9b019-a9d1-40a9-ba2c-2700bbe4a9f7</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;jean.orinao: For sending data over uart, do you use the code for the &lt;a href="https://www.nordicsemi.com/eng/Products/Nordic-mobile-Apps/nRF-Toolbox-App"&gt;UART application in the nRFToolbox&lt;/a&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64583?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 14:02:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ec01e65d-98ef-4d05-a6ba-9937851e0f68</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;it&amp;#39;s in the header file&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define BLE_NUS_MAX_DATA_LEN (GATT_MTU_SIZE_DEFAULT - 3) /**&amp;lt; Maximum length of data (in bytes) that can be transmitted to the peer by the Nordic UART service module
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;and with this definition&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define GATT_MTU_SIZE_DEFAULT 23
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;you can see that 20 bytes is the max you can send with ble_nus_string_send(). If you want to send more you have to send multiple notifications one after another as the previous one finishes.&lt;/p&gt;
&lt;p&gt;There is no max length in the hvx function because it&amp;#39;s already in the BTLE spec that notifications and indications have max length MTU-3&lt;/p&gt;
&lt;p&gt;don&amp;#39;t know anything about java.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64582?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 13:31:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4313fea6-7975-4cd2-9bc3-da4e743b14ef</guid><dc:creator>jean.oriano</dc:creator><description>&lt;p&gt;If i want to send 40bytes over uart service with my nrf51, i use this function :&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;uint32_t ble_nus_string_send 	( ble_nus_t * p_nus, uint8_t * p_string, uint16_t  length )&lt;/strong&gt; 	&lt;/p&gt;
&lt;p&gt;link of function in infocenter : &lt;a href="http://infocenter.nordicsemi.com/index.jsp"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;no detail for the length of data ? i can send 500 bytes and this function cut in 20bytes packages my data ?&lt;/p&gt;
&lt;p&gt;I enter in this function and look at &lt;strong&gt;hvx_params.p_len&lt;/strong&gt; : &lt;a href="http://infocenter.nordicsemi.com/index.jsp"&gt;infocenter.nordicsemi.com/index.jsp&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;And nothing about max length.&lt;/p&gt;
&lt;p&gt;And about java function to send data. any doc ? infocenter dont anwser me about java doc for ble and nordic uart service.&lt;/p&gt;
&lt;p&gt;I think about this function &lt;strong&gt;mService.writeRXCharacteristic(data_in_byte_not_more_than_20_bytes)&lt;/strong&gt; to send data over ble.
if i want to send more than 20 bytes, i thougth it can be that :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;            while(i &amp;lt; mess_encaps.length) {
                for (int j = 0; j &amp;lt; 20; j++) {
                    envoie[j] = mess_encaps[i];
                    i++;
                }
                mService.writeRXCharacteristic(envoie);
            }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;but didnt work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64581?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 10:49:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c034b191-fe67-417d-958b-8e37680ef893</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;packets have a guarantee of arrival and a guarantee of arrival in the order they were sent. So if you send 1 2 3 4 5 you will receive 1 2 3 4 5 and if anything goes wrong, the connection will be terminated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64580?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 10:03:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:93b8db59-499f-4a06-9eb9-921fbfe11d4e</guid><dc:creator>jean.oriano</dc:creator><description>&lt;p&gt;I know its impossible to send more than 20 bytes per package.
I want to say, my data is longer than 20 bytes. i want to send it to my smartphone but i need more than 1 package.&lt;/p&gt;
&lt;p&gt;Its that i dont succeed to do.&lt;/p&gt;
&lt;p&gt;if i send 5 package for my data : 1 2 3 4 5&lt;/p&gt;
&lt;p&gt;with the BLE protocol, i dont lose package but is the package come in the same order ? 1 2 3 4 5 ?&lt;/p&gt;
&lt;p&gt;or is it possible that a package come before an other ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: NRF UART SERVICE long data to send</title><link>https://devzone.nordicsemi.com/thread/64579?ContentTypeID=1</link><pubDate>Wed, 05 Oct 2016 09:45:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eafaa2c6-cf55-4fcc-bdd2-330d852b3a68</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;It is (currently) not possible to transmit more than 20 bytes of data per package between a nRF51/52 and Android.&lt;/p&gt;
&lt;p&gt;When transferring data using notifications, it is not necessary to get a confirmation in the application layer that the notification was received. BLE is a reliable protocol that doesn&amp;#39;t accept packet  loss, and all packets are ACK&amp;#39;ed in the link layer. If a packet is not ACK&amp;#39;ed, it is re-transmitted until success or until timeout.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>