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

#include <uwranging_tdma.h>

Inheritance diagram for UwRangingTDMA:
Collaboration diagram for UwRangingTDMA:

Public Member Functions

 UwRangingTDMA ()
 
virtual ~UwRangingTDMA ()
 
- Public Member Functions inherited from UwTDMA
 UwTDMA ()
 
virtual ~UwTDMA ()
 
virtual int recvSyncClMsg (ClMessage *m)
 

Protected Member Functions

virtual void sendRange ()
 
virtual void stateTxData ()
 
virtual void Phy2MacEndRx (Packet *p)
 
virtual void Phy2MacStartRx (const Packet *p)
 
virtual void Mac2PhyStartTx (Packet *p)
 
virtual int command (int argc, const char *const *argv)
 
- Protected Member Functions inherited from UwTDMA
virtual void txData ()
 
virtual void changeStatus ()
 
virtual void start (double delay)
 
virtual void stop ()
 
virtual void recvFromUpperLayers (Packet *p)
 
virtual void Phy2MacEndTx (const Packet *p)
 
virtual void rxPacketNotForMe (Packet *p)
 
virtual void initPkt (Packet *p)
 
unsigned long int getEpoch ()
 

Protected Attributes

int node_id
 
int slot_id
 
int n_nodes
 
int slotidmax
 
std::vector< double > owtt_vec
 
std::vector< std::vector< int > > owtt_map
 
- Protected Attributes inherited from UwTDMA
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
 

Static Protected Attributes

static int count_nodes = 0
 

Additional Inherited Members

- Protected Types inherited from UwTDMA
enum  UWTDMA_STATUS { IDLE , TRANSMITTING , RECEIVING }
 

Detailed Description

Class that represents a UwRangingTDMA Node.

Definition at line 48 of file uwranging_tdma.h.

Constructor & Destructor Documentation

◆ UwRangingTDMA()

UwRangingTDMA::UwRangingTDMA ( )

Constructor of the UwRangingTDMA class.

Definition at line 79 of file uwranging_tdma.cpp.

◆ ~UwRangingTDMA()

UwRangingTDMA::~UwRangingTDMA ( )
virtual

Destructor of the UwRangingTDMA class.

Definition at line 112 of file uwranging_tdma.cpp.

Member Function Documentation

◆ command()

int UwRangingTDMA::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
Returns
TCL_OK or TCL_ERROR

Reimplemented from UwTDMA.

Definition at line 212 of file uwranging_tdma.cpp.

◆ Mac2PhyStartTx()

void UwRangingTDMA::Mac2PhyStartTx ( Packet *  p)
protectedvirtual

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

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

Reimplemented from UwTDMA.

Definition at line 201 of file uwranging_tdma.cpp.

◆ Phy2MacEndRx()

void UwRangingTDMA::Phy2MacEndRx ( Packet *  p)
protectedvirtual

Method called when the Phy Layer finish to receive a Packet.

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

Reimplemented from UwTDMA.

Definition at line 166 of file uwranging_tdma.cpp.

◆ Phy2MacStartRx()

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

Method called when the Phy Layer start to receive a Packet.

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

Reimplemented from UwTDMA.

Definition at line 159 of file uwranging_tdma.cpp.

◆ sendRange()

void UwRangingTDMA::sendRange ( )
protectedvirtual

sends the ranging packet at the beginning of my slot

Definition at line 117 of file uwranging_tdma.cpp.

◆ stateTxData()

void UwRangingTDMA::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 from UwTDMA.

Definition at line 152 of file uwranging_tdma.cpp.

Member Data Documentation

◆ count_nodes

int UwRangingTDMA::count_nodes = 0
staticprotected

counts the instantiated nodes, used for assigning node ids in default contructor

Definition at line 101 of file uwranging_tdma.h.

◆ n_nodes

int UwRangingTDMA::n_nodes
protected

number of nodes

Definition at line 104 of file uwranging_tdma.h.

◆ node_id

int UwRangingTDMA::node_id
protected

id of the node (0 to n_nodes-1)

Definition at line 102 of file uwranging_tdma.h.

◆ owtt_map

std::vector<std::vector<int> > UwRangingTDMA::owtt_map
protected

of size [n_nodes][n_nodes] maps(nodeX,nodeY) -> owtt_vec index

Definition at line 108 of file uwranging_tdma.h.

◆ owtt_vec

std::vector<double> UwRangingTDMA::owtt_vec
protected

vector of lenght D = n_nodes*(n_nodes-1)/2 + 1 where the one way travel times are stored

Definition at line 107 of file uwranging_tdma.h.

◆ slot_id

int UwRangingTDMA::slot_id
protected

= node_id + k*n_nodes; slot_id value is written in the outgoing ranging packet then k is incremented

Definition at line 103 of file uwranging_tdma.h.

◆ slotidmax

int UwRangingTDMA::slotidmax
protected

maximum slot_id allowable in packet header

Definition at line 105 of file uwranging_tdma.h.


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