ArtemisSerialPort class

Implemented types

Constructors

ArtemisSerialPort(String name, {ProtocolMode protocolMode = ProtocolMode.none, SerialDeviceConfig? serialDeviceConfig, FrameParser? parser})

Properties

address int
@internal
no setteroverride
busNumber int?
Gets the USB bus number of a USB serial adapter port.
no setteroverride
bytesAvailable int
Gets the amount of bytes available for reading.
no setteroverride
bytesToWrite int
Gets the amount of bytes waiting to be written.
no setteroverride
config SerialPortConfig
Gets the current configuration of the serial port.
getter/setter pairoverride
description String?
Gets the description of the port, for presenting to end users.
no setteroverride
deviceNumber int?
Gets the USB device number of a USB serial adapter port.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
isOpen bool
Gets whether the serial port is open.
no setteroverride
macAddress String?
Gets the MAC address of a Bluetooth serial adapter port.
no setteroverride
manufacturer String?
Get the USB manufacturer of a USB serial adapter port.
no setteroverride
name String?
Gets the name of the port.
no setteroverride
onData Stream<DataReceive>
no setter
productId int?
Gets the USB Product ID of a USB serial adapter port.
no setteroverride
productName String?
Gets the USB product name of a USB serial adapter port.
no setteroverride
protocolMode ProtocolMode
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
serialDeviceConfig SerialDeviceConfig?
getter/setter pair
serialNumber String?
Gets the USB serial number of a USB serial adapter port.
no setteroverride
signals int
Gets the status of the control signals for the serial port.
no setteroverride
transport int
Gets the transport type used by the port.
no setteroverride
vendorId int?
Gets the USB vendor ID of a USB serial adapter port.
no setteroverride

Methods

close() bool
Closes the serial port.
override
dispose() → void
Releases all resources associated with the serial port.
override
drain() → void
Waits for buffered data to be transmitted.
override
endBreak() bool
Takes the port transmit line out of the break state.
override
flush([int buffers = SerialPortBuffer.both]) → void
Flushes serial port buffers. Data in the selected buffer(s) is discarded.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
open({required int mode}) bool
Opens the serial port in the specified mode.
override
openRead() bool
Opens the serial port for reading only.
override
openReadWrite() bool
Opens the serial port for reading and writing.
override
openReadWriteSafe() Future<bool>
openWrite() bool
Opens the serial port for writing only.
override
printData(String data) Future<PrintResult>
read(int bytes, {int timeout = -1}) Uint8List
Read data from the serial port.
override
sendAndRead({required List<int> request, Duration timeout = const Duration(seconds: 1), Duration quietWindow = const Duration(milliseconds: 150)}) Future<Uint8List>
Send bytes and collect response until quiet or timeout.
setConfig(ArtemisPortPrintSetting config) ArtemisSerialPort
startBreak() bool
Puts the port transmit line into the break state.
override
startListening() → void
stopListening() Future<void>
toString() String
A string representation of this object.
inherited
write(Uint8List bytes, {int timeout = -1}) int
Write data to the serial port.
override
writeAll(List<int> data, {int timeoutMs = -1}) Future<bool>

Operators

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