<?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>On-the-fly update of Characteristic value in User Memory</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/49584/on-the-fly-update-of-characteristic-value-in-user-memory</link><description>In this case, when I change values in the &amp;quot;User memory&amp;quot;, is there any API call or other action required to advise the SoftDevice that the data has changed? 
 Only the values (content) will change - not the length. 
 Is there an example which illustrates</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 11 Jul 2019 07:56:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/49584/on-the-fly-update-of-characteristic-value-in-user-memory" /><item><title>RE: On-the-fly update of Characteristic value in User Memory</title><link>https://devzone.nordicsemi.com/thread/197729?ContentTypeID=1</link><pubDate>Thu, 11 Jul 2019 07:56:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dafa2b49-0f52-4ae1-87aa-24ecc63c2bb9</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;We have a plan for non-atomicity ....&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: On-the-fly update of Characteristic value in User Memory</title><link>https://devzone.nordicsemi.com/thread/197691?ContentTypeID=1</link><pubDate>Wed, 10 Jul 2019 21:48:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:14001d96-8621-48c5-90f9-f522ff0211ab</guid><dc:creator>RK</dc:creator><description>&lt;p&gt;No nothing to do, when the characteristic is read the client will read whatever the current value is. You can change it as often as you like, softdevice doesn&amp;#39;t need to know. If you want to notify or indicate it, just call sd_ble_gatts_hvx() after your update to queue a notification.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;One point to note; if your characteristic data is long enough that a write to it is non-atomic, I know of nothing which prevents your being interrupted while you&amp;#39;re&amp;nbsp;changing the data. If the softdevice at that point satisfies a read for that characteristic, the data written out will be whatever you were half way through writing. If your characteristic is notify/indicate only, you can control this by waiting until you know the hvx() send has completed. If not and it&amp;#39;s important to you, probably need a marker in the data you can update atomically. You set that to false, then you update the data, then you set it true again. In that way if your data goes out half-cooked, the receiver can recognise that and toss the data.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>