<?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>sleep after disconnect</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/15553/sleep-after-disconnect</link><description>Hi 
 what is the best way to implement a sleep after disconnect?
We are using a custom board and I implemented it this way: 
 on connect : turn advertisement off
on disconnect : event set WDT interval to longer interval, go to system-off
on wakeup</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 05 Aug 2016 11:57:02 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/15553/sleep-after-disconnect" /><item><title>RE: sleep after disconnect</title><link>https://devzone.nordicsemi.com/thread/59363?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 11:57:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6d13d1b0-8b2e-4048-bd45-266e3c6f2d0f</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;sorry, when you said that you are receiving packets, I thought DUT was central.
OK , is it possible that you are using ble_advertising.c module. If so it will start the advertising automatically after DISCONNECTED event. If not then the same logic for scanner applies to advertising also except that instead of searching of sd_ble_gap_scan_start now you have to trace sd_ble_Gap_adv_start in your program.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep after disconnect</title><link>https://devzone.nordicsemi.com/thread/59365?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 09:51:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ff4437b8-b41f-446b-bee6-de7528b77b2e</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Thanks for your reply.
You are looking from the wrong side ;-) My problem is not the scan_start but the adv_stop.
I need the sleep on the peripheral side...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep after disconnect</title><link>https://devzone.nordicsemi.com/thread/59364?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 09:46:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:099773ff-f2a2-4069-aabe-ccdda7a8e675</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;You said your system is going to system off, so after the wakeup, which will cause a system reset, the scanner is started again (sd_ble_gap_scan_start), could this be the reason you are seeing more adv packets? If not then probably APP_ERROR_CHECK failure is causing system reset and causing the scanner to be started again?&lt;/p&gt;
&lt;p&gt;I am assuming that you have double verified that there are no other calls or paths to sd_ble_gap_scan_start other than reset.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep after disconnect</title><link>https://devzone.nordicsemi.com/thread/59362?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 09:01:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7a6c5fc1-a973-40ec-bb1c-c7137dd61372</guid><dc:creator>Martin</dc:creator><description>&lt;p&gt;Hi
sorry, I can&amp;#39;t paste large code snips as this is a customer project.
I will try to break down the code.
The thing is I have over 1000 devices, that need to be scanned, connected, read, disconnected in intervals. I want to implement a &amp;quot;sleep after talk&amp;quot; on the peripheral device - the central continues to scan for the next device after disconnect.&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;switch (p_ble_evt-&amp;gt;header.evt_id)
{
    case BLE_GAP_EVT_CONNECTED:
        m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
    	battery_level_update();
        break;
        
    case BLE_GAP_EVT_DISCONNECTED:
    	sd_ble_gap_adv_stop();
        m_conn_handle = BLE_CONN_HANDLE_INVALID;
        // set after connect wakeup to eeprom.
        set_wdt_time(STATE_AFTER_CONNECT);
        power_off();
        break;
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;But this still leaves me with advert packets received on the central...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: sleep after disconnect</title><link>https://devzone.nordicsemi.com/thread/59361?ContentTypeID=1</link><pubDate>Fri, 05 Aug 2016 06:58:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ceba6750-2d1f-4050-b768-ca61d4fa6bf4</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;If you are still getting advertising packets then it simply means that you have enabled scanning again somewhere after the disconnect. Are you using example code from SDK? if so, can you please let us know which SDK version and which example have you been trying?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>