Hello,
I have an iOS application communicating with a custom device having a nordic 8001 chip.
They have established a bonded relation. In nRFgo Studio, in Security section, I have "Security required" with "Just works".
When the device does not have a bond, I'm calling lib_aci_bond. The phone tries to open the characteristics and the operating system starts the bonding procedure. Everything works fine until the unpairing process.
If I forget the device from the phone, the iOS application tries to connect again to the device but when opening the characteristics it receives the CBATTErrorInsufficientEncryption error. The device receives a BOND_STATUS_CHANGED event with an error. This is also good.
The problem appears if I remove the bond from the device. The device starts the bonding procedure, but the phone (which still has the bond) goes in crazy mode. It starts connecting and disconnecting from the device and after 5 or 6 disconnects - connects it remains in connect state but without being able to comunicate or do anything with the device.
I opened the system logs on the phone and this is the only interesting thing:
Jul 16 16:47:38 BTServer[61] <Error>: ATT Failed to set MTU to 158 with result BM3 STATUS 14
Jul 16 16:47:38 BTServer[61] <Error>: Core Connection timed out to device "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
Jul 16 16:47:38 BTServer[61] <Error>: ATT Aborting command as device "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" is no longer connected
Basically, I can't determine if the bond on the device is lost. I can't even discover the services or open a characteristic. I got a disconnect immediately after I connect to the device.
This is a big problem for my project. I can't find a method to tell the user that the device has no lost his bond.
Why is this happening?
LE: I'm also using ANCS, I don't know if it is relevant.