Skip to main content

Serial

Use the MasterChannel::createSerialChannel method to create a channel bound to a serial port. It requires the same serial port configuration parameters as the outstation serial port API.

Unlike the outstation API, the master API opens the serial port API lazily after MasterChannel.enable() is called. It will try to open the port if the operation fails.

note

The LinkErrorMode is internally set to Discard for serial communication channels.

let channel = spawn_master_serial(
get_master_channel_config()?,
"/dev/ttySIM0", // change this for your system
SerialSettings::default(),
Duration::from_secs(1),
NullListener::create(),
);