<?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>Right way to keep a central up to date with infrequently changing peripheral data item</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/61279/right-way-to-keep-a-central-up-to-date-with-infrequently-changing-peripheral-data-item</link><description>So we are creating a peripheral with a characteristic meant to keep the central synced with the state of our peripheral. The peripheral is running all the time, could be ON/OFF/DISABLED/FAULT. Whenever the state changes (which isnt that often), we update</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 May 2020 14:12:29 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/61279/right-way-to-keep-a-central-up-to-date-with-infrequently-changing-peripheral-data-item" /><item><title>RE: Right way to keep a central up to date with infrequently changing peripheral data item</title><link>https://devzone.nordicsemi.com/thread/249516?ContentTypeID=1</link><pubDate>Tue, 12 May 2020 14:12:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0cc8aae-cc46-4bf5-80f0-931449aa9532</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Chris,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can update the value of the characteristic using the&amp;nbsp;&lt;span&gt;sd_ble_gatts_hvx () even when it&amp;#39;s not connected. Here is the quote from the description of the function :&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt; * @note The local attribute value may be updated even if an outgoing packet is not sent to the peer due to an error during execution.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * The Attribute Table has been updated if one of the following error codes is returned: @ref NRF_ERROR_INVALID_STATE, @ref NRF_ERROR_BUSY,&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * @ref NRF_ERROR_FORBIDDEN, @ref BLE_ERROR_GATTS_SYS_ATTR_MISSING and @ref NRF_ERROR_RESOURCES.&lt;/em&gt;&lt;br /&gt;&lt;em&gt; * The caller can check whether the value has been updated by looking at the contents of *(@ref ble_gatts_hvx_params_t::p_len).&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Both of your options of either do a read at the beginning of the connection or do a notification instead are both good. The option to do a read is preferred in my opinion because you don&amp;#39;t have to implement any code on the peripheral side. You only need to allow read permission to the characteristic. The task to read should be done on the central side.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>