<?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>Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/19488/error-22-0x16-gatt_conn_terminate_local_host-only-on-samsung-xcover-device</link><description>When I run the BLE peripheral HRS example on the eval board and try to connect with a Samsung XCover3 using the &amp;quot;nRF Connect&amp;quot; app, I got the error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST . 
 Doing the same with a Sony Xperia ZL, I got no error. After</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 16 Jun 2020 00:08:51 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/19488/error-22-0x16-gatt_conn_terminate_local_host-only-on-samsung-xcover-device" /><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/255110?ContentTypeID=1</link><pubDate>Tue, 16 Jun 2020 00:08:51 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fed5db2-e78e-4742-9ec4-cd6f0ef4e0bb</guid><dc:creator>Dinesh Harjani</dc:creator><description>&lt;p&gt;If you flash the Eddystone sample into a dev-kit after having previously paired/bonded with it with another image, you need to go into Settings in your Android phone and forget it &amp;#39;by hand&amp;#39;; otherwise error 22 will arise when attempting to connect to it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/192242?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 08:01:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:56eaa905-0d4a-44ee-bd38-8c62b47f7834</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;&amp;nbsp;George R,&lt;/p&gt;
&lt;p&gt;Please create &lt;a href="https://devzone.nordicsemi.com/support/add"&gt;a new ticket&lt;/a&gt; for this.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/192198?ContentTypeID=1</link><pubDate>Wed, 12 Jun 2019 04:50:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c61c0cdf-2ce2-4ddb-8ce5-443be6777a5a</guid><dc:creator>George R</dc:creator><description>&lt;p&gt;Hi &lt;a href="https://devzone.nordicsemi.com/members/sigurdon"&gt;Sigurd&lt;/a&gt;, we encounter the same problem with a&amp;nbsp;&lt;span&gt; Samsung Galaxy Tab A (2016) (ERR_22). We are using our sensors and Polidea RxBle to connect to sensors.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Can you please suggest a solution for us too? I do not know how to and where to implement the above mentioned solution provided.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/75703?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 17:37:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:adc39db0-1295-4240-80e7-b066c99d3eaf</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Yes, that is correct.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/75704?ContentTypeID=1</link><pubDate>Tue, 07 Mar 2017 16:12:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6a4f6a5-dfd5-42fc-8dba-ed022e0fe331</guid><dc:creator>Benjamin F&amp;#252;ldner</dc:creator><description>&lt;p&gt;Thank you for this hint! The connection with the Samsung XCover3 now works as expected, also with the S132 SoftDevice version 3.0.0. As I understand the problem, the Samsung device is not fully Bluetooth 4.2 compatible, right?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/75705?ContentTypeID=1</link><pubDate>Mon, 06 Mar 2017 12:48:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6ec36681-fbd6-4d42-8cac-0c349b697708</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;The sniffer is not up-to-date with the newest LL packets, so the name of the newest packets are shown as unknown in the sniffer. The first “unknown” packet has opcode 0x14, if you look at the Bluetooth Specifications (Core version 4.2 or 5.0) this is a &lt;code&gt;LL_LENGTH_REQ packet&lt;/code&gt; send from the nRF52 to the Xcover, in order to enable Data length extension (DLE)/ longer on-air data packets. According to the specifications, if the Xcover supported DLE, it should have responded with a &lt;code&gt;LL_LENGTH_RSP&lt;/code&gt; packet, and if Xcover didn’t support DLE it should have sent a &lt;code&gt;LL_UNKNOWN_RSP&lt;/code&gt; packet. None of these packets are sent by the Xcover.&lt;/p&gt;
&lt;p&gt;I suggest to use the default payload size of 27, so that the DLE procedure is not initiated (&lt;code&gt;LL_LENGTH_REQ&lt;/code&gt; will not be sent). Call this function before you start advertising:&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;void data_len_ext_set(void)
{
    ret_code_t err_code;
    ble_opt_t  opt;

    memset(&amp;amp;opt, 0x00, sizeof(opt));

    opt.gap_opt.ext_len.rxtx_max_pdu_payload_size = 0;

    err_code = sd_ble_opt_set(BLE_GAP_OPT_EXT_LEN, &amp;amp;opt);
    APP_ERROR_CHECK(err_code);
}
&lt;/code&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/75702?ContentTypeID=1</link><pubDate>Thu, 02 Mar 2017 14:37:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:611cf206-1da2-4f5d-95fd-4ad00a3254f2</guid><dc:creator>Benjamin F&amp;#252;ldner</dc:creator><description>&lt;p&gt;I did the test with S132 version 3.1.0, but I got the same error results.&lt;/p&gt;
&lt;p&gt;With the PCA10000 eval board I catched the two loggs attached to the question. The trace of the Samsung device is really weired: It is full of unknown LL Control PDUs. What does this mean?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/75700?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2017 10:35:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40e3bfe7-d556-418c-a039-b94128ca6666</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Error 22 is not very common. Could you test with the S132 version 3.1.0 SoftDevice?
Download it &lt;a href="https://www.nordicsemi.com/eng/nordic/download_resource/56263/7/76737592"&gt;here&lt;/a&gt;, and replace the headers in the folder &lt;code&gt;SDK_Folder\components\softdevice\s132&lt;/code&gt;.
Try to enable compatibility mode, and see it this solves the issue.
Put this after ble_stack_init():&lt;/p&gt;
&lt;pre&gt;&lt;code&gt;ble_opt_t ble_opt;
memset(&amp;amp;ble_opt, 0, sizeof(ble_opt));

ble_opt.gap_opt.compat_mode_2.mode_2_enable = 1;

err_code = sd_ble_opt_set(BLE_GAP_OPT_COMPAT_MODE_2,&amp;amp;ble_opt); 
APP_ERROR_CHECK(err_code);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;If this doesn&amp;#39;t solve the issue, a &lt;a href="https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF-Sniffer"&gt;sniffer trace&lt;/a&gt; should be performed.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/75701?ContentTypeID=1</link><pubDate>Tue, 07 Feb 2017 09:48:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:de3a2b81-799e-4c76-82d7-170af74e6944</guid><dc:creator>Benjamin F&amp;#252;ldner</dc:creator><description>&lt;p&gt;I did a complete factory reset on the Samsung device (wipe /data, /cache, ...): Same behaviour. Also enabling debug output of the example did not lead to any error faults.&lt;/p&gt;
&lt;p&gt;Interesting fakt: With the old SDK 11.0.0 and softdevice 2.0.0 the Samsung device works, but there we had problems with Apple devices :(&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Error 22 (0x16): GATT_CONN_TERMINATE_LOCAL_HOST only on Samsung XCover device</title><link>https://devzone.nordicsemi.com/thread/75699?ContentTypeID=1</link><pubDate>Mon, 06 Feb 2017 14:09:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:cf02dfdd-6dab-4ade-95c6-d3ee946da9fd</guid><dc:creator>Sigurd</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;This could be caused by an old gatt table with services that you previously bonded with. Try to go into Bluetooth settings on your phone, forget all bluetooth services/devices that you have listed there (paired with) and perhaps disable Bluetooth and enable it again. Then try again and see if it works.&lt;/p&gt;
&lt;p&gt;If this doesn’t work, try to find any error codes reported by the nRF52(any reasons for the disconnect). See e.g. &lt;a href="https://devzone.nordicsemi.com/question/60125/my-device-is-freezing-and-restarting/"&gt;this answer&lt;/a&gt; on how to debug. A sniffer trace could also reveal what the problem is.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>