<?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>When using NUS, configure communication protocol</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/102569/when-using-nus-configure-communication-protocol</link><description>hello! 
 
 I am developing communication using Nordic UART Service. 
 
 It defines the protocol of data sent by the ble_nus_data_send() function. 
 ( err_code = ble_nus_data_send ( &amp;amp; m_nus , data_array , &amp;amp; length , m_conn_handle ); ) 
 
 When composing</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 07 Aug 2023 07:11:17 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/102569/when-using-nus-configure-communication-protocol" /><item><title>RE: When using NUS, configure communication protocol</title><link>https://devzone.nordicsemi.com/thread/440049?ContentTypeID=1</link><pubDate>Mon, 07 Aug 2023 07:11:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42f51d42-f00c-4bb7-99d3-eecca54ce5b2</guid><dc:creator>Susheel Nuguru</dc:creator><description>[quote user="David_Kim"]By the way, thinking about it, as you informed me, I was already doing the above process to check the validity of the BLE Data Packet, but putting it in the data and checking it again seemed meaningless, so I made an inquiry.[/quote]
&lt;p&gt;All the data integrity is already checked by the hardware and the Link Layer. So I do not think adding this again in the application adds any benefits.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The NUS does not have any special header on top of the BLE packets. What it has is the custom Service UUID and custom characteristics UUID numbers which can be found &lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/nrf/libraries/bluetooth_services/services/nus.html"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using NUS, configure communication protocol</title><link>https://devzone.nordicsemi.com/thread/440021?ContentTypeID=1</link><pubDate>Mon, 07 Aug 2023 01:21:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3d824eca-966f-4299-a428-e7c003d68623</guid><dc:creator>David_Kim</dc:creator><description>&lt;p&gt;hi,&lt;/p&gt;
&lt;p&gt;Are the specifications of the entire BLE data packet of Nordic UART Service undisclosed?&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t find it... To validate data in the process of developing with NUS We are developing a configuration in which a separate header, length, and checksum are sent and checked again at the receiving end.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;By the way, thinking about it, as you informed me, I was already doing the above process to check the validity of the BLE Data Packet, but putting it in the data and checking it again seemed meaningless, so I made an inquiry.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The final NUS Data excluded heder and checksum.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using NUS, configure communication protocol</title><link>https://devzone.nordicsemi.com/thread/440008?ContentTypeID=1</link><pubDate>Sun, 06 Aug 2023 10:02:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7166111e-9ae6-4385-bd8f-c412ef81ac05</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;Hi David,&lt;/p&gt;
&lt;p&gt;Nordic UART Service does not add anything else as headers to the data. What you receive in the peer BLE data packet will have only those headers and checksum you included. So I do not understand what you mean by writing &amp;quot;&lt;em&gt;is it okay to omit it?&amp;quot;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using NUS, configure communication protocol</title><link>https://devzone.nordicsemi.com/thread/439987?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2023 21:29:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d65dd0fe-66ad-4ca9-ba41-3904b7351afa</guid><dc:creator>David_Kim</dc:creator><description>&lt;p&gt;hi&lt;/p&gt;
&lt;p&gt;Looking at the code you attached, it only transmits data.&lt;/p&gt;
&lt;p&gt;There is no checksum or CRC to validate the data I was wondering about above.&lt;/p&gt;
&lt;p&gt;As I think, since there are parts for validating data such as CRC in the BLE Payload anyway, can I omit it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: When using NUS, configure communication protocol</title><link>https://devzone.nordicsemi.com/thread/439807?ContentTypeID=1</link><pubDate>Fri, 04 Aug 2023 06:00:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e3fc0fee-7032-4f17-b3e2-b421a7909ef7</guid><dc:creator>Tai</dc:creator><description>&lt;p&gt;I think using NUS gives you flexibility regarding data structure. It&amp;#39;s doable for you to send your data structure with NUS. You can check example from &lt;a href="https://github.com/NordicPlayground/nRF52-ADC-examples"&gt;nRF52-ADC&lt;/a&gt;&amp;nbsp;to see how they use NUS to send ADC values from multiple channels.&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt; // Send data over BLE via NUS service. Create string from samples and send string with correct length.
        uint8_t nus_string[50];
        bytes_to_send = sprintf(nus_string, 
                                &amp;quot;CH0: %d\r\nCH1: %d\r\nCH2: %d\r\nCH3: %d&amp;quot;,
                                p_event-&amp;gt;data.done.p_buffer[0],
                                p_event-&amp;gt;data.done.p_buffer[1],
                                p_event-&amp;gt;data.done.p_buffer[2],
                                p_event-&amp;gt;data.done.p_buffer[3]);

        err_code = ble_nus_data_send(&amp;amp;m_nus, nus_string, &amp;amp;bytes_to_send, m_conn_handle);
        if ((err_code != NRF_ERROR_INVALID_STATE) &amp;amp;&amp;amp; (err_code != NRF_ERROR_NOT_FOUND))
        {
            APP_ERROR_CHECK(err_code);
        }&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>