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.

The master opens the serial port after MasterChannel.enable() is called. If the port can't be opened, or fails later, the master reopens it after a fixed retry delay.

let settings = SerialSettings {
baud_rate,
data_bits: data_bits.into(),
stop_bits: stop_bits.into(),
parity: parity.into(),
flow_control: flow_control.into(),
};

let channel = spawn_master_serial(
get_master_channel_config(master_address)?,
port,
settings,
Duration::from_secs(1),
LogListener::create("port"),
);