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

#include <uwtdma.h>

Inheritance diagram for UwTDMA:
Collaboration diagram for UwTDMA:

Public Member Functions

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

Protected Types

enum  UWTDMA_STATUS { IDLE , TRANSMITTING , RECEIVING }
 

Protected Member Functions

virtual void txData ()
 
virtual void stateTxData ()
 
virtual void changeStatus ()
 
virtual void start (double delay)
 
virtual void stop ()
 
virtual void recvFromUpperLayers (Packet *p)
 
virtual void Phy2MacEndRx (Packet *p)
 
virtual void Phy2MacStartRx (const Packet *p)
 
virtual void Mac2PhyStartTx (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void rxPacketNotForMe (Packet *p)
 
virtual void initPkt (Packet *p)
 
unsigned long int getEpoch ()
 
virtual int command (int argc, const char *const *argv)
 

Protected Attributes

UWTDMA_STATUS transceiver_status
 
int slot_status
 
int debug_
 
int sea_trial_
 
int fair_mode
 
int tot_slots
 
int slot_number
 
int HDR_size
 
double frame_duration
 
double guard_time
 
double slot_duration
 
double start_time
 
UwTDMATimer tdma_timer
 
std::deque< Packet * > buffer
 
std::ofstream out_file_stats
 
bool enable
 
int max_queue_size
 
int max_packet_per_slot
 
int packet_sent_curr_slot_
 
int drop_old_
 
std::string name_label_
 
int checkPriority
 

Friends

class UwTDMATimer
 

Detailed Description

Class that represents a TDMA Node.

Definition at line 91 of file uwtdma.h.

Member Enumeration Documentation

◆ UWTDMA_STATUS

enum UwTDMA::UWTDMA_STATUS
protected

Enumeration class of UWTDMA status.

Enumerator
IDLE 
TRANSMITTING 
RECEIVING 

Definition at line 206 of file uwtdma.h.

Constructor & Destructor Documentation

◆ UwTDMA()

UwTDMA::UwTDMA ( )

Constructor of the TDMA class.

Definition at line 79 of file uwtdma.cpp.

◆ ~UwTDMA()

UwTDMA::~UwTDMA ( )
virtual

Destructor of the TDMA class.

Definition at line 140 of file uwtdma.cpp.

Member Function Documentation

◆ changeStatus()

void UwTDMA::changeStatus ( )
protectedvirtual

Alternate TDMA status between MY_STATUS and NOT_MY_STATUS.

Reimplemented in UwTDMA_frame.

Definition at line 359 of file uwtdma.cpp.

◆ command()

int UwTDMA::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.

Reimplemented in UwTDMA_frame, and UwRangingTDMA.

Definition at line 423 of file uwtdma.cpp.

◆ getEpoch()

unsigned long int UwTDMA::getEpoch ( )
inlineprotected

Calculate the epoch of the event.

Used in sea-trial mode

Returns
the epoch of the system

Definition at line 186 of file uwtdma.h.

◆ initPkt()

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

Definition at line 341 of file uwtdma.cpp.

◆ Mac2PhyStartTx()

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

Reimplemented in UwRangingTDMA.

Definition at line 236 of file uwtdma.cpp.

◆ Phy2MacEndRx()

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

Reimplemented in UwRangingTDMA.

Definition at line 281 of file uwtdma.cpp.

◆ Phy2MacEndTx()

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

Method called when the Mac Layer finish to transmit a Packet.

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

Definition at line 258 of file uwtdma.cpp.

◆ Phy2MacStartRx()

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

Reimplemented in UwRangingTDMA.

Definition at line 271 of file uwtdma.cpp.

◆ recvFromUpperLayers()

void UwTDMA::recvFromUpperLayers ( Packet *  p)
protectedvirtual

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

IP)

Parameters
Packet*pointer to the packet received

Definition at line 145 of file uwtdma.cpp.

◆ recvSyncClMsg()

int UwTDMA::recvSyncClMsg ( ClMessage *  m)
virtual

Cross-Layer messages synchronous interpreter.

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

Definition at line 507 of file uwtdma.cpp.

◆ rxPacketNotForMe()

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

Definition at line 352 of file uwtdma.cpp.

◆ start()

void UwTDMA::start ( double  delay)
protectedvirtual

Schedule the beginning of each TDMA cycle, each one after delay.

Parameters
delayto await before starting the TDMA

Definition at line 389 of file uwtdma.cpp.

◆ stateTxData()

void UwTDMA::stateTxData ( )
protectedvirtual

Change transceiver status and and start to transmit if in my slot Used when there's spare time, useful for transmitting other packtes.

Reimplemented in UwRangingTDMA.

Definition at line 195 of file uwtdma.cpp.

◆ stop()

void UwTDMA::stop ( )
protectedvirtual

Terminate a TDMA cycle, essentially cancel the TDMA timer.

Definition at line 412 of file uwtdma.cpp.

◆ txData()

void UwTDMA::txData ( )
protectedvirtual

Transmit a data packet if in my slot.

Definition at line 203 of file uwtdma.cpp.

Friends And Related Symbol Documentation

◆ UwTDMATimer

friend class UwTDMATimer
friend

Definition at line 94 of file uwtdma.h.

Member Data Documentation

◆ buffer

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

Buffer of the MAC node.

Definition at line 227 of file uwtdma.h.

◆ checkPriority

int UwTDMA::checkPriority
protected

flag to set to 1 if UWCBR module uses packets with priority, set to 0 otherwise.

Priority can be used only with UWCBR module

Definition at line 238 of file uwtdma.h.

◆ debug_

int UwTDMA::debug_
protected

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

Definition at line 211 of file uwtdma.h.

◆ drop_old_

int UwTDMA::drop_old_
protected

flag to set the drop packet policy in case of buffer overflow: if 0 (default) drops the new packet, if 1 the oldest

Definition at line 235 of file uwtdma.h.

◆ enable

bool UwTDMA::enable
protected

Definition at line 229 of file uwtdma.h.

◆ fair_mode

int UwTDMA::fair_mode
protected

Fair modality on if 1: then only set tot_slots and common guard_time.

Definition at line 214 of file uwtdma.h.

◆ frame_duration

double UwTDMA::frame_duration
protected

Frame duration.

Definition at line 222 of file uwtdma.h.

◆ guard_time

double UwTDMA::guard_time
protected

Guard time between slots.

Definition at line 223 of file uwtdma.h.

◆ HDR_size

int UwTDMA::HDR_size
protected

Size of the HDR if any.

Definition at line 221 of file uwtdma.h.

◆ max_packet_per_slot

int UwTDMA::max_packet_per_slot
protected

max numer of packet it can transmit per slot

Definition at line 232 of file uwtdma.h.

◆ max_queue_size

int UwTDMA::max_queue_size
protected

Maximum dimension of Queue.

Definition at line 231 of file uwtdma.h.

◆ name_label_

std::string UwTDMA::name_label_
protected

label added in the log file, empty string by default

Definition at line 237 of file uwtdma.h.

◆ out_file_stats

std::ofstream UwTDMA::out_file_stats
protected

File stream for the log file.

Definition at line 228 of file uwtdma.h.

◆ packet_sent_curr_slot_

int UwTDMA::packet_sent_curr_slot_
protected

counter of packet has been sent in the current slot

Definition at line 233 of file uwtdma.h.

◆ sea_trial_

int UwTDMA::sea_trial_
protected

Written log variable.

Definition at line 213 of file uwtdma.h.

◆ slot_duration

double UwTDMA::slot_duration
protected

Slot duration.

Definition at line 224 of file uwtdma.h.

◆ slot_number

int UwTDMA::slot_number
protected

set the position of the node in the frame (fair_mode) (starting from 0 to tot_slots-1)

Definition at line 218 of file uwtdma.h.

◆ slot_status

int UwTDMA::slot_status
protected

Is it my turn to transmit data?

Definition at line 210 of file uwtdma.h.

◆ start_time

double UwTDMA::start_time
protected

Time to wait before starting the protocol.

Definition at line 225 of file uwtdma.h.

◆ tdma_timer

UwTDMATimer UwTDMA::tdma_timer
protected

TDMA timer handler.

Definition at line 226 of file uwtdma.h.

◆ tot_slots

int UwTDMA::tot_slots
protected

Number of slots in the frame (fair_mode)

Definition at line 217 of file uwtdma.h.

◆ transceiver_status

UWTDMA_STATUS UwTDMA::transceiver_status
protected

Variable holding the status enum type.

Definition at line 209 of file uwtdma.h.


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