<?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>Detecting a BLE connection using &amp;#39;m_conn_handle&amp;#39; issue</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28826/detecting-a-ble-connection-using-m_conn_handle-issue</link><description>Hi again,
Hope everyone had a great Christmas.. I did, but Santa also gave me a litte issue with my nRF52-DK.. 
 I using a modified UART example, I have a 5min repeating timer that set&amp;#39;s a flag to call a &amp;#39;5minAction&amp;#39; sub from the main loop (works as</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 28 Dec 2017 11:24:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28826/detecting-a-ble-connection-using-m_conn_handle-issue" /><item><title>RE: Detecting a BLE connection using 'm_conn_handle' issue</title><link>https://devzone.nordicsemi.com/thread/114156?ContentTypeID=1</link><pubDate>Thu, 28 Dec 2017 11:24:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:51de4637-905f-448f-bf9c-70f4c9ae7166</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;That&amp;#39;s the problem: this kind of construction can work under some circumstances and if you settle with it then you will come into troubles sooner or later. And that looks like your problem. So my advise stays: never ever use &lt;code&gt;nrf_delay&lt;/code&gt; or similar thing, not even for debugging, there are simple &lt;code&gt;app_timer&lt;/code&gt; libraries or other tricks using RTC and TIMER to achieve the same in more elegant not blocking mode. And fix your FW design to work strictly in this way, then it&amp;#39;s high chance that sequences like &amp;quot;start GAP Peripheral advertising =&amp;gt; wait for incoming connection =&amp;gt; act on event&amp;quot; will magically start working.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detecting a BLE connection using 'm_conn_handle' issue</title><link>https://devzone.nordicsemi.com/thread/114155?ContentTypeID=1</link><pubDate>Thu, 28 Dec 2017 00:51:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:aa9a0ab3-82ae-407f-93d2-323717aa2f8d</guid><dc:creator>PaulP</dc:creator><description>&lt;p&gt;I only have that sort of loop in the one place(it was intended as a quick test), the rest uses interrupts, what was confusing me was that I could see other stuff happening outside the loop... i.e. serial transmission etc.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detecting a BLE connection using 'm_conn_handle' issue</title><link>https://devzone.nordicsemi.com/thread/114154?ContentTypeID=1</link><pubDate>Wed, 27 Dec 2017 22:55:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77f8c893-07cb-4ca8-a945-44bdc98ef9fd</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Jesus Christ stop using bloody blocking calls like &lt;code&gt;nrf_delay(xxx)&lt;/code&gt;!!! All FWs which uses BLE stack should be strictly asynchronous, no while or other waiting loops. Simply do what you need before entering main loop in the &lt;code&gt;main()&lt;/code&gt; where you should only execute wait for event/interrupt and all the rest is handled as callback to your handler function supplied to Soft Device during initialization. Literally every BLE example in the SDK is written like that and it&amp;#39;s not coincidence. So the best would probably be rewriting your application to fit this concept.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>