0

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.

Raulp
  • 7,758
  • 20
  • 93
  • 155

1 Answers1

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