SerialPortReader class abstract
Asynchronous serial port reader.
Provides a stream that can be listened to asynchronously to receive data whenever available.
The stream will attempt to open a given port for reading. If the stream fails to open the port, it will emit SerialPortError. If the port is successfully opened, the stream will begin emitting Uint8List data events.
Note: The reader must be closed using close() when done with reading.
Constructors
- SerialPortReader.new(SerialPort port, {int? timeout})
-
Creates a reader for the port. Optional
timeout
parameter can be provided to specify a time im milliseconds between attempts to read after a failure to open theport
for reading. If not given,timeout
defaults to 500ms.factory
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- port → SerialPort
-
Gets the port the reader operates on.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stream
→ Stream<
Uint8List> -
Gets a stream of data.
no setter
Methods
-
close(
) → void - Closes the stream.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited