LibserialportSerialTransport class

Implemented types

Constructors

LibserialportSerialTransport({DynamicLibrary? library, String? libraryPath, Duration pollInterval = const Duration(milliseconds: 5), int readBufferSize = 1024})
LibserialportSerialTransport.withBindings(LibserialportBindings _bindings, {Duration pollInterval = const Duration(milliseconds: 5), int readBufferSize = 1024})
Construct from an already-instantiated bindings instance — useful for tests that mock the FFI surface.

Properties

hashCode → int
The hash code for this object.
no setterinherited
incoming → Stream<Uint8List>
Stream of incoming byte chunks. Each event is a chunk exactly as received from the OS read buffer (no re-chunking).
no setteroverride
isOpen → bool
no setter
pollInterval → Duration
final
readBufferSize → int
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
Close the port.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open(String portName, SerialConfig config) → Future<void>
Opens the underlying port using config. Idempotent.
override
readModemStatus() → Future<ModemStatus>
Read the current state of the four DCE→DTE modem-status lines. Production transports query the underlying driver (sp_get_signals for libserialport, GetCommModemStatus for Windows). The default throws so existing custom transports keep compiling; override to expose this capability.
override
sendBreak({Duration duration = const Duration(milliseconds: 250)}) → Future<void>
Send a BREAK condition for duration.
override
setDtr(bool active) → Future<void>
Drive the DTR (Data Terminal Ready) modem control line. Default implementation throws — production transports override.
override
setRts(bool active) → Future<void>
Drive the RTS (Request To Send) modem control line.
override
toString() → String
A string representation of this object.
inherited
write(List<int> bytes) → Future<void>
Transmit a raw byte sequence.
override

Operators

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