<?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 use sd_ble_gatts_value_get() for obtaining data of length more than 1 byte</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19790/how-to-use-sd_ble_gatts_value_get-for-obtaining-data-of-length-more-than-1-byte</link><description>Basically I used below function for sending 1 byte of data with bluetooth and it is working completely fine. 
 static void test_service_on_ble_write(ble_os_t *p_service, ble_evt_t *p_ble_evt)
{
 uint8_t data_buffer;
 ble_gatts_value_t rx_data;
 rx_data</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 20 Feb 2017 10:02:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19790/how-to-use-sd_ble_gatts_value_get-for-obtaining-data-of-length-more-than-1-byte" /><item><title>RE: How to use sd_ble_gatts_value_get() for obtaining data of length more than 1 byte</title><link>https://devzone.nordicsemi.com/thread/76972?ContentTypeID=1</link><pubDate>Mon, 20 Feb 2017 10:02:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad860f1b-60f9-4918-8021-8e7938056c10</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;What was the configuration you have for your characteristic ? If you set the maximum size of the characteristic (max_len) to 1, it&amp;#39;s not possible to write more than 1 byte.&lt;/p&gt;
&lt;p&gt;Note,an alternative to calling sd_ble_gatts_value_get() to get the written value, you can also get the value in p_ble_evt-&amp;gt;evt.gatts_evt.params.write.data[] directly. If there are several writes to one handle, calling sd_ble_gatts_value_get() may only return the value of the last write.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>