I want to detect the device shutdown when the app is already connected. At the moment I dont see an approch to do this on android.
I listen to observeConnectionState, but this stream is not emiting anything on device disconnect.
_bleDeviceConnectionStateSubscription = peripheral
.observeConnectionState(
emitCurrentValue: false, completeOnDisconnect: true)
.listen((connectionState) {
print(
"Peripheral ${device.peripheral.identifier} connection state is $connectionState");
_bleDeviceConnectionStateSubject.add(connectionState);
});
I also tired calling isConnected method, however even when device is shutdown it returns true.
var connection = await _bleDevice.peripheral.isConnected();
Is there a way to monitor device side disconnection and show a message to the user.
I want to detect the device shutdown when the app is already connected. At the moment I dont see an approch to do this on android.
I also tired calling isConnected method, however even when device is shutdown it returns true.
var connection = await _bleDevice.peripheral.isConnected();
Is there a way to monitor device side disconnection and show a message to the user.