<?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>Android: Disconnect Reason?</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/27856/android-disconnect-reason</link><description>In Android, is there any way to distinguish between an explicit disconnect requested by the remote device, and a disconnect due to loss of comms; eg, the remote device going out of range?</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 06 Dec 2017 13:55:14 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/27856/android-disconnect-reason" /><item><title>RE: Android: Disconnect Reason?</title><link>https://devzone.nordicsemi.com/thread/109767?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2017 13:55:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:50a1f29d-3652-4216-987c-021a2ab07c13</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Deep in the stack code. You may find most common ones here: &lt;a href="https://github.com/NordicSemiconductor/Android-DFU-Library/blob/release/dfu/src/main/java/no/nordicsemi/android/error/GattError.java"&gt;github.com/.../GattError.java&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android: Disconnect Reason?</title><link>https://devzone.nordicsemi.com/thread/109766?ContentTypeID=1</link><pubDate>Wed, 06 Dec 2017 13:16:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23c06241-c383-45a1-b0c5-d8b192ab3256</guid><dc:creator>Prasad</dc:creator><description>&lt;p&gt;Are these status defined as constants in some android class? I want a list of status that onConnectionStateChanged() returns.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android: Disconnect Reason?</title><link>https://devzone.nordicsemi.com/thread/109765?ContentTypeID=1</link><pubDate>Tue, 21 Jun 2016 08:48:38 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f77ad78a-755c-49dd-aa1b-b840f5a8d02f</guid><dc:creator>Aleksander Nowakowski</dc:creator><description>&lt;p&gt;Hello,
Sorry for the late reply. If depends how gracefully you disconnect from a device. If you send disconnect request from your peripheral, you get onConnectionStateChanged with status = 19 (0x13 = GATT CONN TERMINATE PEER USER). If you just restart your device, or you go out of range, or other reason of loss of comms, you will get status = 8 (0x08 = GATT CONN TIMEOUT).
Foe example, DFU since SDK 8 (AFAIR) sends graceful disconnect.&lt;/p&gt;
&lt;p&gt;Here it&amp;#39;s shown on the log from nRF Master Control Panel:
&lt;img src="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/1273.screen.png" alt="image description" /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>