DESERT 3.5.1
Loading...
Searching...
No Matches
UwCsmaAloha_Trigger_SINK Class Reference

#include <uw-csma-aloha-trigger-sink.h>

Inheritance diagram for UwCsmaAloha_Trigger_SINK:
Collaboration diagram for UwCsmaAloha_Trigger_SINK:

Classes

class  GenericTimer
 
class  ReceiveTimer
 

Public Member Functions

 UwCsmaAloha_Trigger_SINK ()
 
virtual ~UwCsmaAloha_Trigger_SINK ()
 
virtual int command (int argc, const char *const *argv)
 
virtual int crLayCommand (ClMessage *m)
 

Protected Types

enum  UW_CS_ALOHA_TRIG_SINK_STATUS {
  UW_CS_ALOHA_TRIG_SINK_STATE_IDLE = 1 , UW_CS_ALOHA_TRIG_SINK_STATE_NOT_SET , UW_CS_ALOHA_TRIG_SINK_STATE_TX_TRIGGER , UW_CS_ALOHA_TRIG_SINK_STATE_ENABLE_RX ,
  UW_CS_ALOHA_TRIG_SINK_STATE_DISABLE_RX , UW_CS_ALOHA_TRIG_SINK_STATE_DATA_RX
}
 
enum  UW_CS_ALOHA_TRIG_SINK_REASON_STATUS {
  UW_CS_ALOHA_TRIG_SINK_REASON_DATA_RX = 1 , UW_CS_ALOHA_TRIG_SINK_REASON_NOT_SET , UW_CS_ALOHA_TRIG_SINK_REASON_START_RX , UW_CS_ALOHA_TRIG_SINK_REASON_PKT_NOT_FOR_ME ,
  UW_CS_ALOHA_TRIG_SINK_REASON_PKT_ERROR , UW_CS_ALOHA_TRIG_SINK_REASON_TX_TRIGGER
}
 
enum  UW_CS_ALOHA_TRIG_SINK_TIMER_STATUS { UW_CS_ALOHA_TRIG_SINK_IDLE = 1 , UW_CS_ALOHA_TRIG_SINK_RUNNING , UW_CS_ALOHA_TRIG_SINK_FROZEN , UW_CS_ALOHA_TRIG_SINK_EXPIRED }
 

Protected Member Functions

virtual void recvFromUpperLayers (Packet *p)
 
virtual void Mac2PhyStartTx (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void Phy2MacStartRx (const Packet *p)
 
virtual void Phy2MacEndRx (Packet *p)
 
virtual void initPkt (Packet *p, int dest_addr=0)
 
virtual void stateIdle ()
 
virtual void stateEnableRx ()
 
virtual void stateDisableRx ()
 
virtual void stateTxTRIGGER ()
 
virtual void txTRIGGER (Packet *p)
 
virtual void stateRxData (Packet *p)
 
virtual void stateRxPacketNotForMe (Packet *p)
 
void refreshState (UW_CS_ALOHA_TRIG_SINK_STATUS state)
 
void refreshReason (UW_CS_ALOHA_TRIG_SINK_REASON_STATUS reason)
 
int getTriggerMsgSent ()
 
virtual void waitForUser ()
 
virtual void incrUpperDataRx ()
 
void incrTRIGGERPacketTx ()
 

Protected Attributes

int TRIGGER_size
 
int buffer_pkts
 
double tx_timer_duration
 
bool receiving_state_active
 
UW_CS_ALOHA_TRIG_SINK_STATUS curr_state
 
UW_CS_ALOHA_TRIG_SINK_STATUS prev_state
 
UW_CS_ALOHA_TRIG_SINK_REASON_STATUS last_reason
 
ReceiveTimer receive_timer
 
int trigger_pkts_tx
 

Detailed Description

Class that describes a UwCsmaAloha_Trigger_SINK module.

Definition at line 61 of file uw-csma-aloha-trigger-sink.h.

Member Enumeration Documentation

◆ UW_CS_ALOHA_TRIG_SINK_REASON_STATUS

Enumerator
UW_CS_ALOHA_TRIG_SINK_REASON_DATA_RX 
UW_CS_ALOHA_TRIG_SINK_REASON_NOT_SET 
UW_CS_ALOHA_TRIG_SINK_REASON_START_RX 
UW_CS_ALOHA_TRIG_SINK_REASON_PKT_NOT_FOR_ME 
UW_CS_ALOHA_TRIG_SINK_REASON_PKT_ERROR 
UW_CS_ALOHA_TRIG_SINK_REASON_TX_TRIGGER 

Definition at line 104 of file uw-csma-aloha-trigger-sink.h.

◆ UW_CS_ALOHA_TRIG_SINK_STATUS

< Variable that rapresent the status of the protocol machine state

Enumerator
UW_CS_ALOHA_TRIG_SINK_STATE_IDLE 
UW_CS_ALOHA_TRIG_SINK_STATE_NOT_SET 
UW_CS_ALOHA_TRIG_SINK_STATE_TX_TRIGGER 
UW_CS_ALOHA_TRIG_SINK_STATE_ENABLE_RX 
UW_CS_ALOHA_TRIG_SINK_STATE_DISABLE_RX 
UW_CS_ALOHA_TRIG_SINK_STATE_DATA_RX 

Definition at line 94 of file uw-csma-aloha-trigger-sink.h.

◆ UW_CS_ALOHA_TRIG_SINK_TIMER_STATUS

Enumerator
UW_CS_ALOHA_TRIG_SINK_IDLE 
UW_CS_ALOHA_TRIG_SINK_RUNNING 
UW_CS_ALOHA_TRIG_SINK_FROZEN 
UW_CS_ALOHA_TRIG_SINK_EXPIRED 

Definition at line 114 of file uw-csma-aloha-trigger-sink.h.

Constructor & Destructor Documentation

◆ UwCsmaAloha_Trigger_SINK()

UwCsmaAloha_Trigger_SINK::UwCsmaAloha_Trigger_SINK ( )

Constructor of the UwCsmaAloha_Trigger_SINK class.

Definition at line 74 of file uw-csma-aloha-trigger-sink.cpp.

◆ ~UwCsmaAloha_Trigger_SINK()

UwCsmaAloha_Trigger_SINK::~UwCsmaAloha_Trigger_SINK ( )
virtual

Destructor of the UwCsmaAloha_Trigger_SINK class.

Definition at line 87 of file uw-csma-aloha-trigger-sink.cpp.

Member Function Documentation

◆ command()

int UwCsmaAloha_Trigger_SINK::command ( int  argc,
const char *const *  argv 
)
virtual

TCL command interpreter.

It implements the following OTcl methods:

Parameters
argcNumber of arguments in argv.
argvArray of strings which are the command parameters (Note that argv[0] is the name of the object).
Returns
TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not.

Definition at line 92 of file uw-csma-aloha-trigger-sink.cpp.

◆ crLayCommand()

int UwCsmaAloha_Trigger_SINK::crLayCommand ( ClMessage *  m)
virtual

Cross-Layer messages interpreter.

Parameters
ClMessage*an instance of ClMessage that represent the message received
Returns
0 if successful.

Definition at line 108 of file uw-csma-aloha-trigger-sink.cpp.

◆ getTriggerMsgSent()

int UwCsmaAloha_Trigger_SINK::getTriggerMsgSent ( )
inlineprotected

Return the number of TRIGGER packets sent over the simulation.

Returns
number of trigger packets over the simulation

Definition at line 419 of file uw-csma-aloha-trigger-sink.h.

◆ incrTRIGGERPacketTx()

void UwCsmaAloha_Trigger_SINK::incrTRIGGERPacketTx ( )
inlineprotected

Increment the number of TRIGGER packets transmitted.

Definition at line 442 of file uw-csma-aloha-trigger-sink.h.

◆ incrUpperDataRx()

virtual void UwCsmaAloha_Trigger_SINK::incrUpperDataRx ( )
inlineprotectedvirtual

Increment the number of Data received from upper layers.

Definition at line 433 of file uw-csma-aloha-trigger-sink.h.

◆ initPkt()

void UwCsmaAloha_Trigger_SINK::initPkt ( Packet *  p,
int  dest_addr = 0 
)
protectedvirtual

Init the headers of the packet in transmission.

Parameters
Packet*packet to transmit
dest_adrrdestination address of the packet

Definition at line 146 of file uw-csma-aloha-trigger-sink.cpp.

◆ Mac2PhyStartTx()

void UwCsmaAloha_Trigger_SINK::Mac2PhyStartTx ( Packet *  p)
protectedvirtual

Pass the packet to the PHY layer.

Parameters
Packet*pointer to the packet received

Definition at line 157 of file uw-csma-aloha-trigger-sink.cpp.

◆ Phy2MacEndRx()

void UwCsmaAloha_Trigger_SINK::Phy2MacEndRx ( Packet *  p)
protectedvirtual

Method called when the PHY layer finishes to receive a packet.

Parameters
Packet*packet just received

Definition at line 188 of file uw-csma-aloha-trigger-sink.cpp.

◆ Phy2MacEndTx()

void UwCsmaAloha_Trigger_SINK::Phy2MacEndTx ( const Packet *  p)
protectedvirtual

Method called when the PHY layers finishes to transmit packet.

Parameters
Packet*pointer to the Packet just transmitted

Definition at line 163 of file uw-csma-aloha-trigger-sink.cpp.

◆ Phy2MacStartRx()

void UwCsmaAloha_Trigger_SINK::Phy2MacStartRx ( const Packet *  p)
protectedvirtual

Method called when the PHY layer begins to receive a packet.

Parameters
Packet*pointer to the packet in reception

Definition at line 173 of file uw-csma-aloha-trigger-sink.cpp.

◆ recvFromUpperLayers()

void UwCsmaAloha_Trigger_SINK::recvFromUpperLayers ( Packet *  p)
protectedvirtual

Receives the packet from the upper layer (e.g.

IP)

Parameters
Packet*pointer to the packet received

Definition at line 117 of file uw-csma-aloha-trigger-sink.cpp.

◆ refreshReason()

void UwCsmaAloha_Trigger_SINK::refreshReason ( UW_CS_ALOHA_TRIG_SINK_REASON_STATUS  reason)
inlineprotected

Refresh the reason for the change of state.

Definition at line 409 of file uw-csma-aloha-trigger-sink.h.

◆ refreshState()

void UwCsmaAloha_Trigger_SINK::refreshState ( UW_CS_ALOHA_TRIG_SINK_STATUS  state)
inlineprotected

Refresh the state of the protocol.

Parameters
UW_CS_ALOHA_TRIG_SINK_STATUSnext state of the protocol

Definition at line 400 of file uw-csma-aloha-trigger-sink.h.

◆ stateDisableRx()

void UwCsmaAloha_Trigger_SINK::stateDisableRx ( )
protectedvirtual

The sink is not allowed to receive the packet from a certain node anymore.

Definition at line 135 of file uw-csma-aloha-trigger-sink.cpp.

◆ stateEnableRx()

void UwCsmaAloha_Trigger_SINK::stateEnableRx ( )
protectedvirtual

State in which the sink is enabled to receive packets.

Definition at line 123 of file uw-csma-aloha-trigger-sink.cpp.

◆ stateIdle()

void UwCsmaAloha_Trigger_SINK::stateIdle ( )
protectedvirtual

State IDLE of the protocol.

All variables resetted

Definition at line 256 of file uw-csma-aloha-trigger-sink.cpp.

◆ stateRxData()

void UwCsmaAloha_Trigger_SINK::stateRxData ( Packet *  p)
protectedvirtual

The sink receives a DATA packet from a node.

Definition at line 232 of file uw-csma-aloha-trigger-sink.cpp.

◆ stateRxPacketNotForMe()

void UwCsmaAloha_Trigger_SINK::stateRxPacketNotForMe ( Packet *  p)
protectedvirtual

The destination address of the packet is not equal to the sink's address.

Definition at line 243 of file uw-csma-aloha-trigger-sink.cpp.

◆ stateTxTRIGGER()

void UwCsmaAloha_Trigger_SINK::stateTxTRIGGER ( )
protectedvirtual

The sink transmit the TRIGGER packet to begin the neighbour discovery phase.

Definition at line 267 of file uw-csma-aloha-trigger-sink.cpp.

◆ txTRIGGER()

void UwCsmaAloha_Trigger_SINK::txTRIGGER ( Packet *  p)
protectedvirtual

Transmit the TRIGGER packet.

Definition at line 279 of file uw-csma-aloha-trigger-sink.cpp.

◆ waitForUser()

void UwCsmaAloha_Trigger_SINK::waitForUser ( )
protectedvirtual

Used for debug purposes.

Wait until the user press a key

Definition at line 297 of file uw-csma-aloha-trigger-sink.cpp.

Member Data Documentation

◆ buffer_pkts

int UwCsmaAloha_Trigger_SINK::buffer_pkts
protected

Length of data packet queue.

Definition at line 448 of file uw-csma-aloha-trigger-sink.h.

◆ curr_state

UW_CS_ALOHA_TRIG_SINK_STATUS UwCsmaAloha_Trigger_SINK::curr_state
protected

Current state of the protocol.

Definition at line 457 of file uw-csma-aloha-trigger-sink.h.

◆ last_reason

UW_CS_ALOHA_TRIG_SINK_REASON_STATUS UwCsmaAloha_Trigger_SINK::last_reason
protected

Last reason of the state change of the protocol.

Definition at line 461 of file uw-csma-aloha-trigger-sink.h.

◆ prev_state

UW_CS_ALOHA_TRIG_SINK_STATUS UwCsmaAloha_Trigger_SINK::prev_state
protected

Previous state of the protocol.

Definition at line 459 of file uw-csma-aloha-trigger-sink.h.

◆ receive_timer

ReceiveTimer UwCsmaAloha_Trigger_SINK::receive_timer
protected

timer of receive state

Definition at line 463 of file uw-csma-aloha-trigger-sink.h.

◆ receiving_state_active

bool UwCsmaAloha_Trigger_SINK::receiving_state_active
protected

True if the sink is allowed to receive data packet.

Definition at line 453 of file uw-csma-aloha-trigger-sink.h.

◆ trigger_pkts_tx

int UwCsmaAloha_Trigger_SINK::trigger_pkts_tx
protected

Number of TRIGGER packet received.

Definition at line 465 of file uw-csma-aloha-trigger-sink.h.

◆ TRIGGER_size

int UwCsmaAloha_Trigger_SINK::TRIGGER_size
protected

Size of the TRIGGER packet.

Definition at line 447 of file uw-csma-aloha-trigger-sink.h.

◆ tx_timer_duration

double UwCsmaAloha_Trigger_SINK::tx_timer_duration
protected

Duration of the timer in which one node is allowed to transmit.

Definition at line 450 of file uw-csma-aloha-trigger-sink.h.


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