<?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>ANCS can&amp;#39;t receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/34466/ancs-can-t-receive-the-event-when-add-cts-service-to-project</link><description>Can anyone help me? 
 
 
 
 Each service is working standalone. 
 
 
 
 
 There are two cases: 
 1.the BLE can&amp;#39;t connect auto by iphone. 
 2.firmware can&amp;#39;t receive notify event. 
 
 
 
 
 
 
 static void services_init(void) { usr_ancs_services_init();</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 16 Jul 2018 11:53:50 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/34466/ancs-can-t-receive-the-event-when-add-cts-service-to-project" /><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/140193?ContentTypeID=1</link><pubDate>Mon, 16 Jul 2018 11:53:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f6c41ae1-72b0-4ed1-b79a-59b84bc11a73</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you set&amp;nbsp;allow_repairing = False, the device will throw&amp;nbsp;PM_EVT_CONN_SEC_FAILED if the phone lose bond information.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Set it to true, will allow repairing, but you have&amp;nbsp; the risk of attacker can spoof that it has lost bond information and re-pair to you.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Are you sure&amp;nbsp;pm_peers_delete() throwing&amp;nbsp;NRF_ERROR_CONN_COUNT ? Could you step into the code and check which function threw that and why ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/140177?ContentTypeID=1</link><pubDate>Mon, 16 Jul 2018 09:10:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f53a8b01-3d37-41fc-a0dc-6b6824ac1392</guid><dc:creator>Zhangjd</dc:creator><description>&lt;p&gt;thank you for your help. now I facing other question, if I &amp;quot;forget this device &amp;quot; on iphone then connect the buletooth , I get a&amp;nbsp;PM_EVT_CONN_SEC_FAILED error. so I call to&amp;nbsp;pm_peers_delete() then I get another error&amp;nbsp;NRF_ERROR_CONN_COUNT,&amp;nbsp; can you give me some suggestion?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/140092?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 15:39:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5c936da1-d3bb-4fc3-9036-accc95db78fd</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It was a known issue. Please follow this answer from my colleague:&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;It has taken some time to dig into this.&amp;nbsp;The relevant change between SDK 14.2.0 and 15.0.0 is that the ANCS example now subscribes to the service changed characteristic (and perform a service discovery when there is an indication on it). However, the example does not store the GATT database so that it can be reused between connections. Therefor the example also does a service discovery upon every reconnect. This is not the intended use of the service changed characteristic, and it seems that iOS will disconnect in this case, where the peer subscribes to the service changed characteristic but still does service discovery without an indication.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;There are several possible ways to fix this issue:&lt;/em&gt;&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;em&gt;The simplest is to comment out the call to&amp;nbsp;nrf_ble_gatts_c_init() in main.c of the ANCS example. This will give it the same behavior as in SDK 14.2, where service changed is not subscribed to.&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;&lt;em&gt;Properly handle service changed indication, storing the database between connections. You can see how this is implemented in the&amp;nbsp;&lt;a href="http://infocenter.nordicsemi.com/topic/com.nordic.infocenter.sdk5.v15.0.0/ble_sdk_app_gatts_c.html?cp=4_0_0_4_1_2_10"&gt;GATT Service Client Example Application&lt;/a&gt;&amp;nbsp;and use that as a reference if you want to implement this for ANCS.&lt;/em&gt;&lt;/li&gt;
&lt;/ol&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/140003?ContentTypeID=1</link><pubDate>Fri, 13 Jul 2018 06:45:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:66fa538f-6235-495e-b464-c585f32002ac</guid><dc:creator>Zhangjd</dc:creator><description>&lt;p&gt;HI,&amp;nbsp;I&amp;nbsp;find a new bug on your project. when I connect the iphone and the ancs and cts was found, the connection will be break per 30s. I can&amp;#39;t fix the bug, can you help me?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/135334?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 10:16:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd996580-7fd3-438c-b0c7-eabbf089252b</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Zhang,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The nrf_ble_gatts_c module added to handle gatt service and service changed characteristic. It handles the change in the attribute table of the peer device (the phone) . I&amp;#39;m not sure if it make the difference between your application and my application.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can try to turn it off in my code to check if the application still works. I would suggest you to move to SDK v15 for your development.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/135277?ContentTypeID=1</link><pubDate>Fri, 08 Jun 2018 03:10:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:bd8a2aa0-ed4b-486a-aa5d-69579f568e05</guid><dc:creator>Zhangjd</dc:creator><description>&lt;p&gt;thank you, your project is OK, so i compare your code with me, I find you use the&amp;nbsp;nrf_ble_gatts_c module. i don&amp;#39;t clear why you add this, and i cann&amp;#39;t add the module in my code because my project is base sdk 14.20, the module is different.&amp;nbsp;&lt;img src="https://devzone.nordicsemi.com/resized-image/__size/320x240/__key/communityserver-discussions-components-files/4/pastedimage1528427269210v1.png" alt=" " /&gt;this is your code but put it to my project is error, because the sdk 14.20 can&amp;#39;t find the &amp;quot;srv_changed_char&amp;quot;, &amp;nbsp;do you have some suggest for me ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/134025?ContentTypeID=1</link><pubDate>Wed, 30 May 2018 12:18:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8def15ac-c1b2-4656-9130-28f382a88b0f</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Zhang,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Please try this example that I combined the 2 service. Let me know if you see any problem.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;It&amp;#39;s for SDK v15, nRF52832 , Keil v5.&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-cf75138d2aca4f8faa67204b3e462ee5/ble_5F00_app_5F00_ancs_5F00_c_5F00_cts_5F00_c.zip"&gt;devzone.nordicsemi.com/.../ble_5F00_app_5F00_ancs_5F00_c_5F00_cts_5F00_c.zip&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/133320?ContentTypeID=1</link><pubDate>Fri, 25 May 2018 01:27:16 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b9f87dab-0a3b-44b4-89f0-7e18943516e1</guid><dc:creator>Zhangjd</dc:creator><description>&lt;p&gt;I have tested the ANCS is fine, it can autoconnect. and have a notify when the iphone get a message. but it can&amp;#39;t work if I add the CTS service to the ANCS project. I don&amp;#39;t known the issue is where.&amp;nbsp;I&amp;#39;ve read the code many times. i can&amp;#39;t find the issue.Can you give me some new &lt;span&gt;suggest &lt;/span&gt;?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/133239?ContentTypeID=1</link><pubDate>Thu, 24 May 2018 12:23:41 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c7890e06-1dc2-409d-b461-a26efe82bd05</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Yes, the phone has the CTS server but you still need the CTS client on the nRF52.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure what caused the non-autoconnect. Please try to fix issue number 2 first. Regarding issue number 1, make sure when you advertise you advertise as ANCS device not CTS.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/133118?ContentTypeID=1</link><pubDate>Thu, 24 May 2018 01:19:25 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7bf536ba-706c-4241-97a5-0804a56146c0</guid><dc:creator>Zhangjd</dc:creator><description>&lt;p&gt;NO, the iOS system have the CTS service. so I don&amp;#39;t have to do implement CTS Client. And I find others developer have same problem on Nordic DevZone.They haven&amp;#39;t solved the problem yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/133070?ContentTypeID=1</link><pubDate>Wed, 23 May 2018 15:49:10 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ad85b83f-ffc1-4caa-87f8-5914abafeb30</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Unfortunately, it&amp;#39;s a pretty busy period we have now we can&amp;#39;t provide you the example at the moment.&lt;/p&gt;
&lt;p&gt;What I would suggest you is to start again with the ANCS and try to add CTS in and let us know what goes wrong. I assume you want to implement CTS client ?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/132915?ContentTypeID=1</link><pubDate>Wed, 23 May 2018 08:22:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:15540716-5ca7-4d32-85ef-8d3c9abb2d2f</guid><dc:creator>Zhangjd</dc:creator><description>&lt;p&gt;thank you. i test the CTS with my iphone. it&amp;#39;s fine when only the CTS or ANCS service. but it&amp;#39;s error when ANCS and CTS is together. I have read the code some times i can&amp;#39;t find the bug. so its like the softdevice problem. can you give me a demo project for ANCS and CTS is together. the sdk version is 14.20. softdevice is S132.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: ANCS can't receive the event when add CTS service to project.</title><link>https://devzone.nordicsemi.com/thread/132899?ContentTypeID=1</link><pubDate>Wed, 23 May 2018 07:58:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f4c18c4-9b62-411a-8ed3-adc1ffa58df8</guid><dc:creator>Hung Bui</dc:creator><description>&lt;p&gt;Hi Zhang,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You would need to provide us more information on:&lt;/p&gt;
&lt;p&gt;- How you tested, have you made sure you erase bond and turn on and off iPhone Bluetooth before you tested (to clear any ATT table cache on the phone) , also make sure you enable service changed characteristic so that the phone would do service discovery when connected.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;- Have you tried to use nRFConnect to connect and verify the attribute table is correct (with CTS service)&lt;/p&gt;
&lt;p&gt;- Let us know the SDK version, softdevice version. What exactly you do to add CTS into ANCS example ?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>