<?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>Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/24798/supervision-timeout-multiplier---connection-supervisory-timeout</link><description>Hi, 
 I made an experiment and the result doesn&amp;#39;t correspond with my view on how the BLE communication &amp;quot;connection&amp;quot; mechanism works. 
 I have an app running on the nRF52832 using example code and here is what I use as a supervisor timeout delay of 4</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 31 Aug 2017 16:16:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/24798/supervision-timeout-multiplier---connection-supervisory-timeout" /><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97611?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2017 16:16:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:81d0a711-33c8-484d-b3dc-1616c51fbae8</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;(use a sniffer use a sniffer;) Now you are debugging black box, not seeing what is actually exchanged over the air leads to just guessing and burning valuable time.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97619?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2017 16:05:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4820fc47-9018-4b2c-bb01-07edb4083a54</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Only RF log will tell you, hardly some piece of paper...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97610?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2017 14:55:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5527e44a-9f60-4b83-8914-6c787f04de28</guid><dc:creator>Marc</dc:creator><description>&lt;p&gt;By updating the connection parameters settings with this function: (note the &amp;quot;ble_conn_params_change_conn_params()&amp;quot; )&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;static void gap_params_update(void)
{
uint32_t                err_code;
ble_gap_conn_params_t   gap_conn_params;
memset(&amp;amp;gap_conn_params, 0, sizeof(gap_conn_params));

gap_conn_params.min_conn_interval = MIN_CONN_INTERVAL;
gap_conn_params.max_conn_interval = MAX_CONN_INTERVAL;
gap_conn_params.slave_latency     = SLAVE_LATENCY;
gap_conn_params.conn_sup_timeout  = CONN_SUP_TIMEOUT;

err_code = ble_conn_params_change_conn_params(&amp;amp;gap_conn_params);
APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And calling this function after a &amp;quot;Connected&amp;quot; event like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;    case BLE_GAP_EVT_CONNECTED:
        printf(&amp;quot;Connected!\r\n&amp;quot;);
        m_conn_handle = p_ble_evt-&amp;gt;evt.gap_evt.conn_handle;
        gap_params_update();
        ...
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;I eliminated the issue. My device will disconnect after 4 seconds, as desired, regardless of Dongle connection or Android.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;However&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Calling ble_conn_params_change_conn_params() while receiving packets seems to drop the packets. I put the ble_conn_params_change_conn_params() call at a strategic place (when receiving a message so the central wait for a reply, called once after a connection) and it did work with the PC dongle. But unfortunately even this seems to mess with the android device and after some data transfer it stop working.&lt;/p&gt;
&lt;p&gt;I suspect that the min/max_conn_interval get changed too and reverting them is not an option. With the current API it doesn&amp;#39;t seem possible to read back this information so my &amp;quot;solution&amp;quot; is unusable.&lt;/p&gt;
&lt;p&gt;So I guess I&amp;#39;m stuck with the original behavior.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97618?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2017 13:21:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:57dd61e4-6836-4882-88fa-7259b510c4c9</guid><dc:creator>Marc</dc:creator><description>&lt;p&gt;The phone is Central (Master). I&amp;#39;ll try to find in doc a way to read back the supervisor variable to see if it has changed after an android connection.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97613?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:23:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c59a92ca-41db-4be7-91e8-1ff7467599c7</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Btw. I missed the important part: is your phone Master (GAP Central)? If yes then what are connection parameters set in connection request? It can easily be 20s;) Print out all events and on some like connection established or connection parameters&amp;#39; update it would be good to print out also event data...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97617?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:21:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbf0e5bd-7987-4af6-acf4-2716dc258d4c</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Interesting question. Not having sniffer you have only event trace from nRF FW&amp;#39;s SD event handle on Nordic so firstly log everything over UART or RTT. Also using Nordic sniffer on $40 nRF51 DK might give you some more data with little bit of patience (it&amp;#39;s nice tool but cannot compete with several thousand USD devices from Frontline or similar companies so you need to do more re-tries to catch all necessary packets).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97616?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:13:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:842dfa76-47e1-42a6-ac7e-806bee127480</guid><dc:creator>Marc</dc:creator><description>&lt;p&gt;No we don&amp;#39;t have such analyser. Long story about this cage but we don&amp;#39;t have the luxury having such analyser. Having a leaky faraday cage would get inconsistent results (sometime 4 sec, 10sec, 20sec, etc), I assume having a consistent delay imply that the faraday cage works. Even if I don&amp;#39;t trap the &amp;quot;right&amp;quot; event, why it is different between the PC and the Android device?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97615?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:07:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7be5f237-88f7-4f86-8822-28a4ed9207f8</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;See &lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v5.0.0/group___b_l_e___g_a_p___c_e_n_t_r_a_l___c_o_n_n___m_s_c.html"&gt;respective SD flow chart (sequence diagram)&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97614?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:06:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:59ad33d6-ab67-4d90-9c41-fce7eda7185a</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;No, that&amp;#39;s wrong, there is GAP TIMEOUT event (and many more, if you really do exhaustive test like this I assume you print everything to debug output...)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97624?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:05:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a1b912fa-2cb7-46ec-b930-df9d8ca81b5c</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Because on the other side you are never sure if your RF isolation really works 100% unless you see the packets on link layer where Master (Central) should be repeating PDUs with the same SN/NESN flags (showing no response detected).&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97623?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:05:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a9b4514f-5f1b-4de3-b15d-cec7f5e54c45</guid><dc:creator>Marc</dc:creator><description>&lt;p&gt;This is the event I use to conclude I&amp;#39;m disconnected:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;        case BLE_GAP_EVT_DISCONNECTED:
        printf(&amp;quot;Disconnected!\r\n&amp;quot;);
        m_conn_handle = BLE_CONN_HANDLE_INVALID;
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97622?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:03:57 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:997f3cc8-8aa2-488f-bae7-03708f8a2a5d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;Otherwise indeed connection parameters including Supervision timeout can change during the connection, you should use network analyzer/sniffer to observe when and how exactly the link is terminated by master. Seeing your expensive cage equipment I assume you have that as well...&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97621?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 21:02:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:72fd765f-480a-4f70-8d16-f8e8a66b350d</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;You are right, I&amp;#39;m talking about time-out on &amp;quot;lost&amp;quot; connection on phone side (so GAP Central in your case I suppose). Nordic app should get proper event from SoftDevice at right time. Are you sure you print all SD events coming to your handler?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97620?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 20:59:01 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e4abc43c-42b2-45b0-97f1-f6bd6a8584a1</guid><dc:creator>Marc</dc:creator><description>&lt;p&gt;Just to confirm, are you talking about the timeout in central(Android) or peripheral(Nordic)?&lt;/p&gt;
&lt;p&gt;Because when the faraday cage is closed, the Nordic device becomes alone in its world. It then rely to nothing else but its supervisor implemented in the softdevice.&lt;/p&gt;
&lt;p&gt;If the delay differ, does it mean the central &amp;quot;override&amp;quot; the value of the supervisor timeout somehow at the negociation when connecting?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Supervision timeout Multiplier - Connection supervisory timeout</title><link>https://devzone.nordicsemi.com/thread/97612?ContentTypeID=1</link><pubDate>Wed, 30 Aug 2017 20:50:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b5524606-415a-456c-bc55-f80cca32829f</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;No, there is nothing wrong on your side and not much you can do, this is world of hundred thousand Android devices with embedded BT (+BLE) stacks written by people who don&amp;#39;t care much about the specifications. I&amp;#39;ve seen different time-outs on different Android 4.4-6.0 devices, things between 1 and 20 seconds regardless Supervision timeout value set in Connection Request parameters. In the end I just swore to my cup of tea and accepted it as fact. Welcome to the business!:)&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>