<?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>Retrieve Characteristic Value</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7633/retrieve-characteristic-value</link><description>I&amp;#39;ve added a custom service and a few characteristics on the nRF51822. How can I access the current value stored in one of those characteristic outside of a BLE event occurring? Say for example on a button press I want to turn on the LED corresponding</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jun 2015 19:45:08 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7633/retrieve-characteristic-value" /><item><title>RE: Retrieve Characteristic Value</title><link>https://devzone.nordicsemi.com/thread/27224?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2015 19:45:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0692fe7-bdeb-4b02-ab20-953eedf24137</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;The link to the documentation explains this. BLE_CONN_HANDLE_INVALID should be used for everything except system attributes. This function is only local, so if I have understood your question correctly, then yes: This is the function you should use. It does not require any BLE communication to be available.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve Characteristic Value</title><link>https://devzone.nordicsemi.com/thread/27223?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2015 15:01:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ab3eccf5-9755-4057-baca-10beae49367c</guid><dc:creator>danbujak</dc:creator><description>&lt;p&gt;Is this the correct function to use even if the characteristic exists on the device that I am trying to read it from? In other words no BLE communication is required and there&amp;#39;s no conn_handle in my case. Do I just use BLE_CONN_HANDLE_INVALID and it&amp;#39;ll pull the data from the local attribute table?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Retrieve Characteristic Value</title><link>https://devzone.nordicsemi.com/thread/27222?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2015 13:10:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fd8af335-1394-4a8f-9b45-d13ca5d10560</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;&lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/doc/8.1.0/s110/html/a01299.html#gad95321e157e632e7ac3a77f3388cbdf7"&gt;sd_ble_gatts_value_get(conn_handle, handle, p_gatts_value_t)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;You need to store the handles set in the output variable from sd_ble_gatts_characteristic_add() to know which handle you should retrieve. If you have this, it&amp;#39;s pretty straight-forward!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>