<?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 32 bit of data from nrf52  ble moble  app  onto nrf52833</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/76341/sending-32-bit-of-data-from-nrf52-ble-moble-app-onto-nrf52833</link><description>Hi, 
 I have used &amp;quot;write_handler(p_ble_evt-&amp;gt;evt.gap_evt.conn_handle, p_rtc_service, p_evt_write-&amp;gt;data[0]);&amp;quot; to send data to nrf52832 from nrfconnect mobile app but iam able to send 1 byte data as it is meant to be predefined in the gatts structure . </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 16 Jun 2021 13:03:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/76341/sending-32-bit-of-data-from-nrf52-ble-moble-app-onto-nrf52833" /><item><title>RE: Sending 32 bit of data from nrf52  ble moble  app  onto nrf52833</title><link>https://devzone.nordicsemi.com/thread/315623?ContentTypeID=1</link><pubDate>Wed, 16 Jun 2021 13:03:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:24701fff-874c-43ba-a003-2d9e5f5564bf</guid><dc:creator>Sigurd</dc:creator><description>[quote user=""]&lt;strong&gt;p_evt_write-&amp;gt;data[0] &lt;/strong&gt;which is&amp;nbsp;&lt;span&gt;uint8_t&amp;nbsp; data[0]&amp;nbsp; unable to receive the data properly.&lt;/span&gt;[/quote]
&lt;p&gt;&amp;nbsp;You can find the length of the data in&amp;nbsp;p_evt_write-&amp;gt;len , then based on this, you can find the rest of the data in&amp;nbsp;p_evt_write-&amp;gt;data[0],&amp;nbsp;p_evt_write-&amp;gt;data[1],&amp;nbsp;p_evt_write-&amp;gt;data[2], p_evt_write-&amp;gt;data[3] , etc.&amp;nbsp; As mentioned in&amp;nbsp;&lt;span&gt;ble_gatts_evt_write_t,&amp;nbsp;uint8_t data[1]; /**&amp;lt; Received data. @note &lt;strong&gt;This is a variable length array. The size of 1 indicated is only a placeholder for compilation.&lt;/strong&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending 32 bit of data from nrf52  ble moble  app  onto nrf52833</title><link>https://devzone.nordicsemi.com/thread/315449?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 14:26:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b260b26a-5f25-461a-8873-e772f9453081</guid><dc:creator>amey3</dc:creator><description>&lt;p&gt;i have set&amp;nbsp;&lt;span&gt;add_char_params.max_len as 50; do&amp;nbsp; i have to change&amp;nbsp;add_char_params.max_len&amp;nbsp; to set as size of (uint32_t).please&amp;nbsp; reply me&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Sending 32 bit of data from nrf52  ble moble  app  onto nrf52833</title><link>https://devzone.nordicsemi.com/thread/315446?ContentTypeID=1</link><pubDate>Tue, 15 Jun 2021 14:19:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:91eb92e3-7a0a-4cad-8512-1f28f5b62b4a</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;How did you Initialize this&amp;nbsp;characteristic?&lt;/p&gt;
&lt;p&gt;What did you set&amp;nbsp;add_char_params.max_len&amp;nbsp; / attr_char_value.max_len to ?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Example snippet from LBS service:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;    // Add LED characteristic.
    memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));
    add_char_params.uuid             = LBS_UUID_LED_CHAR;
    add_char_params.uuid_type        = p_lbs-&amp;gt;uuid_type;
    add_char_params.init_len         = sizeof(uint8_t);
    add_char_params.max_len          = sizeof(uint8_t);
    add_char_params.char_props.read  = 1;
    add_char_params.char_props.write = 1;

    add_char_params.read_access  = SEC_OPEN;
    add_char_params.write_access = SEC_OPEN;

    return characteristic_add(p_lbs-&amp;gt;service_handle, &amp;amp;add_char_params, &amp;amp;p_lbs-&amp;gt;led_char_handles);&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>