<?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 app Send</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19126/nrf-uart-app-send</link><description>In the nRF UART v2.0 App, the app have the &amp;quot;send&amp;quot; command. And I can send the data to my nRF52 DK, and it print what I&amp;#39;m sending on the Serial monitor. 
 However, in the ble_app_uart example code, I don&amp;#39;t see where this function of code is locate, Does</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sat, 21 Jan 2017 01:01:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19126/nrf-uart-app-send" /><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74019?ContentTypeID=1</link><pubDate>Sat, 21 Jan 2017 01:01:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de466641-a41e-4723-bed2-4b1e73e724a9</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;Solved this problem myself. Here is the solution, hope can help others.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)
{
	memset(&amp;amp;send_value,0x00,length);
    for (uint32_t i = 0; i &amp;lt; length; i++)
    {
        while (app_uart_put(p_data[i]) != NRF_SUCCESS);
// Read what the &amp;quot;data request&amp;quot; is send from the smart phone. Refer to &amp;quot;spi_event_handler()&amp;quot;
	    send_value = send_value * 10 + (p_data[i] - &amp;#39;0&amp;#39;);
    }
    while (app_uart_put(&amp;#39;\r&amp;#39;) != NRF_SUCCESS);
    while (app_uart_put(&amp;#39;\n&amp;#39;) != NRF_SUCCESS);
// print what send_value is		
		printf(&amp;quot;send_value: %d\n&amp;quot;,send_value);			
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;by @faweiz&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74018?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 17:29:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7138a12d-9a23-47fd-8ef6-689ead13c011</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Could be a bug with the app. You should use the &lt;a href="https://www.nordicsemi.com/eng/Products/Nordic-mobile-Apps/nRF-Toolbox-App"&gt;nRF Toolbox app&lt;/a&gt; and use the uart function there. The old UART 2.0 is deprecated.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74017?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 16:24:54 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c851b34-2e0f-4d5d-acc8-741cce316095</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;I&amp;#39;ve already include it, if not include it won&amp;#39;t compile. Any solution?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74016?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 15:44:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:236b8288-5a7a-4360-9ebd-752380a30b24</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Did you remember to add &lt;code&gt;#include &amp;quot;math.h&amp;quot;&lt;/code&gt;? And you have doubled checked that the two functions are identical?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74015?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 15:33:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:83732d5f-f78f-4d32-b70f-bf9279903124</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;@Sigurd, I tried your suggest and follow that page code. When I send the 1 from phone to nRF52 I can received number &amp;quot;1&amp;quot;, but when I send 2 from phone to nRF52 it received &amp;quot;3&amp;quot; and send 3 received &amp;quot;8&amp;quot;. Any idea on why does thing happen?
&lt;a href="https://devzone.nordicsemi.com/question/98177/nrf-uart-app-receive-value-sent-from-uart-app/?answer=98192#post-id-98192"&gt;devzone.nordicsemi.com/.../&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74014?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 08:23:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ac5f5c84-ae10-4adb-af8e-b37d0c33d1ab</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;The NUS is character not integer based.&lt;/p&gt;
&lt;p&gt;If you want to send numbers not text, you probably need to create a custom service to suit your precise needs&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74013?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 08:23:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:252c76dc-cf0f-44ad-b2d1-47946dab9551</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi wecare,&lt;/p&gt;
&lt;p&gt;You are only storing the last part of the number that was sent. E.g. if you send 42, only the number 2 is stored in &lt;code&gt;send_value&lt;/code&gt;. Take a look at &lt;a href="https://devzone.nordicsemi.com/question/98177/nrf-uart-app-receive-value-sent-from-uart-app/?answer=98192#post-id-98192"&gt;this answer&lt;/a&gt; for a method on how to store a number sent from the phone by modifying the &lt;code&gt;nus_data_handler()&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Note: The method only works with positive numbers, and you need to make some changes for it to work with negative numbers.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74012?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 07:10:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28c556a9-e6e6-495a-87f8-26efeedfd521</guid><dc:creator>FormerMember</dc:creator><description>&lt;p&gt;the data send from phone to nRF52 is not display in &amp;quot;int&amp;quot; type,&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    static void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)
    {
    	int send_value;
        for (uint32_t i = 0; i &amp;lt; length; i++)
        {
            while (app_uart_put(p_data[i]) != NRF_SUCCESS);
    	send_value = ((p_data[i]-&amp;#39;0&amp;#39;));
        }
        while (app_uart_put(&amp;#39;\r&amp;#39;) != NRF_SUCCESS);
        while (app_uart_put(&amp;#39;\n&amp;#39;) != NRF_SUCCESS);
        printf(&amp;quot;send_value: %d\n&amp;quot;,send_value);
    }
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The problem is when I enter number from 0 to 9 it works fine, but after entered number above 10 it shows the 0-9 again. any idea on how to let it display as integer type number?&lt;/p&gt;
&lt;p&gt;Thanks&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: nRF UART app Send</title><link>https://devzone.nordicsemi.com/thread/74011?ContentTypeID=1</link><pubDate>Fri, 20 Jan 2017 04:00:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:42604853-1aee-4f61-86f3-dab629804294</guid><dc:creator>Roger Clark</dc:creator><description>&lt;p&gt;I think what you are looking for is the callback function nus_data_handler() in main.c&lt;/p&gt;
&lt;p&gt;The handler is passed to the uart service during initialisation, and the on_write() function in the uart service calls the function pointer (which points to the callback function in main)&lt;/p&gt;
&lt;p&gt;If you are not seeing any output on your hardware (UART) pins, then you don&amp;#39;t have the TX and RX pins configured correctly for the board you are using.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>