- After doing disconnecte ble device i am getting disconnect callback . but some time still it is not disconnected . in some layer connection state is maintaining . so that i am not able to do reconnect.
i have tested in android 5 & android 6. in HTC One A9, Moto x play, Moto G4
- If i do bluetooth turn on off. then again disconnect callback is coming and device is disconnecting actually. -Please give some suggestion for resolve issue.
- I am doing below steps for ble operation
- 1.Discover ble device.
- Connect to device.
- onConnectionStateChange (connected) i am doing gatt.discoverServices()
- onServicesDiscovered callback i am reading characteristics 5.onCharacteristicRead callback i am doing write characteristics. 6.onCharacteristicWrite call back i am doing gatt.disconnect()
- onConnectionStateChange (disconnected) i am doing gatt.close()
In this full process in background device scanning is going on.