Skip to content

Commit

Permalink
Add SerialPortReader::port for convenience
Browse files Browse the repository at this point in the history
  • Loading branch information
jpnurmi committed Sep 26, 2020
1 parent 2bb77a0 commit b382f6f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/src/reader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,9 @@ abstract class SerialPortReader {
factory SerialPortReader(SerialPort port, {int timeout}) =>
_SerialPortReaderImpl(port, timeout: timeout);

/// Gets the port the reader operates on.
SerialPort get port;

/// Gets a stream of data.
Stream<Uint8List> get stream;

Expand All @@ -72,6 +75,9 @@ class _SerialPortReaderImpl implements SerialPortReader {
: _port = port,
_timeout = timeout ?? 500;

@override
SerialPort get port => _port;

@override
Stream<Uint8List> get stream {
_controller ??= StreamController<Uint8List>(
Expand Down

0 comments on commit b382f6f

Please sign in to comment.