<?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>Write Long - How to know which attribute</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/4964/write-long---how-to-know-which-attribute</link><description>I&amp;#39;m using SDK 7.1, PCA10028 eval board, SD110 7.1, MCP 3.6.0.8331 
 I have 2 characteristics, and both are 32 bytes long. When I try a &amp;quot;Write Long&amp;quot; from the MCP a
BLE_EVT_USER_MEM_REQUEST is generated. 
 Originally, I tested this with just one of characteristic</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 31 Dec 2014 18:41:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/4964/write-long---how-to-know-which-attribute" /><item><title>RE: Write Long - How to know which attribute</title><link>https://devzone.nordicsemi.com/thread/17483?ContentTypeID=1</link><pubDate>Wed, 31 Dec 2014 18:41:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a059da0-eb0c-451c-add1-7a73c4f46100</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;You need to look at the event BLE_GATTS_EVT_WRITE in the function ble_lmxs_on_ble_evt.  It is where the buffer is being processed.  First you need to check the characteristic handle to see if it is a long write or not.  If a long write, the you will find the GATMEMHDR at the beginning of the p_mem block.  The Handle member is the characteritic for which the data is destined to. Because the long write is subdivide into multiple blocks.  The Offset is the cursor to where this current data should be in the full data block that was transmitted.  I hope it&amp;#39;s clearer.  It&amp;#39;s too long to describe everything here.  Find GATT Queued Write in the documentation.  It&amp;#39;ll help you understand better the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write Long - How to know which attribute</title><link>https://devzone.nordicsemi.com/thread/17482?ContentTypeID=1</link><pubDate>Wed, 31 Dec 2014 15:12:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:866fce95-cce6-4996-97cb-0e5449e39cf7</guid><dc:creator>c cook</dc:creator><description>&lt;p&gt;Nguyen - Thanks for the response. I&amp;#39;ve been reviewing your code in LMXDisplay_ble on GitHub, and I&amp;#39;m still confused.&lt;br /&gt;
p_mem is a member of the structure ble_user_mem_block_t and is defined as a pointer to a uint8_t.&lt;br /&gt;
Your function ble_lmxs_on_ble_evt, is passed a ble_evt_t.  Shouldn&amp;#39;t the GATT being written to be identified in ble_evt_t?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Write Long - How to know which attribute</title><link>https://devzone.nordicsemi.com/thread/17481?ContentTypeID=1</link><pubDate>Wed, 31 Dec 2014 02:15:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:04866e77-2d42-443c-98c9-e76620e4cd17</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;There is this structure in the p_mem&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#pragma pack(push, 1)
typedef struct {
	uint16_t Handle;
	uint16_t Offset;
	uint16_t Len;
	uint8_t Data[1];
} GATMEMHDR;

#pragma pack(pop)
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;See the example code LMXDisplay_ble or UART_ble on this blog site for details &lt;a href="http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html"&gt;http://embeddedsoftdev.blogspot.ca/p/ehal-nrf51.html&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>