DESERT 4.0.0
UwRangingTDMA Class Reference

#include <uwranging_tdma.h>

Inheritance diagram for UwRangingTDMA:
Inheritance graph
Collaboration diagram for UwRangingTDMA:
Collaboration graph

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

Constructor & Destructor Documentation

◆ UwRangingTDMA()

UwRangingTDMA::UwRangingTDMA ( )

◆ ~UwRangingTDMA()

UwRangingTDMA::~UwRangingTDMA ( )
virtual

Destructor of the UwRangingTDMA class

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.

References UwTDMA::command(), n_nodes, owtt_map, and owtt_vec.

Here is the call graph for this function:

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

References UwTDMA::sea_trial_, UwTDMA::transceiver_status, and UwTDMA::TRANSMITTING.

Referenced by sendRange().

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

References UwTDMA::IDLE, n_nodes, node_id, owtt_map, owtt_vec, UwTDMA::Phy2MacEndRx(), PT_UWRANGING_TDMA, UwTDMA::slot_duration, hdr_ranging_tdma::slotId(), slotidmax, hdr_ranging_tdma::times(), UwTDMA::transceiver_status, and UwTDMA::TRANSMITTING.

Here is the call graph for this function:

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

References UwTDMA::IDLE, UwTDMA::RECEIVING, and UwTDMA::transceiver_status.

◆ sendRange()

void UwRangingTDMA::sendRange ( )
protectedvirtual

sends the ranging packet at the beginning of my slot

References hdr_ranging_tdma::getSize(), Mac2PhyStartTx(), n_nodes, node_id, owtt_map, owtt_vec, PT_UWRANGING_TDMA, slot_id, hdr_ranging_tdma::slotId(), slotidmax, and hdr_ranging_tdma::times().

Referenced by stateTxData().

Here is the call graph for this function:

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

References sendRange().

Here is the call graph for this function:

Member Data Documentation

◆ count_nodes

int UwRangingTDMA::count_nodes = 0
staticprotected

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

Referenced by UwRangingTDMA().

◆ n_nodes

int UwRangingTDMA::n_nodes
protected

number of nodes

Referenced by command(), Phy2MacEndRx(), sendRange(), and UwRangingTDMA().

◆ node_id

int UwRangingTDMA::node_id
protected

id of the node (0 to n_nodes-1)

Referenced by Phy2MacEndRx(), sendRange(), and UwRangingTDMA().

◆ owtt_map

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

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

Referenced by command(), Phy2MacEndRx(), sendRange(), and UwRangingTDMA().

◆ 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

Referenced by command(), Phy2MacEndRx(), sendRange(), and UwRangingTDMA().

◆ 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

Referenced by sendRange().

◆ slotidmax

int UwRangingTDMA::slotidmax
protected

maximum slot_id allowable in packet header

Referenced by Phy2MacEndRx(), and sendRange().


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