<?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>S110 peripheral disconnects in middle of activity</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/2612/s110-peripheral-disconnects-in-middle-of-activity</link><description>I am running into some symptoms here that I&amp;#39;m not understanding. 
 My peripheral is an nRF51822 using the S110 softdevice. It implements a service which sends out notifications at regular intervals (I&amp;#39;ve tried from 1 second to 10 seconds). Connection</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 26 May 2014 07:15:11 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/2612/s110-peripheral-disconnects-in-middle-of-activity" /><item><title>RE: S110 peripheral disconnects in middle of activity</title><link>https://devzone.nordicsemi.com/thread/10330?ContentTypeID=1</link><pubDate>Mon, 26 May 2014 07:15:11 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ee8d260-264a-405a-9c81-f06bba1cd341</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;In both the notification log, and the indication log I noticed that the Find By Type Request does not get any response from the Linux GATT Server, Could this be the reason for the disconnect, what does the application on the S110 do when it receive the BLE_GATTC_EVT_TIMEOUT? Is that when disconnect is called?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S110 peripheral disconnects in middle of activity</title><link>https://devzone.nordicsemi.com/thread/10329?ContentTypeID=1</link><pubDate>Fri, 23 May 2014 19:35:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d64b8905-a919-4a71-b88d-f02f81acdcd2</guid><dc:creator>Chris Hodapp</dc:creator><description>&lt;p&gt;A reply to Pål Håland above (so that I may format properly and attach things):&lt;/p&gt;
&lt;p&gt;I am still having this problem when handling indications and confirmations with gatttool in Linux, so I used hcidump from BlueZ to get a dump of HCI commands.&lt;/p&gt;
&lt;p&gt;Here is the dump for when using notifications:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;HCI sniffer - Bluetooth packet analyzer ver 5.18
btsnoop version: 1 datalink type: 1002
2014-05-23 12:29:04.480869 &amp;lt; HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr E5:47:90:E2:1C:E2 type 1
    interval 96 window 48 initiator_filter 0
    own_bdaddr_type 0 min_interval 40 max_interval 56
    latency 0 supervision_to 42 min_ce 0 max_ce 0
2014-05-23 12:29:04.482175 &amp;gt; HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
2014-05-23 12:29:04.508140 &amp;gt; HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x00 handle 64, role master
      bdaddr E5:47:90:E2:1C:E2 (Random)
2014-05-23 12:29:04.510083 &amp;lt; ACL data: handle 64 flags 0x00 dlen 9
    ATT: Write req (0x12)
      handle 0x0018 value  0x01 0x00
2014-05-23 12:29:04.589789 &amp;gt; ACL data: handle 64 flags 0x02 dlen 13
    ATT: Find By Type req (0x06)
      start 0x0001, end 0xffff, uuid 0x2800
      value 0x02 0x18
2014-05-23 12:29:04.657165 &amp;gt; ACL data: handle 64 flags 0x02 dlen 5
    ATT: Write resp (0x13)
2014-05-23 12:29:04.835165 &amp;gt; HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 1
2014-05-23 12:29:05.602293 &amp;gt; ACL data: handle 64 flags 0x02 dlen 13
    ATT: Handle notify (0x1b)
      handle 0x0017
      value 0xe7 0x03 0x01 0x00 0x02 0x00 

(removed where the above repeats for awhile...)

2014-05-23 12:29:33.614966 &amp;gt; ACL data: handle 64 flags 0x02 dlen 13
    ATT: Handle notify (0x1b)
      handle 0x0017
      value 0xcb 0x03 0x01 0x00 0x02 0x00 
2014-05-23 12:29:34.763349 &amp;gt; HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 64 reason 0x13
    Reason: Remote User Terminated Connection

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;And here is the dump for indications:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;HCI sniffer - Bluetooth packet analyzer ver 5.18
btsnoop version: 1 datalink type: 1002
2014-05-23 12:14:51.345168 &amp;lt; HCI Command: LE Create Connection (0x08|0x000d) plen 25
    bdaddr E5:47:90:E2:1C:E2 type 1
    interval 96 window 48 initiator_filter 0
    own_bdaddr_type 0 min_interval 40 max_interval 56
    latency 0 supervision_to 42 min_ce 0 max_ce 0
2014-05-23 12:14:51.346891 &amp;gt; HCI Event: Command Status (0x0f) plen 4
    LE Create Connection (0x08|0x000d) status 0x00 ncmd 1
2014-05-23 12:14:51.374854 &amp;gt; HCI Event: LE Meta Event (0x3e) plen 19
    LE Connection Complete
      status 0x00 handle 64, role master
      bdaddr E5:47:90:E2:1C:E2 (Random)
2014-05-23 12:14:51.376840 &amp;lt; ACL data: handle 64 flags 0x00 dlen 9
    ATT: Write req (0x12)
      handle 0x0018 value  0x02 0x00
2014-05-23 12:14:51.468253 &amp;gt; ACL data: handle 64 flags 0x02 dlen 13
    ATT: Find By Type req (0x06)
      start 0x0001, end 0xffff, uuid 0x2800
      value 0x02 0x18
2014-05-23 12:14:51.535628 &amp;gt; ACL data: handle 64 flags 0x02 dlen 5
    ATT: Write resp (0x13)
2014-05-23 12:14:51.635879 &amp;gt; HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 1
2014-05-23 12:14:52.480757 &amp;gt; ACL data: handle 64 flags 0x02 dlen 13
    ATT: Handle indicate (0x1d)
2014-05-23 12:14:52.487342 &amp;lt; ACL data: handle 64 flags 0x00 dlen 5
    ATT: Handle CNF (0x1e)

(removed where the above three repeat - HCI Event, ACL, ACL...)

2014-05-23 12:15:19.763051 &amp;gt; HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 1
2014-05-23 12:15:20.493434 &amp;gt; ACL data: handle 64 flags 0x02 dlen 13
    ATT: Handle indicate (0x1d)
2014-05-23 12:15:20.494878 &amp;lt; ACL data: handle 64 flags 0x00 dlen 5
    ATT: Handle CNF (0x1e)
2014-05-23 12:15:20.763057 &amp;gt; HCI Event: Number of Completed Packets (0x13) plen 5
    handle 64 packets 1
2014-05-23 12:15:21.641065 &amp;gt; HCI Event: Disconn Complete (0x05) plen 4
    status 0x00 handle 64 reason 0x13
    Reason: Remote User Terminated Connection

&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;In both instances, I see a BLE_GATTC_EVT_TIMEOUT event on the peripheral.&lt;/p&gt;
&lt;p&gt;The full dumps (untouched output of &amp;quot;hcidump -w&amp;quot;) are attached as well.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S110 peripheral disconnects in middle of activity</title><link>https://devzone.nordicsemi.com/thread/10328?ContentTypeID=1</link><pubDate>Fri, 23 May 2014 15:08:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6520b951-62ad-4e39-8442-7de628a7ba7d</guid><dc:creator>Chris Hodapp</dc:creator><description>&lt;p&gt;I don&amp;#39;t run Windows (I&amp;#39;m on Linux) but I will see if there&amp;#39;s some way I can make this sniffer or another sniffer work.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think it&amp;#39;s an unconfirmed indication. I had indications and confirmations logged on the peripheral side, and every single indication that was successfully sent out received a confirmation back; this also happens even when no indications are sent.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S110 peripheral disconnects in middle of activity</title><link>https://devzone.nordicsemi.com/thread/10327?ContentTypeID=1</link><pubDate>Fri, 23 May 2014 07:17:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fbe55037-60a6-4e10-acc1-f7d35e6dbe85</guid><dc:creator>P&amp;#229;l H&amp;#229;land</dc:creator><description>&lt;p&gt;Hi Chris,
Do you think you could try and get a sniff trace with the help of the tool mentioned in this post?
&lt;a target="_blank" href="https://devzone.nordicsemi.com/index.php/ble-sniffer-recommendation" rel="nofollow"&gt;https://devzone.nordicsemi.com/index.php/ble-sniffer-recommendation&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;This really helps understanding what is happening. Especially if there are some events that is not handled. In the place where you pull out the events, you can try to add an assert or breakpoint in the default case (if you are using a switch on the event ID) Could be an pairing request that is not handled or and indication that is not confirmed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: S110 peripheral disconnects in middle of activity</title><link>https://devzone.nordicsemi.com/thread/10326?ContentTypeID=1</link><pubDate>Thu, 22 May 2014 20:24:13 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6022e738-69b1-4ea9-a6fa-dd2628f65fbe</guid><dc:creator>Chris Hodapp</dc:creator><description>&lt;p&gt;A reply to my own question:&lt;/p&gt;
&lt;p&gt;I may have addressed this issue but I still do not understand it.&lt;/p&gt;
&lt;p&gt;The peripheral had min and max connection interval of 500 and 1000 ms, respectively. The central (S120) had min and max connection interval of 30 and 60 ms. The parameters which I read from the connection event had a connection interval of 48 (though I do not know the units).&lt;/p&gt;
&lt;p&gt;First I changed minimum interval on the peripheral to 50 ms. This remedied the problem. The part that confuses me is that the actual connection parameters on the connection event were identical to before!&lt;/p&gt;
&lt;p&gt;I also tried setting the central&amp;#39;s maximum interval to 1000 ms (leaving the minimum interval on the peripheral at 500 ms). This, too,  worked, and the actual connection parameters differed from before.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>