<?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>Which SDH Dispatch mode should I use?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/25854/which-sdh-dispatch-mode-should-i-use</link><description>While porting my app to the latest 14.0 SDK, it got a little stuck with the new sdh library. I was previously fetching all events through a custom poll &amp;amp; wait loop, but I decided to switch to the sdh library now.
Now the question is, what are the PROS</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Oct 2017 13:33:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/25854/which-sdh-dispatch-mode-should-i-use" /><item><title>RE: Which SDH Dispatch mode should I use?</title><link>https://devzone.nordicsemi.com/thread/101843?ContentTypeID=1</link><pubDate>Mon, 16 Oct 2017 13:33:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bfb9feda-2d98-4928-8246-6e5f78479a97</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;I see, I would suggest to pull the events out using ISR, but offload the time consuming tasks in to main loop using app scheduler for example.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Which SDH Dispatch mode should I use?</title><link>https://devzone.nordicsemi.com/thread/101842?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 15:15:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7d3cf602-f91e-4eca-8826-0c7bac3e5ca1</guid><dc:creator>Marius Heil</dc:creator><description>&lt;p&gt;Thanks, I am considering switching to interrupt mode. But I think this will result in NACKing as well if my ISR takes too long and the Softdevice buffer gets filled up.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Which SDH Dispatch mode should I use?</title><link>https://devzone.nordicsemi.com/thread/101840?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 08:42:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:186d0394-a76a-4666-a6d6-bbc8cbe85f27</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Ok, I was thinking you want to compare the softdevice handler module from SDK v13 vs SDH in SDK v14.&lt;/p&gt;
&lt;p&gt;The draw back of polling is that if you don&amp;#39;t poll the event from the softdevice quick enough and if the event buffer is full, the softdevice will start NACKing the peer device when there is a data/command packet. This might result in connection termination if the peer device set a timeout.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Which SDH Dispatch mode should I use?</title><link>https://devzone.nordicsemi.com/thread/101841?ContentTypeID=1</link><pubDate>Fri, 13 Oct 2017 08:05:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7aee3e2f-ac57-4e75-985b-f1f9b6b33a55</guid><dc:creator>Marius Heil</dc:creator><description>&lt;p&gt;Thanks, I know that I can keep my old polling code when rewriting it a little. But I want to know what the pros and cons between polling and interrupt mode are. E.g. what happens if I block the Softdevice event interrupt for a long time, etc,...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Which SDH Dispatch mode should I use?</title><link>https://devzone.nordicsemi.com/thread/101839?ContentTypeID=1</link><pubDate>Thu, 12 Oct 2017 10:53:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:064bd3b7-83d5-4fb2-a8ef-98d016ba073e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Marius,&lt;/p&gt;
&lt;p&gt;I assume you modified the softdevice_handler in the older SDK so that instead of pulling the event out on SWI2 interrupt it will fetch the event though a loop and poll?&lt;/p&gt;
&lt;p&gt;The mechanism wasn&amp;#39;t change with SDK v14. You still can modify that to your customized one, inside nrf_sdh.c&lt;/p&gt;
&lt;p&gt;What we introduced in SDK v14 with the SDH library was (according to release note):&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;- SoftDevice Handler:
    - Can now register &amp;#39;state event observers&amp;#39; that are notified when the SoftDevice state changes.
    - Can now register &amp;#39;request event observers&amp;#39; that are notified when a change of the SoftDevice state is requested.
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In addition, as stated in the &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v14.0.0/lib_softdevice_handler.html?cp=4_0_0_3_40"&gt;doc&lt;/a&gt;, you can choose different priorities for different Observers, so you can control the order of the observer handlers when there is an event.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>