<?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>Detect link loss with peripheral</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28160/detect-link-loss-with-peripheral</link><description>Hello, I am trying out my pca10028 board, with s110 and my updated ble_app_uart expample. I am trying to detect a link loss: board advertises as peripheral connects with android device. 
 After they connect bluetooth is being turned off in the android</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 11 Dec 2017 16:25:53 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28160/detect-link-loss-with-peripheral" /><item><title>RE: Detect link loss with peripheral</title><link>https://devzone.nordicsemi.com/thread/111219?ContentTypeID=1</link><pubDate>Mon, 11 Dec 2017 16:25:53 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d9617c10-2eeb-44ac-a777-2f46ba29707b</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;I doubt the link loss service would help you. The link loss service is simply waiting for the disconnect event to occur, and in your case the problem is that the disconnect event doesn&amp;#39;t happen soon enough.&lt;/p&gt;
&lt;p&gt;Do you have access to the Nordic sniffer?&lt;br /&gt;
If you do you should be able to check how long it takes for the phone to properly disconnect the link. Most likely the issue is that the Android phone keeps the connection running in the background.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect link loss with peripheral</title><link>https://devzone.nordicsemi.com/thread/111218?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2017 14:10:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:44a0a458-3402-474c-85cd-fd60aaa40ba2</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;Would I be able solve this by adding [link loss service] ?(&lt;a href="https://devzone.nordicsemi.com/documentation/nrf51/4.4.1/html/group__ble__sdk__srv__lls.html)"&gt;devzone.nordicsemi.com/.../group__ble__sdk__srv__lls.html)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;If yes. Could you explain me how to implement it?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect link loss with peripheral</title><link>https://devzone.nordicsemi.com/thread/111217?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2017 14:01:48 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3eae50a7-8ad1-4d2b-857e-8ebd6dc653f5</guid><dc:creator>Chocol8</dc:creator><description>&lt;p&gt;Good afternoon, Torbjørn. I am glad that you have answered to my question. Unfortunately, I am not able to shorten the time to detect the disconnection while shortening connection supervisory timeout.The define of it in my code looks like this:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;#define CONN_SUP_TIMEOUT                100   
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;So, while in connection I turn off my mobile phone (android). Disconnect event in debugger apears only after 30 seconds no matter what is the value of timeout. I have tried to define it as 4ms. Then MCU does not start properly because smallest possibile defined was 100ms, then code is not being executed. So, my guess is that this value is being used and is responsive... What is your oppinion on this? Why it takes 30 seconds to detect that master device is off.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Detect link loss with peripheral</title><link>https://devzone.nordicsemi.com/thread/111216?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2017 12:07:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:edd657c9-b7c1-4478-bf39-fe90e447f5a0</guid><dc:creator>ovrebekk</dc:creator><description>&lt;p&gt;Hi&lt;/p&gt;
&lt;p&gt;The time it takes to recognize a link loss is set by the &lt;em&gt;connection supervising timeout&lt;/em&gt; period, which is the time it takes before a BLE devices gives up on the link if no packets are received.&lt;/p&gt;
&lt;p&gt;This time is set up as a part of the connection parameters, and you can try to reduce this parameter to make your device more responsive on a link loss. You just have to make sure it&amp;#39;s not too small, or the link will not be very stable (it should be at least 6 times your connection interval).&lt;/p&gt;
&lt;p&gt;If you want an even quicker response on a link loss you could have the phone send some data at a regular interval, and take some action in the peripheral if no data is received for a certain amount of time, but this would require the app to be running continuously on the phone.&lt;/p&gt;
&lt;p&gt;Best regards&lt;br /&gt;
Torbjørn&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>