stop method

Future<void> stop()

Stops a signal acquisition.

Parameters

void

Returns

void

Exceptions

DEVICE_NOT_IDLE : if the device is not in acquisition mode.

Implementation

Future<void> stop() async {
  if (_numChs == 0) SenseException(SenseErrorType.DEVICE_NOT_IN_ACQUISITION);

  // 0  0  0  0  0  0  0  0 - Go to idle mode
  final cmd = 0x00;
  await _send(cmd);

  _numChs = 0;
  _sampleRate = 0;
  acquiring = false;

  // Cleanup existing data in bluetooth buffer
  _clear();
}