listenToConnectionState method
Listens to the connection state of the BLE device with the given deviceId
.
deviceId
- The identifier of the target device.
Returns a stream of BleDeviceConnectionState indicating the connection state.
Implementation
Stream<BleDeviceConnectionState> listenToConnectionState(String deviceId) {
try {
return _bleConnectivityHandler.listenToConnectionState(deviceId);
} catch (e) {
_appLogger.error("Error listening to connection state: $e");
rethrow;
}
}