<?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>Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/103323/disconnection-request-from-ios-device-not-forcing-disconnection-from-nrf52</link><description>This is my environment: 
 IDE: VSC 
 SDK: NCS v2.2.0 
 iPhone 14 running iOS 16.6 
 nRF52-DK 
 
 This is how I have things set up: 
 
 My nRF52-DK is a sensor that is recording various events. I have either a custom App on the iOS device, or I am using</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 04 Sep 2023 07:57:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/103323/disconnection-request-from-ios-device-not-forcing-disconnection-from-nrf52" /><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/444232?ContentTypeID=1</link><pubDate>Mon, 04 Sep 2023 07:57:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ced2047e-06d1-47c4-b017-5fc38d251725</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Mike,&lt;/p&gt;
[quote user="Mike Austin (LPI)"]Set up the sniffer.&amp;nbsp;[/quote]
&lt;p&gt;Great, I am glad to read that you&amp;#39;ve got the sniffer up and running - it is a very powerful tool to have when developing BLE application.&lt;br /&gt;&lt;br /&gt;Thank you for the update about the iOS findings - your workaround sounds like a good approach for now, but I would still recommend that you reach out to Apple or an iOS forum to check if it is possible to disable or work around this behavior, or if there is anything else/underlying reason for this behavior, just in case. In either case I am glad that you&amp;#39;ve got a solution in place that works for your application.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to open another ticket if you should encounter any other issues or questions in the future.&lt;br /&gt;&lt;br /&gt;Good luck with your development!&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/444197?ContentTypeID=1</link><pubDate>Sun, 03 Sep 2023 21:30:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5aa26b8c-b01b-40be-a640-978ce1c52910</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;Set up the sniffer.&amp;nbsp; Watching the traffic being sent/received by my DK, I can see that it is in fact taking some time for iOS to issue the disconnect request.&amp;nbsp; So, for some reason, iOS requires a minimum ~ 30sec connection time before it will allow the connection to be removed.&amp;nbsp; Android doesn&amp;#39;t have this limitation.&lt;/p&gt;
&lt;p&gt;Our workaround is to have a &amp;quot;Disconnect Service&amp;quot; on the Peripheral.&amp;nbsp; To terminate the connection, the Client writes to the characteristic for this Service.&amp;nbsp; The Peripheral then initiates the disconnection in response to this.&amp;nbsp; This all happens instantaneously, regardless of the length of the connection period.&lt;/p&gt;
&lt;p&gt;Still not clear why iOS behaves like this, but its not something I can change anyway, so our workaround is what we have settled on as a solution&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/444111?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 12:54:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0a87e980-a397-4c22-9a1e-ee5d4bddce27</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Mike,&lt;br /&gt;&lt;br /&gt;Thank you for the update and for confirming that this is not an issue when testing against non-iOS devices centrals.&lt;br /&gt;Perhaps there exists some sort of &amp;#39;minimum connection time&amp;#39; within iOS? I would be surprised to learn this, but again I do unfortunately not have any personal experience with developing iOS applications.&lt;br /&gt;&lt;br /&gt;In this case I would have to recommend that you reach out to Apple through the iOS app developer forums to see if they can confirm that this is the correct behavior. Perhaps they can also explain if there is any way to work around this potential &amp;#39;minimum connection time&amp;#39;.&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/444081?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 11:57:40 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bf23ddfc-c214-4fe2-8ddd-2ece4641a50e</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;it definitely seems to be an iOS issue.&lt;/p&gt;
&lt;p&gt;our testing on Android shows no delay between Centrsl issuing a disconnect request and Peripheral honouring the disconnect.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;With&amp;nbsp;iOS, the delay seems to be (30-n) secs, where n is the time after the connection is made that the disconnect request is issued. So, if I issue a disconnect request 32 sec after the connection, it is honoured immediately. If I issue the disconnect request 25 secs after the connection is made, it takes 5 sec for the disconnect request to be honoured. If I issue the disconnect 1 sec after the connection is made, it takes 29 secs for the disconnection to be honoured, etc&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/444005?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 07:45:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:86f5a1bd-9af7-4dc4-a587-9f4f549e0afa</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Mike,&lt;/p&gt;
[quote user="Mike Austin (LPI)"]I&amp;#39;ll need to spend a bit of time getting the sniffer stuff set up, and might well use the Nordic peripheral_cts example to do this, as my custom firmware is pushing memory limits, and whenever I enable logging, I run out of room so can&amp;#39;t build :-([/quote]
&lt;p&gt;I know that it might look daunting to familiarize with the nRF Sniffer tool the first time around, but it is a very powerful tool to wield when developing with BLE, and we are ready to help you if you should get stuck or have any questions so I highly recommend that you give it a shot! :)&amp;nbsp;&lt;/p&gt;
[quote user="Mike Austin (LPI)"]&lt;p&gt;So, even though the nRF Connect App on iOS has requested a disconnection, the iOS itself has to satisfy itself that there are no other Apps with an active connection before it actually sends the disconnect request to the Peripheral.&lt;/p&gt;
&lt;p&gt;Not sure why, after 30secs of connection (but no activity) it decides to disconnect immediately.&amp;nbsp; Maybe that&amp;#39;s an iOS setting?&lt;/p&gt;[/quote]
&lt;p&gt;The explanation seems plausible to me - there are many things that iOS applies their own twists to in order to provide smoother customer experiences - but I still think there is something else going wrong here since the operation takes 30 seconds to disconnect, which is an ocean of time for any app to confirm that it can be closed.&lt;br /&gt;This is also a reason why it would be great to see a sniffer trace still, because then we can see if there&amp;#39;s anything being sent between the devices leading up to this (or if it is just empty packets), so maybe we can find the reason for the delay there.&lt;br /&gt;&lt;br /&gt;Do you know if there exists any option in iOS to view its &amp;#39;system log&amp;#39; or similar? I am unfortunately not personally familiar with iOS development, and so I dont know much about the chances of this being possible.&lt;br /&gt;&lt;br /&gt;Lastly, could you test your same application against another non-iOS device, so that we can isolate the behavior to occur with a iOS central?&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/443981?ContentTypeID=1</link><pubDate>Fri, 01 Sep 2023 05:30:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:dcf7d578-0735-49a8-90c1-d68fccfb81db</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Hi Karl,&lt;/p&gt;
&lt;p&gt;I&amp;#39;ll need to spend a bit of time getting the sniffer stuff set up, and might well use the Nordic peripheral_cts example to do this, as my custom firmware is pushing memory limits, and whenever I enable logging, I run out of room so can&amp;#39;t build :-(&lt;/p&gt;
&lt;p&gt;I did a bit of homework on Google, and asked a few other BLE experts I know, and general consensus is that this is an iOS &amp;quot;feature&amp;quot;.&amp;nbsp; Apparently iOS multiplexes the BLE connection&amp;nbsp;management over any Apps that have BLE connectivity, and so if one decides to drop the connection, it first has to satisfy itself that any other active Apps don&amp;#39;t want to have that connection remain in place before it actually makes the disconnect call via the radio layer.&lt;/p&gt;
&lt;p&gt;So, even though the nRF Connect App on iOS has requested a disconnection, the iOS itself has to satisfy itself that there are no other Apps with an active connection before it actually sends the disconnect request to the Peripheral.&lt;/p&gt;
&lt;p&gt;Not sure why, after 30secs of connection (but no activity) it decides to disconnect immediately.&amp;nbsp; Maybe that&amp;#39;s an iOS setting?&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Mike&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/443887?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2023 10:58:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1a63095d-0735-414f-9bfa-4a1d7a771c2c</guid><dc:creator>Karl Ylvisaker</dc:creator><description>&lt;p&gt;Hello Mike,&lt;br /&gt;&lt;br /&gt;I am glad to read that you already have resolved part of your issue.&lt;br /&gt;&lt;br /&gt;It sounds very strange to me that you are seeing the disconnection issues in the nRF Connect application logs, but not seeing this registered on the nRF52 DK. To properly investigate this it would be great if you could capture a sniffer trace of the on-air traffic between the devices when this occurs.&lt;br /&gt;Are you already familiar with &lt;a href="https://www.nordicsemi.com/Products/Development-tools/nrf-sniffer-for-bluetooth-le"&gt;the nRF Sniffer tool&lt;/a&gt;?&amp;nbsp;&lt;br /&gt;If not, please &lt;a href="https://infocenter.nordicsemi.com/topic/ug_sniffer_ble/UG/sniffer_ble/intro.html"&gt;see the documentation here for a guide to how to get started&lt;/a&gt; using it, and how to capture specific scenarios such as this one where the devices enter into a connection.&lt;br /&gt;It would also be great if you could share the logs from the peripheral device and the central device for the scenarios as well, so that I may take a look and see if I can spot the reason for this unexpected behavior.&lt;br /&gt;&lt;br /&gt;Please do not hesitate to ask if you should have any questions to this! :)&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Best regards,&lt;br /&gt;Karl&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Disconnection request from iOS device not forcing disconnection from nRF52</title><link>https://devzone.nordicsemi.com/thread/443869?ContentTypeID=1</link><pubDate>Thu, 31 Aug 2023 09:55:22 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46bb9eff-7b3d-4a18-8f30-cd43432513cd</guid><dc:creator>Mike Austin (LPI)</dc:creator><description>&lt;p&gt;Have got to the bottom (I think) of problem 1. Turns out I&amp;rsquo;d subscribed to notifications for the CTS, so that was probably preventing the connection from properly disconnecting. I don&amp;rsquo;t need notifications in the CTS (it was a legacy from copying code from the peripheral_cts example), so have just removed that code. Seems to disconnect as expected now.&lt;/p&gt;
&lt;p&gt;However, I&amp;rsquo;m still seeing problem #2, but&amp;nbsp;ONLY on iOS devices. On an Android device, the connection is disconnected the moment I trigger it from my Android device. Wwith&amp;nbsp;an iOS device, there is still this unusual need to have a connection active for at least 30 sec before the disconnection request is honoured.&lt;/p&gt;
&lt;p&gt;This&amp;nbsp;ticket seems to hint at a similar issue, but it was never resolved:&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/72834/long-time-to-disconnect/308335"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/72834/long-time-to-disconnect/308335&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Regards,&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Mike&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>