DESERT 4.0.0
UwAloha_Q_Sync_SINK Class Reference

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

Inheritance diagram for UwAloha_Q_Sync_SINK:
Inheritance graph
Collaboration diagram for UwAloha_Q_Sync_SINK:
Collaboration graph

Public Member Functions

 UwAloha_Q_Sync_SINK ()
 
virtual ~UwAloha_Q_Sync_SINK ()=default
 
virtual int recvSyncClMsg (ClMessage *m)
 

Protected Types

enum  UWALOHAQ_SINK_STATUS { IDLE , TRANSMITTING , RECEIVING }
 
enum  UWALOHAQ_SINK_SLOT_STATUS { RECV_PERIOD , TRANSMIT_PERIOD }
 

Protected Member Functions

virtual void handleTimerExpiration ()
 
virtual void start (double delay)
 
virtual void stop ()
 
virtual void recvFromUpperLayers (Packet *p)
 
virtual void Phy2MacEndRx (Packet *p)
 
virtual void Phy2MacStartRx (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void txAck ()
 
virtual void initPkt (Packet *p)
 
virtual int command (int argc, const char *const *argv)
 

Protected Attributes

UWALOHAQ_SINK_STATUS sink_status
 
UWALOHAQ_SINK_SLOT_STATUS sink_slot_status
 
double start_time
 
UwAlohaQSyncTimerSink alohaq_sync_sink_timer
 
int debug_
 
int sea_trial_
 
int ACK_size
 
int HDR_size
 
bool enable
 
double t_prop_max
 
double t_dp
 
double t_guard
 
int nn
 
std::vector< int > succ_macs
 
double slot_duration_factor
 

Friends

class UwAlohaQSyncTimerSink
 

Detailed Description

Class that represents an UWALOHAQ Sink

Member Enumeration Documentation

◆ UWALOHAQ_SINK_SLOT_STATUS

Enumeration class of UwAlohaQSink slot status

Enumerator
RECV_PERIOD 
TRANSMIT_PERIOD 

◆ UWALOHAQ_SINK_STATUS

Enumeration class of UwAlohaQSink status

Enumerator
IDLE 
TRANSMITTING 
RECEIVING 

Constructor & Destructor Documentation

◆ UwAloha_Q_Sync_SINK()

UwAloha_Q_Sync_SINK::UwAloha_Q_Sync_SINK ( )

Constructor of the UwAloha_Q_Sync_SINK class

References ACK_size, debug_, HDR_size, nn, sea_trial_, slot_duration_factor, t_dp, and t_prop_max.

◆ ~UwAloha_Q_Sync_SINK()

virtual UwAloha_Q_Sync_SINK::~UwAloha_Q_Sync_SINK ( )
virtualdefault

Destructor of the UwAloha_Q_Sync_SINK class

Member Function Documentation

◆ command()

int UwAloha_Q_Sync_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 start(), start_time, and stop().

Referenced by recvSyncClMsg().

Here is the call graph for this function:

◆ handleTimerExpiration()

void UwAloha_Q_Sync_SINK::handleTimerExpiration ( )
protectedvirtual

Triggered upon timer expiration event

References alohaq_sync_sink_timer, debug_, nn, RECV_PERIOD, sink_slot_status, slot_duration_factor, succ_macs, t_dp, t_guard, t_prop_max, TRANSMIT_PERIOD, and txAck().

Here is the call graph for this function:

◆ initPkt()

void UwAloha_Q_Sync_SINK::initPkt ( Packet *  p)
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, enable, nn, PT_ALOHAQ_SYNC_ACK, and succ_macs.

Referenced by txAck().

◆ Phy2MacEndRx()

void UwAloha_Q_Sync_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_ALOHAQ_SYNC_ACK, sink_slot_status, sink_status, succ_macs, and TRANSMIT_PERIOD.

◆ Phy2MacEndTx()

void UwAloha_Q_Sync_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 debug_, IDLE, and sink_status.

◆ Phy2MacStartRx()

void UwAloha_Q_Sync_SINK::Phy2MacStartRx ( 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 debug_, IDLE, RECEIVING, and sink_status.

◆ recvFromUpperLayers()

void UwAloha_Q_Sync_SINK::recvFromUpperLayers ( Packet *  p)
protectedvirtual

◆ recvSyncClMsg()

int UwAloha_Q_Sync_SINK::recvSyncClMsg ( ClMessage *  m)
virtual

References CLMSG_UWMMAC_ENABLE, and command().

Here is the call graph for this function:

◆ start()

void UwAloha_Q_Sync_SINK::start ( double  delay)
protectedvirtual

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

Parameters
Packet*pointer to the packet received Schedule the beginning of each SINK frame cycle
delayto await before starting the protocol

References alohaq_sync_sink_timer, enable, nn, and succ_macs.

Referenced by command().

◆ stop()

void UwAloha_Q_Sync_SINK::stop ( )
protectedvirtual

Cancel the timer

References alohaq_sync_sink_timer, enable, and succ_macs.

Referenced by command().

◆ txAck()

void UwAloha_Q_Sync_SINK::txAck ( )
protectedvirtual

Method called to transmit ACK packet

References debug_, initPkt(), sink_status, and TRANSMITTING.

Referenced by handleTimerExpiration().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ UwAlohaQSyncTimerSink

friend class UwAlohaQSyncTimerSink
friend

Member Data Documentation

◆ ACK_size

int UwAloha_Q_Sync_SINK::ACK_size
protected

Size of the ACK HDR if any

Referenced by initPkt(), and UwAloha_Q_Sync_SINK().

◆ alohaq_sync_sink_timer

UwAlohaQSyncTimerSink UwAloha_Q_Sync_SINK::alohaq_sync_sink_timer
protected

UwAlohaQ Sink Timer

Referenced by handleTimerExpiration(), start(), and stop().

◆ debug_

int UwAloha_Q_Sync_SINK::debug_
protected

Debug variable: 0 for no info,

‍1 for detailed info

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

◆ enable

bool UwAloha_Q_Sync_SINK::enable
protected

Referenced by initPkt(), start(), and stop().

◆ HDR_size

int UwAloha_Q_Sync_SINK::HDR_size
protected

Size of the HDR if any

Referenced by UwAloha_Q_Sync_SINK().

◆ nn

int UwAloha_Q_Sync_SINK::nn
protected

Number of nodes

Referenced by handleTimerExpiration(), initPkt(), start(), and UwAloha_Q_Sync_SINK().

◆ sea_trial_

int UwAloha_Q_Sync_SINK::sea_trial_
protected

Written log variable

Referenced by UwAloha_Q_Sync_SINK().

◆ sink_slot_status

UWALOHAQ_SINK_SLOT_STATUS UwAloha_Q_Sync_SINK::sink_slot_status
protected

Variable that holds UWALOHAQ_SINK_SLOT_STATUS

Referenced by handleTimerExpiration(), and Phy2MacEndRx().

◆ sink_status

UWALOHAQ_SINK_STATUS UwAloha_Q_Sync_SINK::sink_status
protected

Variable that holds UWALOHAQ_SINK_STATUS

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

◆ slot_duration_factor

double UwAloha_Q_Sync_SINK::slot_duration_factor
protected

slot_duration = t_dp * slot_duration_factor (applicable for nodes)

Referenced by handleTimerExpiration(), and UwAloha_Q_Sync_SINK().

◆ start_time

double UwAloha_Q_Sync_SINK::start_time
protected

Time to wait before starting the protocol

Referenced by command().

◆ succ_macs

std::vector<int> UwAloha_Q_Sync_SINK::succ_macs
protected

Store MAC adresses of successful transmittors

Referenced by handleTimerExpiration(), initPkt(), Phy2MacEndRx(), start(), and stop().

◆ t_dp

double UwAloha_Q_Sync_SINK::t_dp
protected

Transmission delay

Referenced by handleTimerExpiration(), and UwAloha_Q_Sync_SINK().

◆ t_guard

double UwAloha_Q_Sync_SINK::t_guard
protected

Guard interval

Referenced by handleTimerExpiration().

◆ t_prop_max

double UwAloha_Q_Sync_SINK::t_prop_max
protected

Maximal propagation delay

Referenced by handleTimerExpiration(), and UwAloha_Q_Sync_SINK().


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