DESERT 4.0.0
UwAloha_Q_SINK Class Reference

#include <uw-aloha-q-sink.h>

Inheritance diagram for UwAloha_Q_SINK:
Inheritance graph
Collaboration diagram for UwAloha_Q_SINK:
Collaboration graph

Public Member Functions

 UwAloha_Q_SINK ()
 
virtual ~UwAloha_Q_SINK ()
 
virtual int recvSyncClMsg (ClMessage *m)
 

Protected Types

enum  UWALOHAQ_PKT_TYPE { UWALOHAQ_ACK_PKT , UWALOHAQ_DATA_PKT }
 
enum  UWALOHAQ_SINK_STATUS { IDLE , TRANSMITTING , RECEIVING }
 

Protected Member Functions

virtual void recvFromUpperLayers (Packet *p)
 
virtual void Phy2MacEndRx (Packet *p)
 
virtual int getLayerIdFromTag (const std::string &tag)
 
virtual void Phy2MacStartRx (const Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void txAck (int dest_addr)
 
virtual void initPkt (Packet *p, int dest_adrr)
 
virtual int command (int argc, const char *const *argv)
 

Protected Attributes

UWALOHAQ_SINK_STATUS sink_status
 
int packet_sent_curr_slot_
 
int debug_
 
int sea_trial_
 
int ACK_size
 
int HDR_size
 
std::deque< Packet * > buffer
 
int ack_phy_id
 
std::string phy_ack_tag
 

Detailed Description

Class that represents an ALOHAQ Sink

Member Enumeration Documentation

◆ UWALOHAQ_PKT_TYPE

Enumerator
UWALOHAQ_ACK_PKT 
UWALOHAQ_DATA_PKT 

◆ UWALOHAQ_SINK_STATUS

Enumeration class of UWTDMA status.

Enumerator
IDLE 
TRANSMITTING 
RECEIVING 

Constructor & Destructor Documentation

◆ UwAloha_Q_SINK()

UwAloha_Q_SINK::UwAloha_Q_SINK ( )

Constructor of the TDMA class

References ACK_size, debug_, HDR_size, and sea_trial_.

◆ ~UwAloha_Q_SINK()

UwAloha_Q_SINK::~UwAloha_Q_SINK ( )
virtual

Destructor of the TDMA class

Member Function Documentation

◆ command()

int UwAloha_Q_SINK::command ( int  argc,
const char *const *  argv 
)
protectedvirtual

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.

References phy_ack_tag.

Referenced by recvSyncClMsg().

◆ getLayerIdFromTag()

int UwAloha_Q_SINK::getLayerIdFromTag ( const std::string &  tag)
protectedvirtual

Referenced by txAck().

◆ initPkt()

void UwAloha_Q_SINK::initPkt ( Packet *  p,
int  dest_adrr 
)
protectedvirtual

Method called to add the MAC header size

Parameters
constPacket* Pointer to an Packet object that rapresent the Packet in transmission

References ACK_size, and PT_MMAC_ACK.

Referenced by txAck().

◆ Phy2MacEndRx()

void UwAloha_Q_SINK::Phy2MacEndRx ( Packet *  p)
protectedvirtual

Method called when the Phy Layer finish to receive a Packet

Parameters
constPacket* Pointer to an Packet object that rapresent the Packet in reception

References debug_, IDLE, PT_MMAC_ACK, sink_status, and txAck().

Here is the call graph for this function:

◆ Phy2MacEndTx()

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

Method called when the Mac Layer start to transmit a Packet

Parameters
constPacket* Pointer to an Packet object that rapresent the Packet in transmission Method called when the Mac Layer finish to transmit a Packet
constPacket* Pointer to an Packet object that rapresent the Packet in transmission

References IDLE, packet_sent_curr_slot_, and sink_status.

◆ Phy2MacStartRx()

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

Method called when the Phy Layer start to receive a Packet

Parameters
constPacket* Pointer to an Packet object that rapresent the Packet in reception

References IDLE, RECEIVING, and sink_status.

◆ recvFromUpperLayers()

void UwAloha_Q_SINK::recvFromUpperLayers ( Packet *  p)
protectedvirtual

Receive the packet from the upper layer (e.g. IP)

Parameters
Packet*pointer to the packet received

◆ recvSyncClMsg()

int UwAloha_Q_SINK::recvSyncClMsg ( ClMessage *  m)
virtual

References CLMSG_UWMMAC_ENABLE, and command().

Here is the call graph for this function:

◆ txAck()

void UwAloha_Q_SINK::txAck ( int  dest_addr)
protectedvirtual

Method called to transmit ACK packet

References ack_phy_id, getLayerIdFromTag(), initPkt(), phy_ack_tag, sink_status, and TRANSMITTING.

Referenced by Phy2MacEndRx().

Here is the call graph for this function:

Member Data Documentation

◆ ack_phy_id

int UwAloha_Q_SINK::ack_phy_id
protected

Referenced by txAck().

◆ ACK_size

int UwAloha_Q_SINK::ACK_size
protected

Referenced by initPkt(), and UwAloha_Q_SINK().

◆ buffer

std::deque<Packet *> UwAloha_Q_SINK::buffer
protected

Buffer of the MAC node

◆ debug_

int UwAloha_Q_SINK::debug_
protected

Debug variable: 0 for no info, >-5 for small info, <-5 for complete info

Referenced by Phy2MacEndRx(), and UwAloha_Q_SINK().

◆ HDR_size

int UwAloha_Q_SINK::HDR_size
protected

Size of the HDR if any

Referenced by UwAloha_Q_SINK().

◆ packet_sent_curr_slot_

int UwAloha_Q_SINK::packet_sent_curr_slot_
protected

counter of packet has been sent in the current slot

Referenced by Phy2MacEndTx().

◆ phy_ack_tag

std::string UwAloha_Q_SINK::phy_ack_tag
protected

Referenced by command(), and txAck().

◆ sea_trial_

int UwAloha_Q_SINK::sea_trial_
protected

Written log variable

Referenced by UwAloha_Q_SINK().

◆ sink_status

UWALOHAQ_SINK_STATUS UwAloha_Q_SINK::sink_status
protected

Variable holding the status enum type

Referenced by Phy2MacEndRx(), Phy2MacEndTx(), Phy2MacStartRx(), and txAck().


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