<?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 do I know that a characteristic has been read completely?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/6151/how-do-i-know-that-a-characteristic-has-been-read-completely</link><description>So I&amp;#39;ve got this long characteristic which takes several read operations with offsets to read it completely. Idea is to have it refreshed only after the client has read it. 
 Is there a mechanism for figuring this out? 
 EDIT - This is the way Ulrich</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 25 Mar 2015 11:40:55 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/6151/how-do-i-know-that-a-characteristic-has-been-read-completely" /><item><title>RE: How do I know that a characteristic has been read completely?</title><link>https://devzone.nordicsemi.com/thread/21536?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2015 11:40:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:356e8748-0793-4ded-aabd-38fd07ac7495</guid><dc:creator>Carles</dc:creator><description>&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;If you want to send whatever is currently in the Attribute Table, you can simply set the &amp;quot;update&amp;quot; field to 0. That way you will be notified of the read but you won&amp;#39;t have to provide any data&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Whatever you provide in p_data if your update field is 1 will be written into the Attribute Table before the stack replies to the read operation from the client. That means that you can write more than 20 bytes, but the reply itself over the air will only contain the maximum of 20 bytes&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know that a characteristic has been read completely?</title><link>https://devzone.nordicsemi.com/thread/21538?ContentTypeID=1</link><pubDate>Wed, 25 Mar 2015 08:50:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8e4ab155-8699-43db-91d5-a18d01a1a1d2</guid><dc:creator>andrey</dc:creator><description>&lt;p&gt;I&amp;#39;ve added a couple of questions for you in the OP.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How do I know that a characteristic has been read completely?</title><link>https://devzone.nordicsemi.com/thread/21537?ContentTypeID=1</link><pubDate>Sat, 21 Mar 2015 19:46:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:41af642d-8b05-4d2c-ad3c-c0a82083a0ff</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Hi andrey,&lt;/p&gt;
&lt;p&gt;You should look into enabling read authorization for the characteristic. This will produce a &lt;em&gt;BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST&lt;/em&gt; event every time a read operation happens, and prompting you to allow the operation or not. The &lt;em&gt;request-&amp;gt;read&lt;/em&gt; field will contain the handle, context and offset.&lt;/p&gt;
&lt;p&gt;I believe you could set up a handler for these events and filter for your handle. If you then compare the current length of your characteristic to the offset, you should be able to see when the peer has read it all. It is also possible to change the value entirely during this authorization period, so you could update the value when the offset is 0 if your data is of a type that needs to be fresh.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>