<?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>Event related to read request on characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/9160/event-related-to-read-request-on-characteristic</link><description>Hi, 
 imagine that I have a proprietary characteristic that allows only READ operation (from a smartphone for example) that expose an internal value in my application.
I see that there isn&amp;#39;t an event raised when a READ request arrives to the BLE layer</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 11 Sep 2015 13:58:38 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/9160/event-related-to-read-request-on-characteristic" /><item><title>RE: Event related to read request on characteristic</title><link>https://devzone.nordicsemi.com/thread/33765?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2015 13:58:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:923738a3-892b-4c6a-8c37-41c29b2becfe</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;As you mentioned, you can copy the service files to somewhere you can edit them.
Optionally, you can use the &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/"&gt;zip version&lt;/a&gt; of our SDK instead of Keil Packs.
As for your last question: Normally the application does not need to know about the battery level being read. Therefore it is not implemented in this service. You are free to create any custom service you would like, with properties customized to your application. You can read about that &lt;a href="https://devzone.nordicsemi.com/tutorials/8/ble-services-a-beginners-tutorial/"&gt;here&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Event related to read request on characteristic</title><link>https://devzone.nordicsemi.com/thread/33764?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2015 13:25:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c650345-7236-4622-a11c-b89721fa1096</guid><dc:creator>ppatierno</dc:creator><description>&lt;p&gt;Ok great ...
However I&amp;#39;m speaking about enabling this in the ble_bas where I have following :&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;attr_md.rd_auth    = 0;
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;The ble_bas.c was added to my project as module but the path is C:\Keil_v5\ARM\PACK\NordicSemiconductor\nRF_BLE\3.0.0\ble_services\ble_bas\ble_bas.c so I can&amp;#39;t modify it.
The only way I have is to copy the service implementation into my project folder I suppose.
Why your default battery service doesn&amp;#39;t allow this feature to receive event on read request ?&lt;/p&gt;
&lt;p&gt;Thanks,
Paolo.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Event related to read request on characteristic</title><link>https://devzone.nordicsemi.com/thread/33763?ContentTypeID=1</link><pubDate>Fri, 11 Sep 2015 13:10:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2dbeb0e4-1a66-4222-b1c5-f9a1cb6e20dd</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hello.&lt;/p&gt;
&lt;p&gt;You must turn on read authorization on your characteristic. This is done during the characteristic_add() function, probably called from services_init(). (The function names may vary depending on the service)&lt;/p&gt;
&lt;p&gt;Configure this value inside metadata structure(with type ble_gatts_attr_md_t).&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;attr_md.rd_auth    = 1;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;After setting this, you will receive BLE_GATTTS_RW_AUTHORIZE_REQUEST events when someone want to read the characteristic. See the &lt;a href="http://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v7.x.x/doc/7.2.0/s110/html/a00888.html"&gt;message sequence chart&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The problem and solution is also described &lt;a href="https://devzone.nordicsemi.com/question/486/question-about-read-operation/"&gt;here&lt;/a&gt;.
Let me know if anything is unclear, or if you run into any problems.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>