<?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>What are latency and supervision timeout limits?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10636/what-are-latency-and-supervision-timeout-limits</link><description>Hey guys, 
 I&amp;#39;m building a remote control (similar to TV remote) and I&amp;#39;m using nRF51. I am trying to figure out optimal connection parameters so the battery would last as long as possible while the remote would be reasonably responsive (200-250ms latency</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 03 Dec 2015 15:17:00 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10636/what-are-latency-and-supervision-timeout-limits" /><item><title>RE: What are latency and supervision timeout limits?</title><link>https://devzone.nordicsemi.com/thread/39683?ContentTypeID=1</link><pubDate>Thu, 03 Dec 2015 15:17:00 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cd67dbe4-3aea-497c-862f-8daff22a0d36</guid><dc:creator>Ulrich Myhre</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;There are some rules for supervision timeout values in combination with latency and connection interval, and these are outlined in ble_gap.h (and the module documentation for GAP). You will find that &lt;strong&gt;BLE_GAP_CP_CONN_SUP_TIMEOUT_MAX&lt;/strong&gt; is set to 32 seconds, and that will be the absolute maximum you can set.&lt;/p&gt;
&lt;p&gt;For your scenario, there are multiple options:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;You could be connected all the time, setting supervision timeout to 32s and use slave latency (and optionally local connection latency which can be up to half the supervision timeout). This makes the device wake up every 16s to send an empty packet during inactivity, but instantly wake up when there is data to send. Thus response time on button press is very quick.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Disconnect after some time of inactivity and go to sleep. Whenever the remote control is moved, you could use e.g. an accelerometer to detect this and wake up the chip and the connect. If you use high duty cycle directed advertisements, the latency of the new connection is bound by the scanner. Advertising intervals will then be 3.75ms for up to 1.28s. It should then be ready to immediately process button presses with very little delay. Directed advertisement is very resource intensive, so make sure that these are not triggered too often.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;A combination of the two, where a connection is kept after a button press and then discarded after inactivity. You can then choose to connect when a button is pressed, again using directed advertisements to minimize connection setup time. This should consume less power than by using an accelerometer, but will add some delay to the first press after inactivity.&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;So to summarize: What you ask for in the original post is not really feasible. It is not possible to keep a connection for more than about half a minute without activity before it is teared down. The spec simply does not allow for more than this, and it is grounded in the fact that the devices will start to drift away from each other due to inaccurate clocks. Having very little communication also leads to rapid connection losses, because you can only miss 2 packets due to noise before things start failing.&lt;/p&gt;
&lt;p&gt;Instead you should focus on keeping your device in system off most of the time, and improve the connection setup time. This might require tweaking with the receiver so that it is able to quickly detect any advertisements that come along. If you are bound on resources on the receiver too, you will have to gather some data on normal usage to figure out the optimal strategy.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>