<?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>Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/13390/connect-two-nordic-devices-and-send-data-via-uart-to-pc</link><description>Hi all Nordic developers, 
 I am currently working on an application using a sensor (the temperature sensor) on a Smart beacon kit, which must connect and send data to a nRF51 DK; for this no problem, i already have done everything using some code (ble</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Apr 2016 14:38:42 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/13390/connect-two-nordic-devices-and-send-data-via-uart-to-pc" /><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51085?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 14:38:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:09a57b04-ee84-455a-a72e-ac923fc63a68</guid><dc:creator>Revo</dc:creator><description>&lt;p&gt;thanks i will try.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51084?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 14:31:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bb5a2796-cbcc-477c-b4e5-62d1015ffee5</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;Something like that yes.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51083?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 14:18:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3c19b5e2-7e0d-4415-a586-52c59f16a78a</guid><dc:creator>Revo</dc:creator><description>&lt;p&gt;At this point unfortunately i cannot test if the data arrives from the beacon to the DK (i can just from the beacon to the phone, and there i see the values correctly), if not with the code,that is what i am trying to do... can you please tell me if i understood correctly what you are suggesting instead of using the uart service? If it&amp;#39;s right to do something like:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;on_ble_evt(...)
case BLE_GATTC_EVT_HVX:
{
 app_uart_put(p_ble_evt-&amp;gt;evt.gattc_evt.params.hvx.data);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51082?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 14:09:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:da97d734-90b6-4ba8-ba49-42eeaea97414</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I wouldn&amp;#39;t assume anything. I would test. I think you should have a look at the &lt;a href="https://devzone.nordicsemi.com/tutorials/21/"&gt;BLE central tutorial&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51081?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 11:50:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4e14b098-2960-4b9d-bc0f-ed6b8da7097d</guid><dc:creator>Revo</dc:creator><description>&lt;p&gt;Ok perfect, so in short as seen in the code ble_app_uart_c, my data should be in &amp;quot;p_ble_nus_evt-&amp;gt;p_data&amp;quot;, correct?
Please note that when i say that i am able to send data from to beacon, i mean simply that i followed the tutorial on ho to create a service and send by notification the dynamic temperature data of the chip&amp;#39;s sensor (by writing the structure hvx.data and all the stuff)! So i suppose that when i connect to the DK (the connection is confirmed by a LED), the data is naturally pushed in it as to a phone for example. Correct me if i am assuming wrong!&lt;/p&gt;
&lt;p&gt;Or maybe i just need to put in &amp;quot;on_ble_evt&amp;quot; a case of &amp;quot;BLE_GATTC_EVT_HVX&amp;quot; and inside it the &amp;quot;app_uart_put(p_ble_evt-&amp;gt;evt.gattc_evt.params.hvx.data)&amp;quot;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51080?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 11:45:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cadfde84-65fb-4aa2-8a5a-78c8f37352ec</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;If you are already able to send the data to the nRF51 DK you don&amp;#39;t need the UART service. You can have a look at the ble_app_uart_c example for how to send data received in a notification over uart to the PC. In short something like this: You will receive the BLE_GATTC_EVT_HVX event. Then you can find the data in p_ble_evt-&amp;gt;evt.gattc_evt.params.hvx.data. Put this data into app_uart_put().&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51079?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 11:37:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f88ef99b-19dd-46eb-b629-5d9b729b76fe</guid><dc:creator>Revo</dc:creator><description>&lt;p&gt;Ok so if i estabilished a connection between central and peripheral by BLE (done with sd_ble_gap_connect after doing discovery and all the related stuff), i do NOT need UART service to send the data pushed from the beacon to the DK into Matlab, am i correct? To do this i just need the function app_uart_put if i understood correctly, like there is in the code i posted in the question, but how do i do it? I mean, how should i say to the DK that as soon as it receives a value of temperature by notification of the beacon, it must send it to the PC?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51078?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 11:29:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ae661c67-c599-40e7-a3be-e3b2214200c4</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;With that example you are a peripheral and the smart phone is a central that is discovering and using the uart service on the peripheral. Now you are putting the uart service on the central, which means that the peripheral has to do service discovery++ to use it. You don&amp;#39;t need the uart service if you have already sent the temperature data over the BLE link. And even if you did, you would have the uart service on the peripheral (beacon) not the central (nRF51 DK). You can probably reuse uart_init() and some of the code in nus_data_handler(), but you first need to get some communication going. For example calling app_uart_put() and seeing something in a terminal (or Matlab), then use that with the temperature that you said that you receive from the peripheral.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51077?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 11:15:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c16f7939-ea1a-4e96-a6e9-f5f1dfa1cd40</guid><dc:creator>Revo</dc:creator><description>&lt;p&gt;Because i already used this example to send data similarly using a phone instead of the beacon as &amp;quot;data sender&amp;quot; (in this case of course i was the one triggering the connection from the control panel of the phone and it was easier), and i was able to visualize it. I&amp;#39;m using it because i want to read the values from the DK in Matlab saving them in an array while reading the serial port, not just visualize it, am i doing something unnecessary?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Connect two nordic devices and send data via UART to PC</title><link>https://devzone.nordicsemi.com/thread/51076?ContentTypeID=1</link><pubDate>Fri, 22 Apr 2016 11:01:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d98b5369-8ee6-48c5-830d-b76472941b9f</guid><dc:creator>Petter Myhre</dc:creator><description>&lt;p&gt;I&amp;#39;m a bit confused. You are able to send the temperature from the peripheral (beacon) to the central (nRF51 DK). And you want to print the temperature in a terminal on the PC. Why are you adding uart service? This is for emulating uart over BLE, not uart to a PC. Can&amp;#39;t you just use NRF_LOG_PRINTF() to print the temperature in a terminal?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>