isDisconnecting method

  1. @nonVirtual
Future<void> isDisconnecting()

Called when the device is lost for a while.

E.g. due to a temporary loss of Bluetooth connection. Pauses sampling on this device but marks it to be resumed (via restart) when the device is reconnected, and sets status to DeviceStatus.disconnected. Called automatically when status becomes DeviceStatus.disconnecting.

Implementation

@nonVirtual
Future<void> isDisconnecting() async {
  info('$runtimeType - Was disconnected from device of type: $typeName.');

  stop(shouldBeResumed: true);
  status = DeviceStatus.disconnected;
}