SerialPortConfig class Null safety

Serial port config.

You should always configure all settings before using a port. There are no default settings applied by the library. When you open a port, it may have default settings from the OS or driver, or the settings left over by the last program to use it.

You should always set baud rate, data bits, parity and stop bits.

You should normally also set one of the preset flow control modes, which will set up the RTS, CTS, DTR and DSR pin behaviours and enable or disable XON/XOFF.

If you need an unusual configuration not covered by the preset flow control modes, you will need to configure these settings individually, and avoid setting flow control which will overwrite these settings.

@note A port must be opened before you can change its settings.

Use getters and setters like baudRate to get and set individual settings from a configuration.

For each setting in a port configuration, a special value of -1 can be used, which will cause that setting to be left alone when the configuration is applied by SerialPort.config setter.

This value is also be used for any settings which are not configured at the OS level, or in a state that is not representable within the library API.

Configurations must be disposed using dispose(). When a new configuration is created, all of its settings are initially set to the special -1 value.

See also:

Constructors

SerialPortConfig()
Creates a serial port configuration.
factory
SerialPortConfig.fromAddress(int address)
@internal
factory

Properties

address int
@internal
read-only
baudRate int
Gets the baud rate from the port configuration.
read / write
bits int
Gets the data bits from the port configuration.
read / write
cts int
Gets the CTS pin behaviour from the port configuration.
read / write
dsr int
Gets the DSR pin behaviour from the port configuration.
read / write
dtr int
Gets the DTR pin behaviour from the port configuration.
read / write
hashCode int
The hash code for this object.
read-onlyinherited
parity int
Gets the parity setting from the port configuration.
read / write
rts int
Gets the RTS pin behaviour from the port configuration.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-onlyinherited
stopBits int
Gets the stop bits from the port configuration.
read / write
xonXoff int
Gets the XON/XOFF configuration from the port configuration.
read / write

Methods

dispose() → void
Releases all resources associated with the serial port config.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
setFlowControl(int value) → void
Sets the flow control type in the port configuration.
toString() String
A string representation of this object.
inherited

Operators

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