<?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 deal with the characteristic read event?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66820/how-to-deal-with-the-characteristic-read-event</link><description>Hi: 
 I&amp;#39;m coding with the nrf52840 dk sample. 
 as we know, the gatt operate is notify,read, write, etc. 
 I have found the event about the write,and notify: 
 
 case BLE_GATTS_EVT_WRITE: 
 
 
 case BLE_GATTS_EVT_HVC: 
 
 
 but I could find the same event</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 08 Oct 2020 08:56:33 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66820/how-to-deal-with-the-characteristic-read-event" /><item><title>RE: How to deal with the characteristic read event?</title><link>https://devzone.nordicsemi.com/thread/273665?ContentTypeID=1</link><pubDate>Thu, 08 Oct 2020 08:56:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:19c5351a-10a7-40f1-9a13-77ebe21956d4</guid><dc:creator>Kenneth</dc:creator><description>&lt;p&gt;I suspect what you are interested in is GATTS read request with authorization then:&lt;br /&gt;&lt;a href="https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html"&gt;https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v7.2.0/group___b_l_e___g_a_t_t_s___r_e_a_d___r_e_q___a_u_t_h___m_s_c.html&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So each time you receive an BLE_GATTS_EVT_RW_AUTHORIZE_REQUEST, then you can sample the&amp;nbsp;battery level and afterwards write the updated value using&amp;nbsp;sd_ble_gatts_rw_authorize_reply().&lt;/p&gt;
&lt;p&gt;I expect you will need to modify the battery_level_char_add() function call to include:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;add_descr_params.is_defered_read = true;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;before calling&amp;nbsp;descriptor_add() in &lt;span&gt;battery_level_char_add()&amp;nbsp;&lt;/span&gt;to change the behavior here.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to deal with the characteristic read event?</title><link>https://devzone.nordicsemi.com/thread/273599?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 23:23:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c9203864-9882-4a83-b69a-764583854c79</guid><dc:creator>flywithme</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/awneil"&gt;awneil&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to deal with the characteristic read event?</title><link>https://devzone.nordicsemi.com/thread/273476?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 11:57:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd079edc-597d-4ce4-a0dc-83447cc08b13</guid><dc:creator>flywithme</dc:creator><description>&lt;p&gt;every sample. just like the examples\ble_peripheral\ble_app_hrs\pca10056\s140\arm5_no_packs.&lt;/p&gt;
&lt;p&gt;for example. the ble_bas.c&amp;nbsp; for the characteristic&amp;nbsp; battery_level.&lt;/p&gt;
&lt;p&gt;In the example, the battery_level changed by the timer.&lt;/p&gt;
&lt;p&gt;But I don&amp;#39;t want to create the timer.&lt;/p&gt;
&lt;p&gt;I only want the battery_level will be changed, when the clinet to operate to read the characteristic.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to deal with the characteristic read event?</title><link>https://devzone.nordicsemi.com/thread/273473?ContentTypeID=1</link><pubDate>Wed, 07 Oct 2020 11:52:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0389773b-29ac-497d-8a43-2c55a4609f4d</guid><dc:creator>awneil</dc:creator><description>[quote userid="89747" url="~/f/nordic-q-a/66820/how-to-deal-with-the-characteristic-read-event"]the &lt;i&gt;(sic)&lt;/i&gt; nrf52840 dk sample[/quote]
&lt;p&gt;There are many examples for the nRF52840-DK - which particular one are you referring to?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>