<?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>How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/7028/how-to-detect-service-change-of-ancs-gatt-server</link><description>Hi, 
 I would like to know how to detect the service change of the ANCS gatt server. 
 Thank you!
Joseph</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Wed, 20 May 2015 07:55:37 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/7028/how-to-detect-service-change-of-ancs-gatt-server" /><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24815?ContentTypeID=1</link><pubDate>Wed, 20 May 2015 07:55:37 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:120927ed-13a0-4507-a2f7-3756fb7448d0</guid><dc:creator>Joseph</dc:creator><description>&lt;p&gt;Noted with thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24814?ContentTypeID=1</link><pubDate>Wed, 20 May 2015 07:43:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:eb755863-aafc-491f-bbe5-69939e2a5b2d</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Joseph: There could be some diference in the API but the principle should be the same. I think you should be able to use the library with some minor modification.&lt;/p&gt;
&lt;p&gt;You can also have a look at ble_app_alert_notification example in SDK  v5.1.0, the ble_ans_c.c library handles the service discovery and enables CCCD.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24808?ContentTypeID=1</link><pubDate>Tue, 19 May 2015 08:14:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9d08f35a-a073-4fe2-9fc1-cac60a15d298</guid><dc:creator>Joseph</dc:creator><description>&lt;p&gt;Hello Hung, unfortunately, my work is based on SDK 5.1.0 and s310 v1.0.0, can I use the ble_db_discovery.c library by direct copying from newer SDK? And which SDK I should use? Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24807?ContentTypeID=1</link><pubDate>Tue, 19 May 2015 07:54:32 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:27393921-0f30-45f2-87d4-20376d8a5408</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Joseph: You are correct, service discovery process starts by calling sd_ble_gattc_primary_services_discover(), you will have BLE_GATTC_EVT_PRIM_SRVC_DISC_RSP event call back. You can use the ble_db_discovery.c library which handle the service discovery for you.
You can have a look at the ble_app_hrs_c example for S120 (ble_central) where we do service discovery then enable CCCD for battery and hrs services.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24813?ContentTypeID=1</link><pubDate>Mon, 18 May 2015 03:10:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7ca7c046-038e-45ab-8ca7-4f4efe88fa03</guid><dc:creator>Joseph</dc:creator><description>&lt;p&gt;Hello Hung, thank you for your suggestions.
If we want to subscribe to the service changed indication, the first step is to use the function sd_ble_gattc_primary_services_discover() to search for the Generic Attribute (0x1801), is that correct? Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24812?ContentTypeID=1</link><pubDate>Fri, 15 May 2015 09:17:35 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:78a9b321-4ca6-4698-9d11-1870be0b2e88</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Joseph: I&amp;#39;m sorry for misleading you. The spec tells the NC &amp;quot;should&amp;quot; not &amp;quot;shall&amp;quot; so it&amp;#39;s optional. I edited my answer.&lt;/p&gt;
&lt;p&gt;In our example, unfortunatelly, we don&amp;#39;t subsrcribe to service changed indication but to a service discovery every time we get connected. If we don&amp;#39;t see the ANCS service we will disconnect.&lt;/p&gt;
&lt;p&gt;I guess this something you would need to implement on your own, to enable service change CCCD, and wait for the indication event to do either a disconnect and reconnect, or another service discovery.
Another option is to add a timer and do service discovery to look for ANCS to be available for several time, and disconnect after a timeout.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24811?ContentTypeID=1</link><pubDate>Thu, 14 May 2015 08:22:49 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:625ce43f-a8b0-4c9b-a31f-d3a15de90d89</guid><dc:creator>Joseph</dc:creator><description>&lt;p&gt;Hello Hung, I downloaded the ble_app_ancs project (SDK v8.1.0), I search through the 2 files main.c &amp;amp; ble_ancs_c.c with the matching word &amp;quot;change&amp;quot;, but I cannot find anything related to service change of the gatt server, could you give me some hints? Thanks!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24810?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 12:26:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c72313b7-334d-44b4-9492-7083b20bbe4e</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Joseph: There is ble_app_ancs project in the &lt;a href="https://developer.nordicsemi.com/nRF51_SDK/nRF51_SDK_v8.x.x/"&gt;nRF51SDK v8.1.0&lt;/a&gt; that you can have a look at.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24809?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 12:03:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:82ac78fa-d731-455b-a2a3-77f37e0ca600</guid><dc:creator>Joseph</dc:creator><description>&lt;p&gt;Thank you for your reply!
Is there a sample project that I could look at for reference?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: How to detect service change of ANCS gatt server</title><link>https://devzone.nordicsemi.com/thread/24806?ContentTypeID=1</link><pubDate>Wed, 13 May 2015 11:33:31 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ecd4eb20-3a70-432d-8bf7-96a5ff3e73aa</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;@Joseph: According to the &lt;a href="https://developer.apple.com/library/ios/documentation/CoreBluetooth/Reference/AppleNotificationCenterServiceSpecification/Specification/Specification.html#//apple_ref/doc/uid/TP40013460-CH1-SW7"&gt;spec of ANCS&lt;/a&gt;
&lt;em&gt;&amp;quot; the NC (notification consumer) should look for and subscribe to the Service Changed characteristic of the GATT service in order to monitor for the potential publishing and unpublishing of the ANCS at any time.&amp;quot;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;What it means is the client  &lt;strong&gt;should&lt;/strong&gt; enable indication on the service changed characteristic. And it will receive an indication (BLE_GATTC_EVT_HVX event) when there&amp;#39;s a service change.&lt;/p&gt;
&lt;p&gt;[EDIT] changed from &amp;quot;need to&amp;quot; to &amp;quot;should&amp;quot;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>