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

How to disable ANCS_C

Hi all, I have a problem in architecture of my application based on SD132v3 SDK12. It should interact with an iOS device as a peripheral and receive some data to display. Bonding is required for my task. Main goal is to allow multiple iOS devices to display their data on my device so I decided to use next simple way: certain previously bonded iOS device in range having some data to display tries to connect my device, writes to dedicated characteristic and then disconnects. So different users (iOS devices) can use my device because of real connected state is too short. But another task of my device is to display incoming calls of iOS device, so I want to use the ANCS_C module. In that case I have a problem that once the ANCS_C have successfully discovered presence of desired characteristics the connection will never be reset. It is OK in most cases (if user wants to see call notification he will be warned about unshared occupancy) but sometime I have to establish new connection (I have mechanical button “accept new bond”). So my questions are:

  1. Is there some better way to maintain both functionalities?

  2. Can I establish two connections: one for long time ANCS and another one for short sessions with multiple devices?

  3. Worst way. How to disable for a while current ANCS connection to accept new bonding peer?

Parents
  • FormerMember
    0 FormerMember

    1) By maintaining both functionalities, I assume you mean "being able to maintain the ANCS connection while connecting to a new device to add new bonding information". What you could test if works is the following: While maintaining the ANCS connection, you can connect to the other device as a central, and do the bonding process. At a later point in time, the two devices can re-connect with switched roles. (If choosing to test this, the following has to be set in peer manager when bonding for the first time: the 'enc' flag in kdist_own and kdist_peer should be set to 1.)

    2) Unfortunately, it's not possible to have two concurrent peripheral connections. If you want two concurrent connections, at least one of them has to be a central. Another option could be to test if it works to have the nRF52 ANCS module as a central instead of a peripheral.

    3) Disable ANCS connection means to disconnect. That can be done using sd_ble_gap_disconnect(..).

    Update 07.10.2016: It is not really a bug in iOS that it tries to re-connect, it is just that the iOS device will try to re-connect to a lost/disconnected connection with a bonded device (which is normal behavior). You can check if it changes anything if the nRF52 disables notifications before disconnecting from the iOS device. (I don't know if this last suggestion will change anything, but it's worth a try.)

    If you want to avoid that iOS automatically re-connects, your nRF52 can use another address when it re-starts to advertise. By doing so, the iOS device will not be able to recognize the nRF52. The nRF52 will then operate with two identities, two addressees. If you then have one device bonded with the nRF52 for one address, it will not be possible to use the same bonding information with that device if the nRF52 change the address. If you have multiple devices where some are bonded with one address and some are bonded with another address and you want them to be able to connect to your device, you will have to alternate which address you advertise with.

    The reason that the bonding will information with one device not work with when changing the address, is that the address type (default) is of the type " random static" and is not supposed to change.

  • Hi, Kristin. Thanks for your reply. I'm very interested in option 2. Can you please explain or point to information about starting ANCS as a central?

Reply Children
No Data
Related