This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

ANCS problem in SDK15.0 of disconnect by the reason of 0x13

Hi, nordic

      I get some problem when developing the ancs with SDK15.0.

I run the demo with  ble_app_ancs_c on the board of PCA10040.

First of all, after my iphoneX (system version 11.3.1) connected to the ble device, with bond,the ancs works well.

and then I turn off the ble of my phone and turn on to reconnect to the ble device.

After the reconnection, the ble device is disconnected about every 30 second which the disconnect reason is 0x13( REMOTE USER TERMINATED CONNECTION
).

This really confuse my deeply cause I have do nothing modify to the demo in the SDK .

can you help my to solve this problem?

Best regard!!!

Parents Reply Children
  • Thank you so much!

    My project is  blocking by this problem, although i have try what i can.

  • Hi,

    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.

    There are several possible ways to fix this issue:

    1. The simplest is to comment out the call to 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.
    2. Properly handle service changed indication, storing the database between connections. You can see how this is implemented in the GATT Service Client Example Application and use that as a reference if you want to implement this for ANCS.
  • Hello Mttrinh,

    I have the same problem but apparently is not solved by commenting out nrf_ble_gatts_c_init() in main.c. Every 30 seconds i receive a disconnect reasoned by a 0x13 (19 decimal). I have browsed through all the threads but couldn't find anything relevant, has there been any progress on this issue? I have not been able to sniff the RF yet due to my company firewall (apparently wireshark doesn't like it).. I will setup a laptop but I am pretty sure I will just see a disconnect event from IoS with no apparent reason. I am running the ANCS demo to which I added multimedia control, battery service and other proprietary UUIDS. All of them work well while the system is connected. 

    thank you. 

  • using SDK15.0, I also have the same problem but apparently is not solved by commenting out nrf_ble_gatts_c_init() in main.c. 

Related