SerialPortHandle class

A handle for an opened serial port.

Implemented types

Properties

baudrate Baudrate
The currently configured baudrate (speed) of the serial port.
getter/setter pair
byteStream Stream<int>
stream, but in bytes rather than byte lists.
final
encoding Encoding
The encoding used for converting strings into bytes and vice-versa. Used in write, writeAll, writeCharCode, writeln, read, readStringWithNumBytes, readln and getNewSequentialReader.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
stream Stream<List<int>>
The stream of byte lists being received from the port, as a broadcast stream.
final

Methods

close({bool immediate = false}) Future<void>
Close the serial port. This synchronously closes the handle. The returned future completes after the complete cleanup is done.
getNewSequentialReader() → StringReader
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read({int? length, int? numBytes}) Future<String>
Reads a string that has length number of characters. Read numBytes bytes and convert it into a string.
readBytes(int numBytes) Future<List<int>>
readln([String linebreak = '\n']) Future<String>
toString() String
A string representation of this object.
inherited
write(Object? obj) Future<void>
Writes the string representation of object.
override
writeAll(Iterable objects, [String separator = ""]) Future<void>
Writes the elements of objects separated by separator.
override
writeBytes(Iterable<int> bytes) Future<void>
writeCharCode(int charCode) Future<void>
Writes a string containing the character with code point charCode.
override
writeln([Object? obj = "", String linebreak = "\n"]) Future<void>
Writes the string representation of object followed by a newline.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited