<?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>Sending a NULL character in BLE UART example</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/73465/sending-a-null-character-in-ble-uart-example</link><description>In the ble app uart example, I need the BLE device to be able to send out a null character. I noticed when I receive a message with a null character at the end from the UART device, it does not get sent out over BLE. Our application uses a protocol with</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 01 Apr 2021 13:23:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/73465/sending-a-null-character-in-ble-uart-example" /><item><title>RE: Sending a NULL character in BLE UART example</title><link>https://devzone.nordicsemi.com/thread/302857?ContentTypeID=1</link><pubDate>Thu, 01 Apr 2021 13:23:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:17066dd0-4582-4bc1-b702-6272d544bcdc</guid><dc:creator>aaron.mcneil</dc:creator><description>&lt;p&gt;That ia a good thought. I am using the exact same receive method as I do when I send a different type of message with a different character on the end but I will explore this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a NULL character in BLE UART example</title><link>https://devzone.nordicsemi.com/thread/302855?ContentTypeID=1</link><pubDate>Thu, 01 Apr 2021 13:18:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d1354cf9-101d-4abc-b0bb-8729f3032e69</guid><dc:creator>awneil</dc:creator><description>[quote userid="99624" url="~/f/nordic-q-a/73465/sending-a-null-character-in-ble-uart-example/302852#302852"]the null character is not being sent[/quote]
&lt;p&gt;how do you know it&amp;#39;s not being &lt;em&gt;sent&lt;/em&gt; ?&lt;/p&gt;
&lt;p&gt;maybe the problem is at the &lt;em&gt;receiving&lt;/em&gt; end ... ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a NULL character in BLE UART example</title><link>https://devzone.nordicsemi.com/thread/302852?ContentTypeID=1</link><pubDate>Thu, 01 Apr 2021 13:02:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:06b4047e-8c92-4057-b834-51682645e727</guid><dc:creator>aaron.mcneil</dc:creator><description>&lt;p&gt;I am using the ble_app_uart example.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;In the uart_event_handle, uart_app_get is called each time a character is received from the uart and data_array is filled with each character so it can be sent out over BLE. Index is also incremented each time a character is received. When it is time to send out the message over BLE, ble_nus_send_data is called and data_array and index are passed to it. I verified that data_array has the elements I expect in it including the null character at the end. Index is also the correct length. However, the null character is not being sent. If I send a similar message with a different character at the end, it is sent correctly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending a NULL character in BLE UART example</title><link>https://devzone.nordicsemi.com/thread/302793?ContentTypeID=1</link><pubDate>Wed, 31 Mar 2021 15:52:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c19ec482-e324-4d33-bc85-885371b00e5a</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;The Nordic UART Service (NUS) can certainly send arbitrary binary data - all byte values from 0x00 to 0xFF&lt;/p&gt;
&lt;p&gt;Are you using one of the SDK examples?&lt;/p&gt;
&lt;p&gt;They assume that the UART is connected to a terminal, with a person typing manually at that terminal - so are probably filtering out &amp;quot;non-printing&amp;quot; characters.&lt;/p&gt;
&lt;p&gt;Remember, also, that NUL is the string terminator in C - so you won&amp;#39;t be able to use any standard C &lt;strong&gt;str...()&lt;/strong&gt; functions.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>