I am testing my BLE Android App on different Phones ranging from Android 5.0 to 7.1. I am seeing that even though the Disconnection event occur the next BLE connection takes time with intermittent inability to reconnect. Is the Android disconnection actually taking place while invoking the disconnection.How to make it disconnect clean? As a workaround I am waiting for some time after disconnection to reconnect again. My app requires to frequently connect after disconnect but due to previous un-clean disconnect my subsequent connect doesnt works properly. I even try .close after .disconnect but no difference.
Asked
Active
Viewed 844 times
0
-
What do you mean by `clean disconnect`? Do you use `RxAndroidBle` library as your tag suggest? – Dariusz Seweryn Jul 25 '17 at 09:24
-
No I don't use this library , I am using Android APIs only.I removed the RxAndroidBle Tag. – Raulp Jul 26 '17 at 04:41
-
Is the time in which you are not able to connect about 20 seconds long? – Dariusz Seweryn Jul 26 '17 at 06:10
1 Answers
0
Is the Android disconnection actually taking place while invoking the disconnection?
Calling BluetoothGatt.disconnect()
only starts the process of disconnection. To be sure when it will actually happen you need to track BluetoothGattCallback.onConnectionStateChanged()
.

Dariusz Seweryn
- 3,212
- 2
- 14
- 21
-
Disconnect does not clean connection even after 20 seconds of successfully terminating the connection. Anyone found a way to clean the connection completely? – user869123 Jun 04 '18 at 07:36
-