Skip to main content

AssociationHandler

The AssociationHandler interface handles all the per-association callbacks that are unrelated to measurement data. It contains a single method (get_current_time) to retrieve a UTC timestamp used to synchronize the time on the outstation.

Typically, you'd return the system time in get_current_time which is kept synchronized via NTP. However, you can use a different clock if desired. For example, you might want a data concentrator to receive time from an upstream DNP3 master while maintaining an offset from an internal clock. The examples below demonstrate how to implement an AssociationHandler that retrieves the system time.

#[derive(Copy, Clone)]
pub struct ExampleAssociationHandler;

impl AssociationHandler for ExampleAssociationHandler {}
note

Rust's 'AssociationHandler' trait has a default implementation of get_current_time that retrieves the system time.