<?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 to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/67291/how-to-send-all-the-array-value-in-ble_nus_send</link><description>Hi, 
 i am using sdk 16 , nrf52832 .Merged with two sensors , i am storing it all in an array 
 example 
 uint16_t array[7]; 
 array[0]=67; array[1]=90; array[2]={90}; .so on 
 using Sprintf i have converted all the array into string, passing the string</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 18 Oct 2020 06:07:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/67291/how-to-send-all-the-array-value-in-ble_nus_send" /><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275458?ContentTypeID=1</link><pubDate>Sun, 18 Oct 2020 06:07:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:936bac56-1ddf-4bde-bf5f-5f6f7244a3d9</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;I am sending it directly not in uart_event_handle&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275352?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 12:25:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e5f26bd1-038d-4475-8d3c-9108b32c7184</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Go on - that&amp;#39;s a basic &amp;#39;C&amp;#39; programming question: exactly the same way that you&amp;#39;d get the return value from &lt;em&gt;&lt;strong&gt;any&lt;/strong&gt; &lt;/em&gt;function call.&lt;/p&gt;
&lt;p&gt;Again, the SDK examples all illustrate this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275350?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 12:21:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:21c85e80-b107-49bd-8ae9-4443487723e2</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;how to check that ? please&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275347?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 12:09:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5cd7e972-85a0-47c0-8a0e-4d30ecd58892</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;you still haven&amp;#39;t answered the question:&lt;/p&gt;
[quote userid="6462" url="~/f/nordic-q-a/67291/how-to-send-all-the-array-value-in-ble_nus_send/275323#275323"]What return value are you getting from the call to&amp;nbsp;&lt;span&gt;ble_nus_data_send() ?&lt;/span&gt;[/quote]&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275327?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 11:22:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff47a19a-1ff3-4307-8645-d1e628a95b96</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;okay if i give 24 i am not getting the data , if give the length as 9&amp;nbsp; i am getting data&amp;nbsp; in the app&amp;nbsp; &amp;quot;245,567&amp;quot;&amp;nbsp; only the two set array data .i dont know how does it is working&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;uint8_t array[8];
char str[8];
array[0]= 245;
array[1]=567;
array[2]=908;
array[3]=345;
array[4]=90;


 ble_nus_data_send(&amp;amp;m_nus, str, 9 ,m_conn_handle);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275325?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 11:14:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:af86097d-a437-4da0-8d44-46b3cf60db5d</guid><dc:creator>awneil</dc:creator><description>[quote userid="74848" url="~/f/nordic-q-a/67291/how-to-send-all-the-array-value-in-ble_nus_send/275324#275324"]i am getting the 23, 24&amp;nbsp; keep on changing[/quote]
&lt;p&gt;You&amp;#39;re putting different data into the string - so it &lt;em&gt;&lt;strong&gt;will&lt;/strong&gt; &lt;/em&gt;have different lengths!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275324?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 11:12:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:53bd6ca8-2d8d-48fa-b46c-69e34b4fe6f0</guid><dc:creator>ps_anu</dc:creator><description>[quote userid="6462" url="~/f/nordic-q-a/67291/how-to-send-all-the-array-value-in-ble_nus_send/275323#275323"]Did you successfully manage to transfer data using the &lt;em&gt;unmodified&lt;/em&gt; SDK example ?[/quote]
&lt;p&gt;&amp;nbsp;&lt;span&gt;yes i can able to transfer the data&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
[quote userid="6462" url="~/f/nordic-q-a/67291/how-to-send-all-the-array-value-in-ble_nus_send/275323#275323"]For the length of a &lt;em&gt;&lt;strong&gt;string&lt;/strong&gt;&lt;/em&gt; you need to use &lt;strong&gt;strlen()&lt;/strong&gt;[/quote]
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;printf(&amp;quot;%d&amp;quot;, (int)strlen(str));
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;i am getting the 23, 24&amp;nbsp; keep on changing&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275323?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 11:02:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:89651c5c-adbd-4e0e-acc8-65c55a6a923e</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Did you successfully manage to transfer data using the &lt;em&gt;unmodified&lt;/em&gt; SDK example ?&lt;/p&gt;
&lt;p&gt;Again:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;For the length of a &lt;em&gt;&lt;strong&gt;string&lt;/strong&gt;&lt;/em&gt; you need to use &lt;strong&gt;strlen()&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;What return value are you getting from the call to&amp;nbsp;&lt;span&gt;ble_nus_data_send() ?&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275319?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 10:54:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b9f49b9-6090-466f-9fb3-0d7adbb57671</guid><dc:creator>ps_anu</dc:creator><description>&lt;p&gt;yes thank you for your response&lt;/p&gt;
&lt;p&gt;i am not getting the data , i am using latest version ble5.0&amp;nbsp; phone and nrf toolbox&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;sprintf( data,&amp;quot;%d,%d,%d&amp;quot;,array[0],array[1],array[2]);
 ble_nus_data_send(&amp;amp;m_nus, data, sizeof(data),m_conn_handle); // even i tried sizeof(array[0],array[1]...&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: how to send all the array value in ble_nus_send</title><link>https://devzone.nordicsemi.com/thread/275316?ContentTypeID=1</link><pubDate>Fri, 16 Oct 2020 10:49:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:48178e4c-ea1c-4855-b00b-b3f2262f4091</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;If it&amp;#39;s a string, you should be using strlen() to find its length.&lt;/p&gt;
&lt;p&gt;What return value are you getting from the call to&amp;nbsp;&lt;span&gt;ble_nus_data_send() ?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Have you looked at the SDK examples which illustrate the use of the NUS ?&lt;/span&gt;&lt;/p&gt;
[quote userid="74848" url="~/f/nordic-q-a/67291/how-to-send-all-the-array-value-in-ble_nus_send"]i am not receiving any data in the phone[/quote]
&lt;p&gt;&lt;span&gt;what app are you using on the phone?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/1777._5F00_Insert-Code-_2D00_-Nordic-2.png" /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>