<?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>CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/83870/cts-compatibility-issues-in-disconnection-after-bonding-disconnected-reason-0x16</link><description>Hi Sir/Miss, 
 
 I import cts (current time service) as previous topic which is as link . 
 I have a compatibility issue in different phone. 
 The tested conditions are as below: 
 Apple 
 iPhone 11 (iOS15.1) with nRF connect - OK 
 iPhone 12 (iOS15.1</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Jan 2022 01:20:05 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/83870/cts-compatibility-issues-in-disconnection-after-bonding-disconnected-reason-0x16" /><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349859?ContentTypeID=1</link><pubDate>Thu, 27 Jan 2022 01:20:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2b8931ff-e7bd-4dc8-a288-9642e00d309f</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Got it. We also update android OS version to 12 on pixel 5. (Version is same as pixel 6). Google pixel 5 is difference with pixel 6. It supports CTS feature.&lt;/p&gt;
&lt;p&gt;Thank you for your help again.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349790?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 14:17:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4a25d88f-fafc-4036-80fd-64535f61b853</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I see. Then I guess it is the line 430 in main.c that was triggered then:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;        case BLE_CTS_C_EVT_DISCOVERY_FAILED:
            NRF_LOG_INFO(&amp;quot;Current Time Service not found on server. &amp;quot;);
            // CTS not found in this case we just disconnect. There is no reason to stay
            // in the connection for this simple app since it all wants is to interact with CT
            if (p_evt-&amp;gt;conn_handle != BLE_CONN_HANDLE_INVALID)
            {
                err_code = sd_ble_gap_disconnect(p_evt-&amp;gt;conn_handle,
                                                 BLE_HCI_REMOTE_USER_TERMINATED_CONNECTION);
                APP_ERROR_CHECK(err_code);
            }
            break;&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is a special case in Bluetooth Low Energy, because usually it is the peripheral that holds the services and the central is the client, but in this case it is the central that &amp;quot;owns&amp;quot; the service, and the peripheral is the client. If the phone doesn&amp;#39;t provide the Current Time Service, then this application will disconnect in the above snippet. However, the behavior of the application is completely up to you. If you still want to connect to the phone and use other services, then you are perfectly fine to so so.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349744?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 12:08:08 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:39b01fa2-99d5-4d6a-b189-1d9e2ce57edc</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;It looks like google pixel 6 issue. I try use other product with CTS to connect with pixel 6. That also doesn&amp;#39;t update time. I think I should avoid disconnect after not support this service.&lt;/p&gt;
&lt;p&gt;Thank you for your assistance.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349678?ContentTypeID=1</link><pubDate>Wed, 26 Jan 2022 07:40:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:63ca054a-a88e-46e2-8fce-eb8545fd1dd7</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;In previous call stack information, I set break point at all case of BLE_GAP_EVT_DISCONNECTED.&lt;/p&gt;
&lt;p&gt;In setting breakpoint at all&amp;nbsp;&lt;span&gt;sd_ble_gap_disconnect(),&amp;nbsp; I use pca10040e s112 example code, except no used function in pm_hanlder_disconnect_on_sec_failure and pm_handler_disconnect_on_insufficient_sec . It&amp;#39;s triggered at BLE_CTS_C_DISCONVERY_FAILED of on_cts_c_evt. That means the phone don&amp;#39;t have this service?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;img alt=" " src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/on_5F00_cts_5F00_c_5F00_evt_5F00_call_5F00_stack.PNG" /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;In previous test, I always use pca10040e example. I try to&amp;nbsp;program hex file directly&amp;nbsp;on nRF52 DK recently.(ble_app_cts_c_pca10040e_s112.hex and&amp;nbsp;ble_app_cts_c_pca10040_s132.hex). Both of them have disconnection result.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349522?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 12:37:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:df7fdb4a-df5f-4ccd-b54b-258a7d9ff16e</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;Thank you for the detailed video and the new sniffer trace.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;From the trace, I can&amp;#39;t see anything that would indicate that they are bonding twice, so it could be the phone acting weird (that would not be the first time).&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It is the nRF that decides to disconnect in packet number. 2344 in the sniffer trace (ble_cts_c_sniffer_filter_nordic_video1.pcapng). I see that you have some screenshot from the callstack in your original post. What does it point to? Is that just the disconnected event?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;The softdevice will never initiate a disconnection itself with the reason&amp;nbsp;Remote User Terminated Connection (0x13). So it has to be done from the application somewhere. Can you please try to set a breakpoint at all the calls to sd_ble_gap_disconnect() and see if any of them are reached when the devices disconnect?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Just for debugging purposes. Does it also happen on the unmodified pca10040e example?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349396?ContentTypeID=1</link><pubDate>Tue, 25 Jan 2022 01:42:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f310bb44-b069-4076-8347-cb973154124c</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi Edvin,&lt;/p&gt;
&lt;p&gt;In above results, I use example code (ble_app_cts_c) to test it. I didn&amp;#39;t modify the code. Before test, I use nRF connect desktop tool to erase nrf52 DK, and forget BLE device on google pixel 6. The cts_init is not existed security selection. When I want to disable&amp;nbsp;SEC_PARAM_BOND, that will run error handler. On original code, the sniffer doesn&amp;#39;t pick up the key.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The attached&amp;nbsp;files are a process video and sniffer log which I perform it. In my condition, the pixel mobile phone always pops up pairing twice. In info column of sniffer, I see&amp;nbsp; that rcvd pairing response: AuthReq:&amp;nbsp; Bonding | Initator key. Please check it.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/bandicam-2022_2D00_01_2D00_25-09_2D00_02_2D00_02_2D00_870.mp4"&gt;devzone.nordicsemi.com/.../bandicam-2022_2D00_01_2D00_25-09_2D00_02_2D00_02_2D00_870.mp4&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_cts_5F00_c_5F00_sniffer_5F00_filter_5F00_nordic_5F00_video1.pcapng"&gt;devzone.nordicsemi.com/.../ble_5F00_cts_5F00_c_5F00_sniffer_5F00_filter_5F00_nordic_5F00_video1.pcapng&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349299?ContentTypeID=1</link><pubDate>Mon, 24 Jan 2022 14:21:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bcbe1de0-f400-4c3d-b31b-28e7b104bfde</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I believe that these sniffer traces are not made from the initial connection between the devices, right?&lt;/p&gt;
&lt;p&gt;Try to delete the bonding information between the mobile phone and the nRF. On the mobile phone it is typically done in Settings -&amp;gt; Bluetooth. On the nRF the easiest way is to erase the flash using &amp;quot;nrfjprog --eraseall&amp;quot; (nrfjprog = &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-command-line-tools/download"&gt;nRF Command Line Tools&lt;/a&gt;), and reflash the application.&lt;/p&gt;
&lt;p&gt;If you are using &amp;quot;just works&amp;quot; bonding, then the sniffer should pick up the keys the first time they connect and pair, but if you have some MITM (such as a passkey) you need to enter this passkey into the sniffer as well before you enter it on your phone.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Enter the passkey here (red circle):&lt;br /&gt;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1643034010213v1.png" alt=" " /&gt;&lt;/p&gt;
&lt;p&gt;When the sniffer either receives the keys from your input, or pick it up from the packets, you should no longer see the &amp;quot;decrypted incorrectly&amp;quot; messages that you can also see in the screenshot above.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/349110?ContentTypeID=1</link><pubDate>Mon, 24 Jan 2022 03:31:36 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2177cd70-4f00-4dab-8b51-6158fe327d2a</guid><dc:creator>Ben</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Here is my test result.&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Are you able to get the Current Time from the CTS before they disconnect? &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I set a global&amp;nbsp;variable in ble_cts_c_evt_t which doesn&amp;#39;t update time before disconnect.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Do they disconnect again if you try to connect after they are bonded? &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Yes.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Which device is initiating the disconnect? The nRF or the mobile phone?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure which device is initiating the disconnect (nrf52 or falling phone)? I just see device enter BLE_GAP_EVT_DISCONNECTED in ble_evt_handler. Do you have any suggestions to check this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please check attachments. I&amp;#39;m not&amp;nbsp;familiar with sniffer. If there are wrong data, please tell me.&lt;/p&gt;
&lt;p&gt;Thank you.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_cts_5F00_c_5F00_sniffer.pcapng"&gt;devzone.nordicsemi.com/.../ble_5F00_cts_5F00_c_5F00_sniffer.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_cts_5F00_c_5F00_sniffer_5F00_filter_5F00_nordic_5F00_cts.pcapng"&gt;devzone.nordicsemi.com/.../ble_5F00_cts_5F00_c_5F00_sniffer_5F00_filter_5F00_nordic_5F00_cts.pcapng&lt;/a&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/communityserver-discussions-components-files/4/ble_5F00_cts_5F00_c_5F00_sniffer_5F00_filter_5F00_nordic_5F00_cts_5F00_process_5F00_in_5F00_bonding.pcapng"&gt;devzone.nordicsemi.com/.../ble_5F00_cts_5F00_c_5F00_sniffer_5F00_filter_5F00_nordic_5F00_cts_5F00_process_5F00_in_5F00_bonding.pcapng&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: CTS compatibility issues in disconnection after bonding (Disconnected reason 0x16)</title><link>https://devzone.nordicsemi.com/thread/348957?ContentTypeID=1</link><pubDate>Fri, 21 Jan 2022 14:14:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:23e583a6-4b6a-4f6d-85a4-233f8bbe8411</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t have any of the &amp;quot;failing&amp;quot; phones. Are you able to get the Current Time from the CTS before they disconnect? Do they disconnect again if you try to connect after they are bonded? Which device is initiating the disconnect? The nRF or the mobile phone?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Can you please try to capture a sniffer trace of one of the connections that disconnect? You can use the &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nRF-Sniffer-for-Bluetooth-LE"&gt;nRF Sniffer for Bluetooth LE&lt;/a&gt; for this.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Please upload the sniffer trace as a .pcapng here.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>