<?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 number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27207/sending-number-over-ble-with-ble_nus_string_send</link><description>Hi! Can anyone help me send values of temperature over ble? I tried and it appears like this, Capturar.PNG . 
 I&amp;#39;m using the code on the examples, ble_peripheral\ble_app_uart and ble_central\ble_app_uart, to comunicate over ble and changed this function</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 31 Jan 2020 09:01:30 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27207/sending-number-over-ble-with-ble_nus_string_send" /><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/232019?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 09:01:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf5c76ef-8aa7-4424-969f-da0b0eaccbaf</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you take a look at the documentation:&amp;nbsp;&lt;br /&gt;&lt;a title="Nordic UART Service" href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__ble__nus.html?cp=7_1_6_3_23"&gt;Nordic UART Service&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can see that the function is changed. You can now use&amp;nbsp;&lt;a href="https://infocenter.nordicsemi.com/topic/sdk_nrf5_v16.0.0/group__ble__nus.html#ga4189d97e88b018e48847c3ea26c4b05d"&gt;ble_nus_data_send&lt;/a&gt;()&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Br,&amp;nbsp;&lt;br /&gt;Joakim&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/232017?ContentTypeID=1</link><pubDate>Fri, 31 Jan 2020 08:53:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e879279e-fdc8-49cf-825b-c694366fa23f</guid><dc:creator>Luke Galea</dc:creator><description>&lt;p&gt;Hi, the ble_nus_string_send does not seem to be available any more in SDK16. Have you got any recommendations for sending a string using the BLE NUS UART Service?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107276?ContentTypeID=1</link><pubDate>Fri, 17 Nov 2017 08:44:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c78f2d3c-9c39-4ece-8421-b061d742939a</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;From the original question:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;&amp;quot;I&amp;#39;m using two nrf52, pca10040, s132 and i have SDK 12.2.0.&amp;quot;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107277?ContentTypeID=1</link><pubDate>Fri, 17 Nov 2017 08:06:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:787f09cb-b7b3-4b2d-9859-ac7cc74ee597</guid><dc:creator>Hrushi</dc:creator><description>&lt;p&gt;Hi JoanaBabo,&lt;/p&gt;
&lt;p&gt;Which version of SDK you are using?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107273?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 12:38:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e653e32-270b-40f8-9d9d-065302d97331</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;I&amp;#39;m glad! Happy to help. :)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107272?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 12:35:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f8894845-b3df-4f99-a8b5-891e738804a7</guid><dc:creator>JoanaBabo</dc:creator><description>&lt;p&gt;It Worked!!!! Thank you very much!!!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107271?ContentTypeID=1</link><pubDate>Mon, 06 Nov 2017 11:49:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d2884b8-cced-4916-8e9e-44ddfec5a54a</guid><dc:creator>Joakim Jakobsen</dc:creator><description>&lt;p&gt;Hi JoanaBabo!&lt;/p&gt;
&lt;p&gt;If you want to send the temperature value as a string instead,&lt;br /&gt;
you could try writing your code something like this:&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)  
{     
  if(p_data[0]==&amp;#39;?&amp;#39;)
  {   

  int32_t temp;
  uint8_t data[20]; 
  uint32_t err_code;

  err_code = sd_temp_get(&amp;amp;temp);
  APP_ERROR_CHECK(err_code);

  temp = (temp / 4);
  sprintf((char *)data, &amp;quot;Temperature: %d&amp;quot;, temp); 
  printf(&amp;quot;Temperature: %d \n&amp;quot;, temp);

  ble_nus_string_send(&amp;amp;m_nus, data, sizeof(data));
  }                                                   
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Let me know if that doesn&amp;#39;t work out for you.&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;
Joakim.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107275?ContentTypeID=1</link><pubDate>Fri, 03 Nov 2017 17:23:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfbb4d1d-a6b7-4b6d-89de-37d62a9e8244</guid><dc:creator>JoanaBabo</dc:creator><description>&lt;p&gt;The temperature appers in hexadecimal, 23=17 in hexadecimal.
I tried to send the temperature in a string and the result it&amp;#39;s the same.
I tried to change the type of variable but i can&amp;#39;t because the function that gives me temperature uses that type and to change it i would have to change a lot of librarys and gives me a lot of errors.
I can&amp;#39;t neather pass from hexadecimal to int on the side of central because the value it&amp;#39;s only in one bit.
Can anyone help??&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107270?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 22:49:58 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77931b07-cef5-47db-b727-297e9edfc6f6</guid><dc:creator>Lee Daniel Crocker</dc:creator><description>&lt;p&gt;Since temp is a uint8_t, the pointer &amp;amp;temp points to a single byte with your temperature, and whatever the following byte in memory happens to be. If you want to send 2 bytes as you&amp;#39;re doing now, declare temp to be a 16-bit integer. Also note that you&amp;#39;ll probably get the low-order byte first because of the little-endian chip.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending number over ble with ble_nus_string_send</title><link>https://devzone.nordicsemi.com/thread/107274?ContentTypeID=1</link><pubDate>Thu, 02 Nov 2017 20:16:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f4a2fb0d-ff44-4dc5-b827-06f98b364bd8</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;This kind of question seems to get asked more often than I could believe possible.&lt;/p&gt;
&lt;p&gt;The number has been sent as a 16 bit number. It&amp;#39;s little endian so the first byte is the lower 8 bits, the second the higher 8 bits, so the number received is ... 0x0017&lt;/p&gt;
&lt;p&gt;which is 23 (16 + 7 == 23)&lt;/p&gt;
&lt;p&gt;Whatever you have on the other side just needs to convert that. If you want to send it as a string instead, convert it to a string on the client and send that instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>