<?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>BLE Characteristics write data Issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66501/ble-characteristics-write-data-issue</link><description>Hi, I want to write 510 bytes of data to my BLE Characteristics, so I set parameters ble_gatts_attr_t max_len as 510 and its variable length attribute. Also I set NRF_SDH_BLE_GATT_MAX_MTU_SIZE as 512. I observed below things: 
 - When I send data length</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 30 Sep 2020 09:56:40 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66501/ble-characteristics-write-data-issue" /><item><title>RE: BLE Characteristics write data Issue</title><link>https://devzone.nordicsemi.com/thread/272224?ContentTypeID=1</link><pubDate>Wed, 30 Sep 2020 09:56:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e07d0bdc-1b22-4fe1-8a05-de5689cd6dab</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;You can find that BLE_GATTS_VAR_ATTR_LEN_MAX is 512 bytes from:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s112.api.v7.2.0/group___b_l_e___g_a_t_t_s___a_t_t_r___l_e_n_s___m_a_x.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s112.api.v7.2.0/group___b_l_e___g_a_t_t_s___a_t_t_r___l_e_n_s___m_a_x.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;However this max length include a 3 byte overhead, so the actual useable data that can be notified is ATT_MTU - 3 bytes (=509 in your case) as written here:&lt;br /&gt;&lt;a href="https://devzone.nordicsemi.com/support-private/support/214779#permalink=399234"&gt;https://devzone.nordicsemi.com/support-private/support/214779#permalink=399234&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;I am little unsure why it is truncated to 507 bytes when you are using 510 or more,&amp;nbsp;but it may be that the packet is actually split into several packets (queued writes).&lt;/p&gt;
&lt;p&gt;Best regards,&lt;br /&gt;Kenneth&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>