Simple Module TicApp

Package: core4inet.applications.examples.rt_tictoc
File: src/core4inet/applications/examples/rt_tictoc/TicApp.ned

C++ definition

Tic(1,2) Application used for the rt_tictoc example. Sends TT messages with Tic(1,2)-Request payload and receives RC messages with Toc(1,2)-Response payload.

See also: rt_tictoc, ~TocApp

Author: Till Steinbach

TicApp

Usage diagram:

The following diagram shows usage relationships between types. Unresolved types are missing from the diagram. Click here to see the full picture.

Inheritance diagram:

The following diagram shows inheritance relationships for this type. Unresolved types are missing from the diagram. Click here to see the full picture.

Extends:

Name Type Description
CTApplicationBase simple module

Abstract base application used for real-time Ethernet-Application application models.

Parameters:

Name Type Default value Description
displayName string ""

Name shown above the module

buffers string ""

Comma seperated list of buffer modules the application is allowed to use

buffers_manual bool false

If true, buffer management is not used. Applications use their own methods to locate buffers

counter int 0

Counter is increased on incoming Tic(1,2) messages

ct_id int

CT-ID used for the messages to send

action_time int

Time in cycle when the tic message is generated

oscillator string "^.scheduler.oscillator"
timer string "^.scheduler.timer"

Timer of the timed module (must be set to the name of an timer module in the Node) when left empty: timer

See also: IScheduled

period string ""

Period of the scheduled module (must be set to the name of a period module in the Node) when left empty: period[0]

See also: IScheduled

Properties:

Name Value Description
class TicApp
display i=block/routing,cyan

Signal emitted when a frame is received, contains received EtherFrame

Gates:

Name Direction Size Description
schedulerIn input

Input gate for the incoming Scheduler messages

TTin input

Input gate for the incoming time-triggered messages

RCin input

Input gate for the incoming rate-constrained messages

Signals:

Name Type Unit
roundtrip simtime_t s
rxPk inet::EtherFrame

Statistics:

Name Title Source Record Unit Interpolation Mode
roundtrip Roundtrip time stats, histogram?, vector s
rxBytes Received Bytes rxPk sum(packetBytes), vector(packetBytes), histogram(packetBytes)? B none
rxPk Received Packets rxPk count packets

Source code:

//
// Tic Application used for the rt_tictoc example.
// Sends TT messages with Tic-Request payload and receives
// RC messages with Toc-Response payload.
//
// @see rt_tictoc, ~TocApp
//
// @author Till Steinbach
//
simple TicApp extends CTApplicationBase like IScheduled
{
    parameters:
        @class(TicApp);
        @display("i=block/routing,cyan");

		//Signal emitted when a frame is received, contains received EtherFrame
        @signal[rxPk](type=inet::EtherFrame);
        //Signal emitted when a frame is received, contains roundtrip time
        @signal[roundtrip](type=simtime_t; unit=s; );
		//Statistic of the amount of packets that were received by the application
        @statistic[rxPk](title="Received Packets"; source=rxPk; unit=packets; record=count);
        //Statistic of the amount of bytes that were received by the application
        @statistic[rxBytes](title="Received Bytes"; source=rxPk; unit=B; record="sum(packetBytes)","vector(packetBytes)","histogram(packetBytes)?"; interpolationmode=none);
        //Statistic of the applications roundtrip time
        @statistic[roundtrip](title="Roundtrip time"; unit=s; record=stats,histogram?,vector);

        //Counter is increased on incoming Tic messages
        int counter = 0;
        //CT-ID used for the messages to send
        int ct_id;
        //Time in cycle when the tic message is generated
        int action_time @unit(tick);

		//Oscillator of the timed module (must be set to the name of an oscillator module in the Node) when left empty: oscillator @see IScheduled
        string oscillator = default("^.scheduler.oscillator");
        //Timer of the timed module (must be set to the name of an timer module in the Node) when left empty: timer @see IScheduled
        string timer = default("^.scheduler.timer");
        //Period of the scheduled module (must be set to the name of a period module in the Node) when left empty: period[0] @see IScheduled
        string period = default("");
}