<?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 own struct with ble nus</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/89176/sending-own-struct-with-ble-nus</link><description>Hi, 
 I&amp;#180;m working on a project to send measurement data over ble and receive it. This worked for me, but I want to send the message in my own struct. 
 What I found in the ble.nus is that the struct is like this 
 
 I do have 4 values of measurement and</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 21 Jun 2022 16:07:07 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/89176/sending-own-struct-with-ble-nus" /><item><title>RE: Sending own struct with ble nus</title><link>https://devzone.nordicsemi.com/thread/373522?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 16:07:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3f898071-6a45-4805-9fe7-c1e5ff0e8b5e</guid><dc:creator>Albrecht Markus Schellenberger</dc:creator><description>&lt;p&gt;Issue solved, see case &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/89189/error-invalid-storage-class-for-function"&gt;#291029&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Markus&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending own struct with ble nus</title><link>https://devzone.nordicsemi.com/thread/373481?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 13:55:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e94e5872-2a54-4913-8a76-352cb1b0448e</guid><dc:creator>Juniorprogrammer</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;I tryed but I&amp;#39;m not getting different values.&lt;/p&gt;
&lt;p&gt;&lt;img style="max-height:240px;max-width:320px;" src="https://devzone.nordicsemi.com/resized-image/__size/640x480/__key/communityserver-discussions-components-files/4/pastedimage1655819674253v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;Did I do someting wrong?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending own struct with ble nus</title><link>https://devzone.nordicsemi.com/thread/373428?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 11:48:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:34e1cb02-c740-4f27-8eca-b6c4ec88b8ca</guid><dc:creator>Juniorprogrammer</dc:creator><description>&lt;p&gt;I will try this, thank you!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending own struct with ble nus</title><link>https://devzone.nordicsemi.com/thread/373413?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 11:06:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3e0d0a78-e7c8-498a-aad1-0d5195b0d569</guid><dc:creator>Sigurd</dc:creator><description>[quote user="Juniorprogrammer"]Will this also work if I put floats in the array. Because firstly I did tryed to send a float with ble_nus_data_send, but it didn&amp;#39;t accept it because it wants an uint8.[/quote]
&lt;p&gt;See this post:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/47698/how-do-i-send-float-data-via-nus_data_send-function"&gt;How do I send float data via nus_data_send() function&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending own struct with ble nus</title><link>https://devzone.nordicsemi.com/thread/373385?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 10:33:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24eec8d6-9b4c-4450-8f43-9d4ceecc4f55</guid><dc:creator>Juniorprogrammer</dc:creator><description>&lt;p&gt;Hi Sigurd,&lt;/p&gt;
&lt;p&gt;Thanks for your quick reply.&lt;/p&gt;
&lt;p&gt;Will this also work if I put floats in the array. Because firstly I did tryed to send a float with ble_nus_data_send, but it didn&amp;#39;t accept it because it wants an uint8.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending own struct with ble nus</title><link>https://devzone.nordicsemi.com/thread/373382?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2022 10:23:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5431b5c3-04ea-447c-aac6-ced2d0a13abf</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Put the values in an array, and then use the&amp;nbsp;ble_nus_data_send() to send the values.&lt;/p&gt;
&lt;p&gt;Snippet:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;static uint8_t data_array[LENGTH];
data_array[0] = value1;
data_array[1] = value2;
data_array[2] = value3;
data_array[3] = value4;

uint32_t       err_code;
err_code = ble_nus_data_send(&amp;amp;m_nus, data_array, &amp;amp;length_of_array, m_conn_handle);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>