SimpleClockSynchronizer

Package: inet.applications.clock

simple module SimpleClockSynchronizer

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

inet.applications.clock.SimpleClockSynchronizerSimpleClockSynchronizersimple

Inheritance diagram

Extends

Name

Type

Description

SimpleModule

simple module

Base module for all INET simple modules.

Parameters

Name

Type

Default value

Description

displayStringTextFormat

string

“”

Determines the text that is written on top of the submodule, supports displaying pars, watches, and module-specific information

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

class

SimpleClockSynchronizer

display

i=block/app

lifecycleSupport

Gates

Name

Direction

Size

Description

socketIn

input

socketOut

output

Source code

//
// Periodically synchronizes the slave clock to the master clock with
// the specified accuracy. The synchronization happens directly using C++ method
// 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 extends SimpleModule like IApp
{
    parameters:
        @class(SimpleClockSynchronizer);
        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