eSenseEvents property

Stream<ESenseEvent> eSenseEvents

Get the stream of events from the eSense device, once connected.

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

Implementation

Stream<ESenseEvent> get eSenseEvents {
  if (!connected)
    throw ESenseException('Not connected to any eSense device.');
  if (_eventStream == null) {
    _eventStream = _eSenseEventChannel
        .receiveBroadcastStream()
        .map((event) => ESenseEvent.fromMap(event));
  }
  return _eventStream!;
}