<?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 can we receive more than 20 bytes of data in NRF52 from a phone ?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/31094/how-can-we-receive-more-than-20-bytes-of-data-in-nrf52-from-a-phone</link><description>Hi, 
 How can we receive more than 20 bytes of data from the phone? We are using s132 and SDK 12.3. I know how to send more than 20 bytes of data from the NRF52 to the phone but I am not sure how to receive more than 20 bytes of data from the phone. </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 Mar 2018 12:49:48 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/31094/how-can-we-receive-more-than-20-bytes-of-data-in-nrf52-from-a-phone" /><item><title>RE: How can we receive more than 20 bytes of data in NRF52 from a phone ?</title><link>https://devzone.nordicsemi.com/thread/125954?ContentTypeID=1</link><pubDate>Mon, 26 Mar 2018 12:49:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0c111419-0b26-447f-a4c4-46bcc1d5ebe0</guid><dc:creator>Gandalf</dc:creator><description>&lt;p&gt;Hi all,&lt;br /&gt;I&amp;#39;m using s132 and SDK14.2.&lt;br /&gt;&lt;br /&gt;I need to understand how to manage more 1 byte of data from the phone.&lt;br /&gt;&lt;br /&gt;When I receive the event &lt;strong&gt;BLE_GATTS_EVT_WRITE&lt;/strong&gt;, I call the relative function &lt;strong&gt;on_write()&lt;/strong&gt; where the first code line is:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;ble_gatts_evt_write_t const * p_evt_write = &amp;amp;p_ble_evt-&amp;gt;evt.gatts_evt.params.write;&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;The structure ble_gatts_evt_write_t is the following:&lt;br /&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**@brief Event structure for @ref BLE_GATTS_EVT_WRITE. */
typedef struct
{
  uint16_t                    handle;             /**&amp;lt; Attribute Handle. */
  ble_uuid_t                  uuid;               /**&amp;lt; Attribute UUID. */
  uint8_t                     op;                 /**&amp;lt; Type of write operation, see @ref BLE_GATTS_OPS. */
  uint8_t                     auth_required;      /**&amp;lt; Writing operation deferred due to authorization requirement. Application may use @ref sd_ble_gatts_value_set to finalize the writing operation. */
  uint16_t                    offset;             /**&amp;lt; Offset for the write operation. */
  uint16_t                    len;                /**&amp;lt; Length of the received data. */
  /* !SG! */
  uint8_t                     data[1];            /**&amp;lt; Received data. @note This is a variable length array. The size of 1 indicated is only a placeholder for compilation.
                                                       See @ref sd_ble_evt_get for more information on how to use event structures with variable length array members. */
} ble_gatts_evt_write_t;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To manage more one byte, is it correct to modify the &lt;strong&gt;data[1] &lt;/strong&gt;of trhis structure from 1 to X length of interest?&lt;br /&gt;&lt;br /&gt;Thank you in advance&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How can we receive more than 20 bytes of data in NRF52 from a phone ?</title><link>https://devzone.nordicsemi.com/thread/122868?ContentTypeID=1</link><pubDate>Mon, 05 Mar 2018 15:04:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4deb5125-a224-4daa-b9b8-26714a7167d0</guid><dc:creator>John</dc:creator><description>&lt;p&gt;As long as the phone supports BLE 4.2 you could simply make the MTU size larger to accomodate your data. If it doesn&amp;#39;t, you probably will need to fragment the data when it is transmitted and reassemble it when the data is received in the nRF52&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>