<?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>ios disconnected after added the Service Changed characteristic</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/10659/ios-disconnected-after-added-the-service-changed-characteristic</link><description>Hi Nordic gays guys, 
 After our 51822 firmware added the Service Changed characteristic.The Android OTA GATT_ERROR issue was solved.But there is a new problem in IOS.After updating the new firmware which added the Service Changed characteristic.When</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Fri, 13 Apr 2018 20:29:41 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/10659/ios-disconnected-after-added-the-service-changed-characteristic" /><item><title>RE: ios disconnected after added the Service Changed characteristic</title><link>https://devzone.nordicsemi.com/thread/128315?ContentTypeID=1</link><pubDate>Fri, 13 Apr 2018 20:29:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:0e0e3fe8-6605-4c3c-8d6c-6637496e04ea</guid><dc:creator>jsample</dc:creator><description>&lt;p&gt;I figured out what was causing this in my case.&amp;nbsp; I had the following code in my pm_event_handler in main.c:&lt;/p&gt;
&lt;div style="background-color:#eaeaea;color:#000000;font-family:&amp;#39;Courier New&amp;#39;;font-size:10.0pt;font-style:normal;font-weight:normal;text-decoration:none;"&gt;
&lt;pre&gt;&lt;span&gt;    &lt;/span&gt;&lt;span&gt;case&lt;/span&gt;&lt;span&gt; &lt;/span&gt;&lt;span&gt;PM_EVT_LOCAL_DB_CACHE_APPLIED&lt;/span&gt;&lt;span&gt;:&lt;/span&gt;
&lt;span&gt;      &lt;/span&gt;&lt;span&gt;// The local database has likely changed, send service changed indications.&lt;/span&gt;
&lt;span&gt;      &lt;/span&gt;&lt;span&gt;pm_local_database_has_changed&lt;/span&gt;&lt;span&gt;()&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;
&lt;span&gt;      &lt;/span&gt;&lt;span&gt;break&lt;/span&gt;&lt;span&gt;;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;This had been in my code since SDK11 - I&amp;#39;m not sure what example I originally pulled it from.&amp;nbsp; Removing it fixes the issue though.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ios disconnected after added the Service Changed characteristic</title><link>https://devzone.nordicsemi.com/thread/123147?ContentTypeID=1</link><pubDate>Tue, 06 Mar 2018 23:13:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a5901e64-b5cb-46ba-8197-41297a2595e0</guid><dc:creator>jsample</dc:creator><description>&lt;p&gt;Something else I discovered:&amp;nbsp; On my device I have the DIS service, BAS service and a custom service.&amp;nbsp; If I remove the BAS and custom service this problem does not occur.&amp;nbsp; I added back in just the BAS service and it occured again, but then I changed&amp;nbsp;&lt;span&gt;bas_init&lt;/span&gt;&lt;span&gt;.&lt;/span&gt;&lt;span&gt;support_notification from true to false and the problem went away.&amp;nbsp; Looking at the sniff the Service Change indication was never sent in this case, so it seems to be related to having other characteristics with client configuration descriptors.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ios disconnected after added the Service Changed characteristic</title><link>https://devzone.nordicsemi.com/thread/123146?ContentTypeID=1</link><pubDate>Tue, 06 Mar 2018 22:39:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1350dedc-2ec5-4b2e-9a18-1342b72a06c6</guid><dc:creator>jsample</dc:creator><description>&lt;p&gt;I&amp;#39;m seeing this issue as well with SDK 14.2 and S140-6.0.0-6.alpha.&amp;nbsp; When NRF_SDH_BLE_SERVICE_CHANGED is set to 0 I have no issues with iOS, but if I change it to a 1 then I see some strange behavior.&lt;/p&gt;
&lt;p&gt;With LightBlue I see the same thing Jay mentioned above, where it disconnects immediately after connecting.&amp;nbsp; With nRF Connect it will stay connected and show the list of services, but if you click on a service it won&amp;#39;t show any characteristics.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I did a sniff of the connection and found that one of the first things iOS does after connecting is enabling indications on the Service Changed characteristic (even though I haven&amp;#39;t bonded to my device) and then at some point towards the end of GATT discovery an indication is sent from the Service Changed characteristic with a handle range of 0x000E - 0xFFFF (even though I haven&amp;#39;t changed any services).&amp;nbsp; In the LightBlue case as soon as this indication is seen the iOS device disconnects.&lt;/p&gt;
&lt;p&gt;Why would the softdevice send a Service Changed indication in this case?&amp;nbsp; If the iOS device wasn&amp;#39;t bonded there should be no record of the iOS device to know if the services had changed since it last connected.&lt;/p&gt;
&lt;p&gt;Android doesn&amp;#39;t seem to ever enable indications on the Service Changed characteristic so this problem doesn&amp;#39;t show up on Android.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ios disconnected after added the Service Changed characteristic</title><link>https://devzone.nordicsemi.com/thread/39782?ContentTypeID=1</link><pubDate>Mon, 07 Dec 2015 09:57:43 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18298a29-170a-4605-98e1-bf8c3bf719af</guid><dc:creator>Anders Strand</dc:creator><description>&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I am no sure what is causing this. The most likely reason is that your iphone has stored the service information about your device. When it suddenly does not match what the iphone has stored, it can cause an error. You should delete your device from the device list of your iphone, and try again.&lt;/p&gt;
&lt;p&gt;It could also be that lightblue does not handle the &amp;quot;Service Changed&amp;quot; Characteristic very well.&lt;/p&gt;
&lt;p&gt;What is the &amp;quot;test APP&amp;quot;, is this your own custom app? If yes, you can use this app to see what is happening by printing error codes and events from your phone to a PC.&lt;/p&gt;
&lt;p&gt;Alternatively, you an use a BLE sniffer to catch the BLE transaction which leads to the disconnect.&lt;/p&gt;
&lt;p&gt;-Anders&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>