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
- Transmit and receive buffer sizes
note
The timeout for responses is configured for each association individually. This is useful if the outstation is a gateway services with varying latency.
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
- C++
- Java
- C#
fn get_master_channel_config() -> Result<MasterChannelConfig, Box<dyn std::error::Error>> {
let mut config = MasterChannelConfig::new(EndpointAddress::try_new(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;
}
dnp3::MasterChannelConfig config(1);
config.decode_level.application = dnp3::AppDecodeLevel::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()
{
return new MasterChannelConfig(1)
.WithDecodeLevel(DecodeLevel.Nothing().WithApplication(AppDecodeLevel.ObjectValues));
}