MasterChannelConfig
The MasterChannelConfig
struct contains the following generic settings that are common to all communication channels:
- Master station address (different addresses may be used for different channels)
- Initial decoding level
- Timeout for responses from each outstation
- Transmit and receive buffer sizes
The constructor takes the master address and has reasonable defaults for all other settings. The default response timeout is 5 seconds; you may need to increase it for high-latency communication links. You should only need to adjust the default buffer size of 2,048 bytes if an outstation has a non-standard configuration.
- Rust
- C
- Java
- C#
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)
}
dnp3_master_channel_config_t get_master_channel_config()
{
dnp3_master_channel_config_t config = dnp3_master_channel_config_init(1);
config.decode_level.application = DNP3_APP_DECODE_LEVEL_OBJECT_VALUES;
return config;
}
private static MasterChannelConfig getMasterChannelConfig() {
MasterChannelConfig config = new MasterChannelConfig(ushort(1));
config.decodeLevel.application = AppDecodeLevel.OBJECT_VALUES;
return config;
}
private static MasterChannelConfig GetMasterChannelConfig()
{
var config = new MasterChannelConfig(1);
config.DecodeLevel.Application = AppDecodeLevel.ObjectValues;
return config;
}