stopFetchMeasurement method
Future<VtjCommandResult<StopFetchMeasurementResult> >
stopFetchMeasurement(
- BluetoothDevice device
override
Stop sending measurement data (started with fetchMeasurement). See BLE Interface Specification Section 7.13
Implementation
@override
Future<VtjCommandResult<StopFetchMeasurementResult>> stopFetchMeasurement(
BluetoothDevice device,
) async {
// Cancel the download subscription
final deviceId = device.remoteId.str;
await _downloadSubscriptions[deviceId]?.cancel();
_downloadSubscriptions.remove(deviceId);
// Reset fetch state
_fetchRegistry.getManager(device).reset();
return _executeCommand<StopFetchMeasurementResult>(
device: device,
createCommand: () => StopFetchMeasurementCommand(),
);
}