<?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>onread() event in SDK17</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/80612/onread-event-in-sdk17</link><description>Hello all, 
 I am migrating our FW NRF52832 from SDK11 to SDK17. (Actually I am starting from scratch on 17). Here I have two characteristics with only read properties (e.g. version string). I can&amp;#39;t get the read to read out so that I get a readevent </description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 14 Oct 2021 11:57:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/80612/onread-event-in-sdk17" /><item><title>RE: onread() event in SDK17</title><link>https://devzone.nordicsemi.com/thread/334134?ContentTypeID=1</link><pubDate>Thu, 14 Oct 2021 11:57:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df6b27c3-dc94-4fd8-b5ff-c614646ff45b</guid><dc:creator>kdu</dc:creator><description>&lt;p&gt;Okay, I got it.&lt;br /&gt;I modified my code and it now works as expected.&lt;br /&gt;Thanks for that.&lt;/p&gt;
&lt;p&gt;// Add the VersionString characteristic.&lt;/p&gt;
&lt;p&gt;uint8_t&amp;nbsp;VersionString[16] = {&amp;quot;01.02.03.04&amp;quot;};&lt;/p&gt;
&lt;p&gt;memset(&amp;amp;add_char_params, 0, sizeof(add_char_params));&lt;br /&gt;add_char_params.uuid = VERSION_STRING_CHAR_UUID;&lt;br /&gt;add_char_params.uuid_type = p_cus-&amp;gt;uuid_type;&lt;/p&gt;
&lt;p&gt;add_char_params.init_len =&amp;nbsp;strlen(&lt;span&gt;VersionString);&lt;/span&gt;&lt;br /&gt;add_char_params.max_len = &lt;span&gt;add_char_params.init_len&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;br /&gt;add_char_params.p_init_value = &lt;span&gt;VersionString&lt;/span&gt;;&lt;/p&gt;
&lt;p&gt;add_char_params.char_props.read = 1;&lt;br /&gt;add_char_params.read_access = SEC_OPEN;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;err_code = characteristic_add(p_cus-&amp;gt;service_handle, &amp;amp;add_char_params,&amp;nbsp;&amp;amp;p_cus-&amp;gt;version_string_char_handles);&lt;br /&gt;if (err_code != NRF_SUCCESS)&lt;br /&gt;{&lt;br /&gt;return err_code;&lt;br /&gt;}&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: onread() event in SDK17</title><link>https://devzone.nordicsemi.com/thread/333942?ContentTypeID=1</link><pubDate>Wed, 13 Oct 2021 12:46:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ba8eed84-c3a4-47a8-940e-43aae59cb083</guid><dc:creator>Einar Thorsrud</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There should not be any problems having&amp;nbsp;characteristics with only read properties. Could it be that you somehow forget or fail to update the value, so that the init value is still used when you test? You can se an example of only read in for instance the implementation of the GLS service (SDK 17.1, around line 249 in components\ble\ble_services\ble_gls\ble_gls.c).&lt;/p&gt;
&lt;p&gt;If you want an event on read you need to use authorized read, as without it this is handled by the stack without notifying the application. See &lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/42613/event-form-read-request/166472#166472"&gt;this thread&lt;/a&gt; for details.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>