sensorEvents property

Stream<SensorEvent> sensorEvents

Get the stream of sensor events.

Use the setSamplingRate method to set the sampling rate.

Throws an ESenseException if not connected to an eSense device. Wait until connected before using this stream.


static Stream<SensorEvent> get sensorEvents {
  if (!connected) throw ESenseException('Not connected to any eSense device.');
  if (_sensorEventStream == null) {
    _sensorEventStream =
        _eSenseSensorEventChannel.receiveBroadcastStream().map((event) => SensorEvent.fromMap(event));
  return _sensorEventStream;