<?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>access characteristic value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/3682/access-characteristic-value</link><description>I have writable characteristic on the server. As far as I understood there are at least two ways to access to its value: one using ble_evt_t and BLE_GATTS_EVT_WRITE another via function sd_ble_gatts_value_get(). Please advise when and how to choose between</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Sun, 31 Aug 2014 16:24:16 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/3682/access-characteristic-value" /><item><title>RE: access characteristic value</title><link>https://devzone.nordicsemi.com/thread/13375?ContentTypeID=1</link><pubDate>Sun, 31 Aug 2014 16:24:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fa5d23a1-19b9-4c36-b24a-f7b1d52119d8</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;Yes, you can use it like this. Server will update characteristic value inside softdevice on write ond after this send BLE_GATTS_EVT_WRITE event to your application and you can store and use this value inside your application and don&amp;#39;t get it with sd_ble_gatts_value_get() every time. You just need to handle BLE_GATTS_EVT_WRITE event and update your bool variable and as well update it if you call sd_ble_gatts_value_set() for this characteristic anywhere inside your application.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: access characteristic value</title><link>https://devzone.nordicsemi.com/thread/13374?ContentTypeID=1</link><pubDate>Sun, 31 Aug 2014 16:12:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:99dbc42e-84c4-4e5a-bba1-f44ec03d669a</guid><dc:creator>michurin</dc:creator><description>&lt;p&gt;OK, let&amp;#39;s take another look. If the server will update the value of this characteristic on write event and then will access to it without using sd_ble_gatts_value_get(). This looks easier but is it kosher? From other hand sd_ble_gatts_value_get() will probably take more effort to access every time it&amp;#39;s needed but may be more legit. The characteristic I have in mind is bool and I don&amp;#39;t feel comfortable using sd_ble_gatts_value_get(0 every time instead of if.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: access characteristic value</title><link>https://devzone.nordicsemi.com/thread/13373?ContentTypeID=1</link><pubDate>Sun, 31 Aug 2014 15:39:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7393eba4-878c-485b-a554-c62288728fca</guid><dc:creator>Nikita</dc:creator><description>&lt;p&gt;BLE_GATTS_EVT_WRITE event will be generated when client will write some data in this characteristic, after this value was received server will save this value as current characteristic value.&lt;/p&gt;
&lt;p&gt;With sd_ble_gatts_value_get() call you can get current characteristic value at any time and place you want.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>