TTEthernet Model for INET Framework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
TTEthernetModel::RCIncoming Class Reference

Class for the critical traffic conformance check of rate-constrained traffic. More...

#include <RCIncoming.h>

Inheritance diagram for TTEthernetModel::RCIncoming:
TTEthernetModel::Incoming

Public Member Functions

 RCIncoming ()
 Constructor. More...
 
- Public Member Functions inherited from TTEthernetModel::Incoming
 Incoming ()
 Constructor. More...
 

Protected Member Functions

virtual void handleMessage (cMessage *msg)
 Forwards messages arriving on in-gate to out-gate checks conformance with configured bag. More...
 
virtual void handleParameterChange (const char *parname)
 Indicates a parameter has changed. More...
 
- Protected Member Functions inherited from TTEthernetModel::Incoming
virtual void initialize ()
 Initialization of the module. More...
 

Private Attributes

uint64_t lastArrived
 Saves the tickcount of the last message. More...
 
uint64_t bag
 caches bag parameter More...
 

Additional Inherited Members

- Protected Attributes inherited from TTEthernetModel::Incoming
bool hadError
 set to true if there was an error during runtime More...
 
- Static Protected Attributes inherited from TTEthernetModel::Incoming
static simsignal_t ctDroppedSignal = SIMSIGNAL_NULL
 Signal that is emitted when a frame is dropped. More...
 

Detailed Description

Class for the critical traffic conformance check of rate-constrained traffic.

This class checks whether incoming traffic was conform with the configured bag. Conform messages are forwarded from in to out

See Also
Incoming

Definition at line 33 of file RCIncoming.h.

Constructor & Destructor Documentation

TTEthernetModel::RCIncoming::RCIncoming ( )

Constructor.

Definition at line 25 of file RCIncoming.cc.

26 {
27  lastArrived=0;
28 }

Member Function Documentation

void TTEthernetModel::RCIncoming::handleMessage ( cMessage *  msg)
protectedvirtual

Forwards messages arriving on in-gate to out-gate checks conformance with configured bag.

Parameters
msgthe incoming message

Reimplemented from TTEthernetModel::Incoming.

Definition at line 30 of file RCIncoming.cc.

31 {
32  if(msg->arrivedOn("in")){
33  TTEScheduler *tteScheduler = (TTEScheduler*)getParentModule()->getSubmodule("tteScheduler");
34  unsigned long currentTotalTicks = tteScheduler->getTotalTicks();
35  //Now check for correct arrival:
36  //TODO what todo with JITTER?
37  //Check too early
38  if(currentTotalTicks-lastArrived < bag){
39  emit(ctDroppedSignal, 1);
40  if(ev.isGUI()){
41  ev.printf("Received frame in %s too early! Gap was %d Ticks, should have been between minimum %d! \n", getName(), currentTotalTicks-lastArrived,par("bag").longValue());
42  bubble("Frame to early");
43  getDisplayString().setTagArg("i2", 0, "status/excl3");
44  getParentModule()->getDisplayString().setTagArg("i2", 0, "status/excl3");
45  }
46 
47  delete msg;
48  }
49  //Timing ok
50  else{
51  lastArrived=currentTotalTicks;
52  sendDelayed(msg,SimTime(getParentModule()->par("hardware_delay").doubleValue()),"out");
53  //send(msg,"out");
54  }
55  }
56 }
void TTEthernetModel::RCIncoming::handleParameterChange ( const char *  parname)
protectedvirtual

Indicates a parameter has changed.

Parameters
parnameName of the changed parameter or NULL if multiple parameter changed.

Definition at line 58 of file RCIncoming.cc.

58  {
59  bag = (uint64_t)par("bag").longValue();
60 }

Member Data Documentation

uint64_t TTEthernetModel::RCIncoming::bag
private

caches bag parameter

Definition at line 44 of file RCIncoming.h.

Referenced by handleMessage(), and handleParameterChange().

uint64_t TTEthernetModel::RCIncoming::lastArrived
private

Saves the tickcount of the last message.

Definition at line 39 of file RCIncoming.h.

Referenced by handleMessage(), and RCIncoming().


The documentation for this class was generated from the following files: