<?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>How to synchronize a BLE observer with my application</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/40624/how-to-synchronize-a-ble-observer-with-my-application</link><description>Examples in SDK15 use the Observer pattern to handle BLE events (using the macro NRF_SDH_BLE_OBSERVER). AFAIK, the registered handler runs in some IRQ context, typically higher then my main context. 
 Looking at the experimental ble_app_interactive example</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 21 Nov 2018 13:31:23 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/40624/how-to-synchronize-a-ble-observer-with-my-application" /><item><title>RE: How to synchronize a BLE observer with my application</title><link>https://devzone.nordicsemi.com/thread/158425?ContentTypeID=1</link><pubDate>Wed, 21 Nov 2018 13:31:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb8c3948-e985-4c73-b7da-46479b7a62b3</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
[quote user=""]Is the code in the example valid, or should access to &lt;em&gt;m_device&lt;/em&gt; be synchronized?[/quote]
&lt;p&gt;&amp;nbsp;It&amp;#39;s valid. You don&amp;#39;t need any synchronization.&lt;/p&gt;
[quote user=""]AFAIK, the registered handler runs in some IRQ context, typically higher then my main context.[/quote]
&lt;p&gt;Correct, Softdevice event handler(SD_EVT_IRQn/SD_EVT_IRQHandler) runs at&amp;nbsp;interrupt priority level 6. This is also the same level as the&amp;nbsp;&lt;span&gt;app_timer. So they will not&amp;nbsp;preempt&amp;nbsp;each other. (Note that in SDK 15.0 the interrupt priority level for both are set to 7, but set to 6 for both in SDK 15.2)&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>