<?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>how can i receive data from smart phone??</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/12320/how-can-i-receive-data-from-smart-phone</link><description>hi, with good advisers in here, i can build the ble_uart_example and download it. 
 and using the function &amp;#39;ble_nus_send_string&amp;#39; in &amp;#39;ble_nus.c&amp;#39;, i can send some messages from nrf51822 to smart phone application &amp;#39;nrf toolbox&amp;#39;. 
 but this example just</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Mar 2016 10:45:34 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/12320/how-can-i-receive-data-from-smart-phone" /><item><title>RE: how can i receive data from smart phone??</title><link>https://devzone.nordicsemi.com/thread/46620?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 10:45:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c34b6a1-324b-4fd2-9682-7a93e6f80959</guid><dc:creator>Javier</dc:creator><description>&lt;p&gt;Hi, as said Anders, with &amp;quot;nus_data_handle&amp;quot;, you can see the data that your smartphone has sent.&lt;/p&gt;
&lt;p&gt;In SDK 9, example &amp;quot;ble_app_uart&amp;quot; you can see how redirect this data to your nrf51822.&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)
{
     for (uint32_t i = 0; i &amp;lt; length; i++)
     {
        while(app_uart_put(p_data[i]) != NRF_SUCCESS);
     }
    while(app_uart_put(&amp;#39;\n&amp;#39;) != NRF_SUCCESS);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But if you use sdk v6, softdevice s110, &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/nRF51_SDK_v6.x.x/doc/6.0.0/s110/html/a00066.html"&gt;here&lt;/a&gt; (section Handling of data received over BLE) you can find how you can do it.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void nus_data_handler(ble_nus_t * p_nus, uint8_t * p_data, uint16_t length)
{
    for (int i = 0; i &amp;lt; length; i++)
    {
        simple_uart_put(p_data[i]);
    }
    simple_uart_put(&amp;#39;\n&amp;#39;);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how can i receive data from smart phone??</title><link>https://devzone.nordicsemi.com/thread/46619?ContentTypeID=1</link><pubDate>Fri, 04 Mar 2016 10:12:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c3654d74-a0b7-4583-9d22-12069504ca3c</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;First of all, i advise you to use the &lt;a href="http://developer.nordicsemi.com/nRF5_SDK/"&gt;latest&lt;/a&gt; SDK (SDK 10, soon SDK11).&lt;/p&gt;
&lt;p&gt;When the phone sends data to the nRF device, you will get callback to the function &lt;code&gt;nus_data_handler&lt;/code&gt; in main.c. Here you can get the data from &lt;code&gt;p_data&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;-Anders&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>