<?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 keep the routine running in mainloop for nRF51822</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10112/how-to-keep-the-routine-running-in-mainloop-for-nrf51822</link><description>I am developing a project by employing nRF51822 and my code is based on ble_app_uart. I met an issue that if there is no device connects to nRF51800 in 3 minutes, the program will run out of mainloop(I assume it goes onto idle mode or sleep mode). I tried</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 06 Nov 2015 09:17:24 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10112/how-to-keep-the-routine-running-in-mainloop-for-nrf51822" /><item><title>RE: How to keep the routine running in mainloop for nRF51822</title><link>https://devzone.nordicsemi.com/thread/37507?ContentTypeID=1</link><pubDate>Fri, 06 Nov 2015 09:17:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8f538b31-9f07-42bf-8ab4-0ecbe09a2b41</guid><dc:creator>awneil</dc:creator><description>&lt;p&gt;Most (all?) of the Nordic examples seem to just advertise for 3 minutes (180s) and then stop - so the first thing you have to do is to work out how to continue doing something useful after that timeout.&lt;/p&gt;
&lt;p&gt;In some (all?) cases, a timeout of zero specifies &amp;quot;advertise indefinitely&amp;quot;...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to keep the routine running in mainloop for nRF51822</title><link>https://devzone.nordicsemi.com/thread/37506?ContentTypeID=1</link><pubDate>Fri, 06 Nov 2015 06:25:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c32ca7eb-921a-4688-ad62-512d22e3ec1c</guid><dc:creator>run_ar</dc:creator><description>&lt;p&gt;Sounds like you are advertising in limited discovery mode where 180s timeout is max. Remove this flag and you should be able to use a bigger timeout value. You should also consider adding code that restarts advertising on the previous timeout. Quite often an application would do fast advertisement for a limited time, then change to a slower advertisement interval when advertising for an unlimited time. When the advertisement times out you will get a &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s110.api.v8.0.0/group___b_l_e___g_a_p___m_s_c.html?cp=2_7_0_0_0_2_1_0"&gt;BLE_GAP_EVT_TIMEOUT&lt;/a&gt;, this is where you can start advertising again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>