What is the proper way to finish BLE communication from an Android device with peripheral measuring device?
Current state:
- if I'm satisfied with received; write stop measuring on characteristic
- write power off request
- unsubscribe RxBleConnection
- close and disconnect BluetoothGatt
Problem with current solution is, that even if I disconnect and close GATT, It keeps the connection for another 30s on already off the device. (Next measuring cannot start immediately)
Update logs:
D/RxBle#ConnectionOperationQueue: QUEUED CharacteristicWriteOperation(222504075)
D/RxBle#ConnectionOperationQueue: STARTED CharacteristicWriteOperation(222504075)
I/RxBle#ConnectionOperationQueue: Connection operations queue to be terminated (80:EA:CA:00:00:10)
D/RxBle#ClientOperationQueue: QUEUED DisconnectOperation(90705849)
D/RxBle#ClientOperationQueue: STARTED DisconnectOperation(90705849)
D/BluetoothManager: getConnectionState()
D/BluetoothManager: getConnectedDevices
D/BluetoothGatt: cancelOpen() - device: 80:EA:CA:00:00:10
D/BluetoothGatt: onClientConnectionState() - status=0 clientIf=6 device=80:EA:CA:00:00:10
D/RxBle#BluetoothGatt: onConnectionStateChange newState=0 status=0
D/BluetoothGatt: setCharacteristicNotification() - uuid: 3f3e3d3c-3b3a-3938-3736-353433323130 enable: false
E/TestConnection: changeNotificationDisconnected from 80:EA:CA:00:00:10
D/RxBle#ConnectionOperationQueue: FINISHED CharacteristicWriteOperation(222504075)
D/RxBle#Executors$RunnableAdapter: Terminated.
D/BluetoothGatt: close()
D/BluetoothGatt: unregisterApp() - mClientIf=6
D/RxBle#ClientOperationQueue: FINISHED DisconnectOperation(90705849)