<?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 issues</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/28718/android-disconnect-issues</link><description>I am using HRM demo application on nRF52840 DK with Samsung Tab-A. The nRF Connect App is running on the tablet. We are seeing that the dev kit gets disconnected soon after a connection is established. The error code on peripheral side is 0x2A. 
 Android</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 22 Dec 2017 10:11:43 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/28718/android-disconnect-issues" /><item><title>RE: Android disconnect issues</title><link>https://devzone.nordicsemi.com/thread/113827?ContentTypeID=1</link><pubDate>Fri, 22 Dec 2017 10:11:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fec32429-9c25-4b72-9d2b-f00bc32d3193</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Could you try to use &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF-Sniffer/"&gt;our sniffer&lt;/a&gt; ? What you provided is Android log. It doesn&amp;#39;t provide all the information needed. I saw some connection established but then saw &amp;quot;Sent Disconnect&amp;quot; meaning it&amp;#39;s disconnected by the phone.&lt;/p&gt;
&lt;p&gt;In last softdevice, it&amp;#39;s fixed by allowing the parallel LL link command for all LL commands (except 2 same LL commands) by default. So the compatible mode 2 is not needed. Note that compatible mode 2 only cover part of the LL commands, so there could be a chance that your central issue wasn&amp;#39;t covered by Compat mode 2.&lt;/p&gt;
&lt;p&gt;sd_ble_opt_get(BLE_GAP_OPT_COMPAT_MODE_2) &lt;a href="https://devzone.nordicsemi.com/question/62760/usage-of-ble_gap_opt_compat_mode/"&gt;always return code 7&lt;/a&gt; , it&amp;#39;s a bug and since this mode is deprecated in newer softdevice, we won&amp;#39;t fix it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android disconnect issues</title><link>https://devzone.nordicsemi.com/thread/113825?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 20:51:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cb599ebe-2160-400e-984a-f47a8d9455ca</guid><dc:creator>KV</dc:creator><description>&lt;p&gt;Thanks for the suggestion. This still did not fix the issue. I added the following lines of code which is executed once on power up (outside while(1) loop).&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_stack_init();
peer_manager_init();
gap_params_init();
gatt_init();
advertising_data_set();

// initiliaze BLE parameters
gatt_mtu_set(ble_params.att_mtu);
data_len_ext_set(ble_params.data_len_ext_enabled);
conn_evt_len_ext_set(ble_params.conn_evt_len_ext_enabled);
preferred_phy_set(&amp;amp;ble_params.phys);

//st compatibility mode to 2 for samsung Tab-A disconnect issues
ret_code_t err_code;
ble_opt_t  opt;       
memset(&amp;amp;opt, 0x00, sizeof(opt));
opt.gap_opt.compat_mode_2.enable = 1;
err_code = sd_ble_opt_set(BLE_GAP_OPT_COMPAT_MODE_2 , &amp;amp;opt);
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;When I use the sd_ble_opt_get to read back the option (just to confirm) this soft device API returns error code 7 (invalid param). not sure what is wrong with this code below:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt; memset(&amp;amp;opt, 0x00, sizeof(opt));
err_code = sd_ble_opt_get(BLE_GAP_OPT_COMPAT_MODE_2 , &amp;amp;opt);
APP_ERROR_CHECK(err_code);
NRF_LOG_INFO(&amp;quot;compatiblity get:%d&amp;quot;, opt.gap_opt.compat_mode_2.enable);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;Also, I noticed that in the latest soft device v6 release notes that this issue has been fixed (DRGN-8623). Is that correct?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android disconnect issues</title><link>https://devzone.nordicsemi.com/thread/113824?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 20:47:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6a0e309b-748e-47c2-ac68-e336a70626f1</guid><dc:creator>Madhu</dc:creator><description>&lt;p&gt;@Hung Bui Please find the attached sniffer trace from Android device Samsung Tab A  SM-T580 with Bluetooth version 4.2. &lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/btsnoop_5F00_hci.log"&gt;btsnoop_hci.log&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android disconnect issues</title><link>https://devzone.nordicsemi.com/thread/113823?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 16:26:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c237b826-c9f2-448d-b897-6c2e3f09fec9</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi KV,
On S140 v5.0, the feature is not enabled by default. You can try enable compatibility mode 2 BLE_GAP_OPT_COMPAT_MODE_2 using the sd_ble_opt_set() function. Your case may be similar to &lt;a href="https://devzone.nordicsemi.com/question/105213/disconnect-on-s130-v2-hci-error-0x2a/"&gt;this case&lt;/a&gt;.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android disconnect issues</title><link>https://devzone.nordicsemi.com/thread/113822?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 15:21:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:01176845-bef8-47fe-841c-dafc6792ff8d</guid><dc:creator>KV</dc:creator><description>&lt;p&gt;SDK 14.2.0 and Soft device S140 version 5.0.0.-2_alpha. The soft device v6 is not compatible with the latest SDK.&lt;/p&gt;
&lt;p&gt;The disconnected reason is BLE_HCI_DIFFERENT_TRANSACTION_COLLISION.&lt;/p&gt;
&lt;p&gt;I am trying to set up the latest sniffer (beta release v2.0) with Wireshark and it is functioning intermittently. Sometimes the COM port does not get detected.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android disconnect issues</title><link>https://devzone.nordicsemi.com/thread/113821?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 13:25:17 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a116c95-6034-441d-9736-580694c9fd50</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@KV: Please provide &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-Smart-Bluetooth-low-energy/nRF-Sniffer/"&gt;a sniffer trace&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Please state which SDK and which Softdevice you used.
Also please confirm you have disconnected reason = 0x2A = BLE_HCI_DIFFERENT_TRANSACTION_COLLISION, this disconnect reason usually happens when the peer (the phone) violate the spec and send 2 LL link layer  request without waiting for response. In S132 we allowed the behaviour. From release note:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;The SoftDevice slave role now accepts overlapping peer-initiated Link Layer control procedures (DRGN-8623). The following LL control procedures can be executed in parallel with any other control procedure, except for themselves: LEPing, Feature Exchange, Data Length Update, and Version Exchange. This is done for compatibility reasons.
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Android disconnect issues</title><link>https://devzone.nordicsemi.com/thread/113826?ContentTypeID=1</link><pubDate>Thu, 21 Dec 2017 07:33:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:809ae7fa-8acd-4d51-ad28-47503dd53753</guid><dc:creator>endnode</dc:creator><description>&lt;p&gt;If you have problem with some buggy blackbox (here made by Samsung) failing in BLE connection then you will need Network analyzer/BLE sniffer to understand what happens there.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>