<?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>About RX and TX characteristics in NUS</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/58527/about-rx-and-tx-characteristics-in-nus</link><description>Hello; I have been working with nrf52840 dk&amp;#39;s for the past couple months, and came across a few questions. 
 
 First off, my temporary goal using nrf52840 is to send a timestamp using TIMER via UART, which is a preferred method 
 
 of transferring data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 03 Mar 2020 08:34:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/58527/about-rx-and-tx-characteristics-in-nus" /><item><title>RE: About RX and TX characteristics in NUS</title><link>https://devzone.nordicsemi.com/thread/237626?ContentTypeID=1</link><pubDate>Tue, 03 Mar 2020 08:34:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c344e866-0ae3-4f29-adae-57261505e6ab</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello,&lt;br /&gt;&lt;br /&gt;Sorry for my late reply.&lt;br /&gt;Just to make sure I understand you correctly, you currently have two nRF52840 DK who will communicate what they are told over UART with each other using BLE?&lt;br /&gt;Could you tell me which application is running on the devices - are you using examples from the SDK, and if so; which examples have you flashed them with? For example&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_nus_c.html"&gt;BLE_central/ble_app_uart_c&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/ble_sdk_app_nus_eval.html"&gt;BLE_peripheral/ble_app_uart&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;You are correct that each NUS instance contain both an RX and a TX characteristic - one for receiving transmissions, and one for sending.&lt;br /&gt;The characteristics serves as the &amp;quot;datatype&amp;quot; of the transmission - a standard, so both sides know what to expect when they receive a transmission. If you would like a more in depth explanation of characteristics, I can highly recommend &lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial"&gt;this guide&lt;/a&gt;.&lt;br /&gt;&lt;br /&gt;For your last question, have you made a timestamp that you would like to send using NUS, or are you asking how to create the timestamp?&lt;br /&gt;If it is the former, I suggest you look at the callback functions in the event of received UART or BLE_uart data in the BLE_central/ble_app_uart_c example, specifically, the uart_event_handle() and ble_nus_c_evt_handler(), they might be what you are looking for. &lt;br /&gt;If it is the latter, please specify what kind of timestamp you are after, and have a look at the app_timer from components/libraries/timer in the SDK.&lt;br /&gt;&lt;br /&gt;Just to clarify, you do not need to create the data packet to be sent yourself - this is taken care of by the uart_event_handle, if you send data to your device over UART. Here is an exempt of the uart_event_handle() docstring:&lt;br /&gt;&lt;em&gt;&lt;br /&gt;uart_event_handle()&lt;br /&gt;This function will receive a single character from the app_uart module and append it to a string. The string will be be sent over BLE when the last character received was a &amp;#39;new line&amp;#39; &amp;#39;\n&amp;#39; (hex 0x0A) or if the string has reached the maximum data length.&amp;nbsp;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>