<?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>BLE_OBSERVER_PRIO - priorities with Advertising and the Connection State module</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60788/ble_observer_prio---priorities-with-advertising-and-the-connection-state-module</link><description>SDK 15.3.0; nRF52832 
 In a previous discussion about continuing to advertise while connected: 
[quote userid=&amp;quot;4240&amp;quot; url=&amp;quot;~/f/nordic-q-a/45644/how-do-i-simply-do-a-non-connectable-advert-on-nrf52-using-sdk-15/185800&amp;quot;]The advertisement module will start</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 30 Apr 2020 12:53:25 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60788/ble_observer_prio---priorities-with-advertising-and-the-connection-state-module" /><item><title>RE: BLE_OBSERVER_PRIO - priorities with Advertising and the Connection State module</title><link>https://devzone.nordicsemi.com/thread/247566?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 12:53:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f07c6a0d-f82e-483d-8afb-4a24bd3af276</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Thanks.&lt;/p&gt;
&lt;p&gt;I went for the 1st option - adjusting priorities.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE_OBSERVER_PRIO - priorities with Advertising and the Connection State module</title><link>https://devzone.nordicsemi.com/thread/247546?ContentTypeID=1</link><pubDate>Thu, 30 Apr 2020 12:21:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cdd5baab-4e93-4b33-8f27-2cb0f1c4d42a</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
[quote user=""]It looks like this is due to the altered priorities - so the&amp;nbsp;&lt;span&gt;Connection State&lt;/span&gt;&amp;nbsp;module is not seeing the events until after the application and the advertising modules.[/quote]
&lt;p&gt;Yes, this is the problem. The connection state module use observer priority &amp;#39;0&amp;#39; by default, same as the app in this case, so it&amp;#39;s not guaranteed to receive the event first.&lt;/p&gt;
&lt;p&gt;I see two solutions to this. One is to reduce the priority of the advertiser module&amp;nbsp; (BLE_ADV_BLE_OBSERVER_PRIO), so you can set APP_BLE_OBSERVER_PRIO to &amp;#39;1&amp;#39; or more. The other option is to set the .ble_adv_on_disconnect_disabled flag to prevent the module from automatically starting advertising on disconnect events. You can start advertising when receiving the disconnect event inside your app handler instead.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>