<?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>Update advertisement manufacturer data once per second</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/41111/update-advertisement-manufacturer-data-once-per-second</link><description>Hi, 
 In my project I am using SDK 14.2 with S332. 
 I need to change the data in the manufacturer part of the advertisement packet once per second (nearly, timing is not strictly important). I saw the suggested method is to wait for a radio notification</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 03 Dec 2018 13:27:49 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/41111/update-advertisement-manufacturer-data-once-per-second" /><item><title>RE: Update advertisement manufacturer data once per second</title><link>https://devzone.nordicsemi.com/thread/159975?ContentTypeID=1</link><pubDate>Mon, 03 Dec 2018 13:27:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:342de171-4acf-4aa8-8dfc-fa9a13a2b13d</guid><dc:creator>Bragma</dc:creator><description>&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/members/ambystomalabs"&gt;AmbystomaLabs&lt;/a&gt;&amp;nbsp;I followed&amp;nbsp;your suggestion,&amp;nbsp;I&amp;#39;ve used an app timer to simulate&amp;nbsp;an external source and&amp;nbsp;update the data and everything seems well.&amp;nbsp;Thank you all!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertisement manufacturer data once per second</title><link>https://devzone.nordicsemi.com/thread/159836?ContentTypeID=1</link><pubDate>Sun, 02 Dec 2018 16:10:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:05a15a37-cee6-461d-a52f-fbffbf50bd27</guid><dc:creator>AmbystomaLabs</dc:creator><description>&lt;p&gt;You don&amp;#39;t need to synchronize with the radio to update the manufacturer data. Just change the data in the packet structure and re-init advertisements.&amp;nbsp; The softdevice won&amp;#39;t crash, it will just use the new data on the next advertisement.&lt;/p&gt;
&lt;p&gt;We do precisely this for one of our products.&amp;nbsp; It works perfectly.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertisement manufacturer data once per second</title><link>https://devzone.nordicsemi.com/thread/159833?ContentTypeID=1</link><pubDate>Sun, 02 Dec 2018 14:07:19 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef8c36da-eef1-415a-b152-26a0fb377bc6</guid><dc:creator>Bragma</dc:creator><description>&lt;p&gt;Thanks, I am expecting the 2 events (update&amp;nbsp; &amp;lt;-&amp;gt; send) to be completely async, it&amp;#39;s not a problem for my app. The real question is if it may cause crashes or other criticals. If the only problem is that a write is missed, it&amp;#39;s not really that important.&amp;nbsp;Data will either be sent on the next advertisement packet or be superseded by new data.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure I&amp;#39;ve explained my use case. Data is produced continuously at a more or less fixed rate (ex: about once per second), while advertisement will either be fast or slow (and have their timings completely unrelated to data). I just want the advertisement to pick up the new data I write with ble_advdata_set. I think I will be using static structures and all data has meaning at byte level. So event if I am writing while advertisement is in progress, it&amp;#39;s not&amp;nbsp; problem if data is only partially updated.&lt;/p&gt;
&lt;p&gt;The question is if this may cause any crash, because at data level I have not worries.&lt;/p&gt;
&lt;p&gt;Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Update advertisement manufacturer data once per second</title><link>https://devzone.nordicsemi.com/thread/159807?ContentTypeID=1</link><pubDate>Sat, 01 Dec 2018 19:20:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0394957b-25c1-4478-a522-0084e24b88f7</guid><dc:creator>natersoz</dc:creator><description>&lt;p&gt;&lt;br /&gt;The problem will be that your calls to set the manufacturer specific ID will likely be asynchronous with the BLE timer which performs calls to send out the advertising packets.&lt;br /&gt;&lt;br /&gt;As simple solution would be to wrap your setting of the manufacturer ID with the app_util_critical_region_enter() and app_util_critical_region_exit() functions. Their function definitions are in the SDK 15.2 directory nRF5_SDK_15.2.0_9412b96/components/libraries/util/app_util_platform.c and associated .h file.&lt;/p&gt;
&lt;p&gt;This will prevent the BLE timer interrupt from reading the manufacturing data from the advertising structure before you are done writing to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>