DESERT 4.0.0
UwCsBurst Class Reference

#include <uw-cs-burst.h>

Inheritance diagram for UwCsBurst:
Inheritance graph
Collaboration diagram for UwCsBurst:
Collaboration graph

Public Member Functions

 UwCsBurst ()
 
virtual ~UwCsBurst ()=default
 

Protected Types

enum class  UWCS_STATUS { IDLE , SENSING , TRANSMITTING }
 

Protected Member Functions

virtual void txData ()
 
virtual void sensingExpired ()
 
virtual void sensing ()
 
virtual void recvFromUpperLayers (Packet *p) override
 
virtual void Phy2MacEndRx (Packet *p) override
 
virtual void Phy2MacStartRx (const Packet *p) override
 
virtual void Mac2PhyStartTx (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p) override
 
virtual void rxPacketNotForMe (Packet *p)
 
virtual void initPkt (Packet *p)
 
virtual int command (int argc, const char *const *argv) override
 

Protected Attributes

UWCS_STATUS tx_status_
 
double fix_sens_time_
 
double rv_sens_time_
 
UwSensingTimer sensing_timer_
 
std::deque< Packet * > buffer_
 
uint max_queue_size_
 
uint max_packet_per_burst_
 
uint packet_sent_curr_burst_
 
uint n_rx_while_sensing_
 

Friends

class UwSensingTimer
 

Detailed Description

Class that represents a CSBURST Node

Member Enumeration Documentation

◆ UWCS_STATUS

enum class UwCsBurst::UWCS_STATUS
strongprotected

Enumeration class of CSBURST status.

Enumerator
IDLE 
SENSING 
TRANSMITTING 

Constructor & Destructor Documentation

◆ UwCsBurst()

UwCsBurst::UwCsBurst ( )

Constructor of the CSBURST class

References fix_sens_time_, max_packet_per_burst_, max_queue_size_, and rv_sens_time_.

◆ ~UwCsBurst()

virtual UwCsBurst::~UwCsBurst ( )
virtualdefault

Destructor of the CSBURST class

Member Function Documentation

◆ command()

int UwCsBurst::command ( int  argc,
const char *const *  argv 
)
overrideprotectedvirtual

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 buffer_.

◆ initPkt()

void UwCsBurst::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

Referenced by recvFromUpperLayers().

◆ Mac2PhyStartTx()

void UwCsBurst::Mac2PhyStartTx ( 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

Referenced by txData().

◆ Phy2MacEndRx()

void UwCsBurst::Phy2MacEndRx ( Packet *  p)
overrideprotectedvirtual

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 rxPacketNotForMe().

Here is the call graph for this function:

◆ Phy2MacEndTx()

void UwCsBurst::Phy2MacEndTx ( const Packet *  p)
overrideprotectedvirtual

Method called when the Mac Layer finish to transmit a Packet

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

References packet_sent_curr_burst_, and txData().

Here is the call graph for this function:

◆ Phy2MacStartRx()

void UwCsBurst::Phy2MacStartRx ( const Packet *  p)
overrideprotectedvirtual

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 n_rx_while_sensing_.

◆ recvFromUpperLayers()

void UwCsBurst::recvFromUpperLayers ( Packet *  p)
overrideprotectedvirtual

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

Parameters
Packet*pointer to the packet received

References buffer_, initPkt(), max_queue_size_, and sensing().

Here is the call graph for this function:

◆ rxPacketNotForMe()

void UwCsBurst::rxPacketNotForMe ( Packet *  p)
protectedvirtual

Method called when the Packet received is determined to be not for me

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

Referenced by Phy2MacEndRx().

◆ sensing()

void UwCsBurst::sensing ( )
protectedvirtual

Start sensing the channel

References fix_sens_time_, IDLE, n_rx_while_sensing_, rv_sens_time_, SENSING, sensing_timer_, and tx_status_.

Referenced by recvFromUpperLayers(), and txData().

◆ sensingExpired()

void UwCsBurst::sensingExpired ( )
protectedvirtual

Sensing timer expired

References fix_sens_time_, n_rx_while_sensing_, packet_sent_curr_burst_, rv_sens_time_, sensing_timer_, TRANSMITTING, tx_status_, and txData().

Here is the call graph for this function:

◆ txData()

void UwCsBurst::txData ( )
protectedvirtual

Transmit a data packet if in my slot

References buffer_, IDLE, Mac2PhyStartTx(), max_packet_per_burst_, packet_sent_curr_burst_, sensing(), and tx_status_.

Referenced by Phy2MacEndTx(), and sensingExpired().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ UwSensingTimer

friend class UwSensingTimer
friend

Member Data Documentation

◆ buffer_

std::deque<Packet *> UwCsBurst::buffer_
protected

Buffer of the MAC node.

Referenced by command(), recvFromUpperLayers(), and txData().

◆ fix_sens_time_

double UwCsBurst::fix_sens_time_
protected

Frame duration.

Referenced by sensing(), sensingExpired(), and UwCsBurst().

◆ max_packet_per_burst_

uint UwCsBurst::max_packet_per_burst_
protected

Max numer of packet it can transmit in a tx burst.

Referenced by txData(), and UwCsBurst().

◆ max_queue_size_

uint UwCsBurst::max_queue_size_
protected

Maximum dimension of queue.

Referenced by recvFromUpperLayers(), and UwCsBurst().

◆ n_rx_while_sensing_

uint UwCsBurst::n_rx_while_sensing_
protected

◆ packet_sent_curr_burst_

uint UwCsBurst::packet_sent_curr_burst_
protected

Counter of packet has been sent in the current burst.

Referenced by Phy2MacEndTx(), sensingExpired(), and txData().

◆ rv_sens_time_

double UwCsBurst::rv_sens_time_
protected

Random guard time between slots.

Referenced by sensing(), sensingExpired(), and UwCsBurst().

◆ sensing_timer_

UwSensingTimer UwCsBurst::sensing_timer_
protected

Carrier sensing timer handler.

Referenced by sensing(), and sensingExpired().

◆ tx_status_

UWCS_STATUS UwCsBurst::tx_status_
protected

Variable holding the status enum type.

Referenced by sensing(), sensingExpired(), and txData().


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