MasterChannelConfig

The MasterChannelConfig struct contains generic settings common to all communication channels:

  • Address of the master station (different addresses may be used for different channels)
  • Initial decoding level
  • Timeout for responses from the outstation(s)
  • Transmit and receive buffer sizes

The constructor takes the master address and has reasonable defaults for all of the other settings. The default response timeout of 5 seconds may need to need to be increased for high-latency communication links. The default buffer sizes of 2048 bytes should only need to be adjusted if an outstation has a non-standard configuration.

fn get_master_channel_config() -> Result<MasterChannelConfig, Box<dyn std::error::Error>> {
let mut config = MasterChannelConfig::new(EndpointAddress::from(1)?);
config.decode_level = AppDecodeLevel::ObjectValues.into();
Ok(config)
}