<?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>BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/8988/ble-disconnect-timeout</link><description>Hello, 
 How can we force a device to disconnect from a BLE Network after a certain period of inactivity (timeout) ? 
 Thanks.</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 04 Sep 2015 11:49:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/8988/ble-disconnect-timeout" /><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33087?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2015 11:49:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbdca0b7-47bd-4f0a-bc0f-71e0c1b0fe3c</guid><dc:creator>Kingmaster</dc:creator><description>&lt;p&gt;Yes you can close the thread, this is the answer i was looking for&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33086?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2015 10:24:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d50db932-92cd-4dd8-8d75-d1abd369d471</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;is there anything on this topic? if not can we close the thread and you accept the answer with the code.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33085?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2015 09:48:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8f23438-f81d-4560-8a37-38197dabb3be</guid><dc:creator>Kingmaster</dc:creator><description>&lt;p&gt;Thanks, this is how it should be done&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33084?ContentTypeID=1</link><pubDate>Fri, 04 Sep 2015 06:50:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ddc944f-4e06-464b-b02c-7abc7e8634ce</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;using app_timer library&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void timers_init(void)
{

    // Initialize timer module.
    APP_TIMER_INIT(0, APP_TIMER_MAX_TIMERS, APP_TIMER_OP_QUEUE_SIZE, false);

    // Create timers.


    uint32_t err_code;
    err_code = app_timer_create(&amp;amp;m_app_timer_id, APP_TIMER_MODE_REPEATED, timer_timeout_handler);
    APP_ERROR_CHECK(err_code);
}

void start_timer()
{
    uint32_t err_code;
    err_code = app_timer_start(m_app_timer_id, 10 * 32768, NULL);  // handler timer_timeout_handler will be called every 10 seconds unless stopped
    APP_ERROR_CHECK(err_code);
}

void stop_timer()
{
    uint32_t err_code;
    err_code= app_timer_stop(m_app_timer_id);
    APP_ERROR_CHECK(err_code);  }

void reset_timer()
{
  stop_timer();
  start_timer();
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33083?ContentTypeID=1</link><pubDate>Thu, 03 Sep 2015 14:28:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a7dbcb99-f62a-4f18-ab2b-d36dcd7a082b</guid><dc:creator>Kingmaster</dc:creator><description>&lt;p&gt;Thanks for replying. Can you show me how to start and reset a timer after 10 seconds ? Do you have some examples ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33082?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2015 10:10:03 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d8814cd1-ee82-4086-961d-746164b5888a</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;There is nothing internally in softdevice or SDK drivers that will detect this inactivity.
Your application have to detect this by itself. It can for example start a 10 second timer which has to be reset everytime there is data write is done. So when it expires it means that no data has been transferred in the last 10 seconds. The downside is that this will only work for writes, if you want notifications or other procedures to count as activity, you have to reset the timer at those places.&lt;/p&gt;
&lt;p&gt;There is a lot of traffic between two controllers in connection that are not notified to the application. If you use timers that traffic will be considered as inactivity. There is no other way that I can think of right now.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33081?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2015 08:38:55 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0b321bf7-5f47-4781-9f03-d413d25861cd</guid><dc:creator>Kingmaster</dc:creator><description>&lt;p&gt;Inactivity is when a user is connected to the BLE Network but he&amp;#39;s no longer sending data. When a user forgets to disconnect from the network, the BLE remains &amp;quot;busy&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: BLE Disconnect Timeout</title><link>https://devzone.nordicsemi.com/thread/33080?ContentTypeID=1</link><pubDate>Tue, 01 Sep 2015 08:32:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e6891666-c874-4137-a262-2e5dcb8e6453</guid><dc:creator>Susheel Nuguru</dc:creator><description>&lt;p&gt;what does inactivity mean in your context?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>