SimpleClockSynchronizer

Package: inet.applications.clock

SimpleClockSynchronizer

simple module

This module periodically synchronizes the slave clock to the master clock with the specified accuracy. The synchronization happens directly using C++ methods calls and without any packet exchange. This is primarily useful when the overhead of the time synchronization protocol messages can be safely ignored.

Inheritance diagram

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram.

Parameters

Name Type Default value Description
masterClockModule string
slaveClockModule string
synchronizationInterval double

clock synchronization period

synchronizationClockTimeError double 0s

0 means slave clock time equals master clock time after synchronization

synchronizationOscillatorCompensationError double 0ppm

0 means slave clock speed equals master clock speed after synchronization

Properties

Name Value Description
display i=block/app
lifecycleSupport

Gates

Name Direction Size Description
socketIn input
socketOut output

Scheduled messages (observed)

msgkindctrltagsmsgnamecontext
omnetpp::cMessage0SynchronizationTimer

Direct method calls (observed)

call tofunctioninfo
SettableClockinet::SettableClock::setClockTimesetClockTime

Source code

//
// This module periodically synchronizes the slave clock to the master clock with
// the specified accuracy. The synchronization happens directly using C++ methods
// calls and without any packet exchange. This is primarily useful when the overhead
// of the time synchronization protocol messages can be safely ignored.
//
simple SimpleClockSynchronizer like IApp
{
    parameters:
        string masterClockModule;
        string slaveClockModule;
        volatile double synchronizationInterval @unit(s); // clock synchronization period
        volatile double synchronizationClockTimeError @unit(s) = default(0s); // 0 means slave clock time equals master clock time after synchronization
        volatile double synchronizationOscillatorCompensationError @unit(ppm) = default(0ppm); // 0 means slave clock speed equals master clock speed after synchronization
        @display("i=block/app");
        @lifecycleSupport;
    gates:
        input socketIn @loose;
        output socketOut @loose;
}

File: src/inet/applications/clock/SimpleClockSynchronizer.ned