stream property

  1. @override
Stream<Measurement>? get stream
override

The stream of Measurement objects for this StreamProbe. Must be implemented by sub-classes.

Implementation

@override
Stream<Measurement>? get stream {
  _stream ??= (deviceManager.isConnected)
      ? deviceManager.manager!.sensorEvents
          .map((event) => Measurement.fromData(
                ESenseSensor.fromSensorEvent(
                  deviceName: deviceManager.manager!.deviceName,
                  event: event,
                ),
                event.timestamp.microsecondsSinceEpoch,
              ))
          .asBroadcastStream()
      : null;

  return _stream;
}