Are you initiating the disconnection from the local host or the Android phone?When you say "When I try to disconnect from BLE in the apps," is that Android app or the app on your BLE device?
Are you using blecm_disconnect(BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST); to close the connection?
I'm initiating disconnection from the Android Phone.
It's the Android app in which I'm trying to disconnect from BLE device.
I didn't use blecm_disconnect(BT_ERROR_CODE_CONNECTION_TERMINATED_BY_LOCAL_HOST). The disconnect is initiated from Android apps, not BLE apps.
Which Android version are you using?
Are you using your own Android app?
Are you testing with multiple apps?
It seems like there is a native problem in Android about this issue.
This issue is for Android 5.1.1. (or earlier versions I guess)
I have seen this behavior when I was testing with Nexus 9 with Android 5.1.1.
I'm not sure if they fixed this issue with later versions of Android.
You might want to test it with the latest Android version.
Few workarounds might be:
1. disconnect from the peripheral (perhaps using con_idle_timeout; so if there is no activities for certain time, disconnect)
2. remove the bond from Android (not sure if this might work; I haven't tested. but it's a hunch)
Please let us know if you have any updates.
p.s. this behavior is not observed in iOS.
Sorry for this late response, your email was put in scam of my gmail.
I tried 3 phones.
Moto G 1st gen, Android 5.1
Nexus 6P, Android 6.0
Xiaomi Redmi, Customized Android 5.0.2 LRX22G
Our own apps, still under development
nRF Master Control Panel Version 4.0.5
I tested our BLE device with iPad air, iOS 9.2.1, lightblue explorer. It work well as you said.
I tried your 1st workaround, disconnect from the peripheral using con_idle_timeout; It worked.
The 2nd workaround. Android phone need to delete bond info to disconnect from BLE device. The next time to connect to BLE device, Android phone still need pair and input passkey. It's inconvenient to input passkey during every connect. We won't go through this approach.