stop method
Stops sampling the measures using this device.
Pauses all executors. Used, e.g., when the device is disconnected.
If shouldBeResumed is true, the executors are paused but marked to be
resumed later when the device is reconnected.
This is useful when the device is temporarily disconnected, e.g., due to
a temporary loss of Bluetooth connection, and we want to automatically resume
sampling when the device is reconnected.
Implementation
@nonVirtual
void stop({bool shouldBeResumed = false}) {
debug('$runtimeType - Stopping sampling - shouldResumeLater: $shouldBeResumed ...');
for (var executor in executors) {
executor.state == ExecutorState.Resumed && shouldBeResumed
? executor.pauseButShouldBeResumed()
: executor.pause();
}
}