AssociationHandler

The AssociationHandler interface handles all of the per-association callbacks not related to measurement data. It contains a single method (get_current_time) for getting a UTC timestamp for synchronizing the outstation. The implementation of this method would usually be the same for all outstations.

Typically, the implementation of get_current_time would use the system clock which is being synchronized by the OS via NTP. It can be overridden, however, to use a different clock. For example, data concentrators might receive their time from an upstream DNP3 master and maintain an offset from their time since boot. The examples below demonstrate implementing an AssociationHandler that retrieves the system time.

note

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