DESERT 4.0.0
UwPosBasedRtROV Class Reference

#include <uwPosBasedRtROV.h>

Inheritance diagram for UwPosBasedRtROV:
Inheritance graph
Collaboration diagram for UwPosBasedRtROV:
Collaboration graph

Public Member Functions

 UwPosBasedRtROV ()
 
virtual ~UwPosBasedRtROV ()
 

Protected Member Functions

virtual int command (int, const char *const *)
 
virtual void recv (Packet *p)
 
virtual void initPkt (Packet *p)
 
virtual uint8_t findNextHop (const Packet *p)
 
virtual void setMaxTxRange (double newRange)
 

Private Types

typedef std::pair< Position, uint8_t > pair_posIP
 

Private Member Functions

virtual double nodesDistance (Position &p1, Position &p2)
 

Private Attributes

uint8_t ipAddr
 
double maxTxRange
 
UWSMPositionROV_pos
 
std::list< pair_posIPlist_posIP
 
int debug_
 

Member Typedef Documentation

◆ pair_posIP

typedef std::pair<Position, uint8_t> UwPosBasedRtROV::pair_posIP
private

Constructor & Destructor Documentation

◆ UwPosBasedRtROV()

UwPosBasedRtROV::UwPosBasedRtROV ( )

Constructor of UwPosBasedRtROV class

References debug_, and maxTxRange.

◆ ~UwPosBasedRtROV()

UwPosBasedRtROV::~UwPosBasedRtROV ( )
virtual

Destructor of UwPosBasedRtROV class

Member Function Documentation

◆ command()

int UwPosBasedRtROV::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 UWSMPosition::getX(), UWSMPosition::getY(), UWSMPosition::getZ(), ipAddr, list_posIP, ROV_pos, and setMaxTxRange().

Here is the call graph for this function:

◆ findNextHop()

uint8_t UwPosBasedRtROV::findNextHop ( const Packet *  p)
protectedvirtual

Find next hop of a packet passed as input

Parameters
Packet*Pointer to the packet will be received.

References debug_, ipAddr, list_posIP, maxTxRange, nodesDistance(), and ROV_pos.

Referenced by recv().

Here is the call graph for this function:

◆ initPkt()

void UwPosBasedRtROV::initPkt ( Packet *  p)
protectedvirtual

Initialize field of hdr_uwpos_based_rt

Parameters
Packet*Pointer to the packet will be received.

References debug_, UWSMPosition::getSpeed(), UWSMPosition::getX(), UWSMPosition::getXdest(), UWSMPosition::getY(), UWSMPosition::getYdest(), UWSMPosition::getZ(), UWSMPosition::getZdest(), ipAddr, and ROV_pos.

Referenced by recv().

Here is the call graph for this function:

◆ nodesDistance()

double UwPosBasedRtROV::nodesDistance ( Position &  p1,
Position &  p2 
)
privatevirtual

Compute absoulute distance between 2 nodes

Parameters
Positionposition first node.
Positionposition second node.

Referenced by findNextHop().

◆ recv()

void UwPosBasedRtROV::recv ( Packet *  p)
protectedvirtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.

References hdr_uwip::daddr(), debug_, findNextHop(), initPkt(), and ipAddr.

Here is the call graph for this function:

◆ setMaxTxRange()

void UwPosBasedRtROV::setMaxTxRange ( double  newRange)
protectedvirtual

Set maximum transmission range

Parameters
floatNew value for transmission range.

References debug_, ipAddr, and maxTxRange.

Referenced by command().

Member Data Documentation

◆ debug_

int UwPosBasedRtROV::debug_
private

Flag to enable or disable dirrefent levels of debug.

Referenced by findNextHop(), initPkt(), recv(), setMaxTxRange(), and UwPosBasedRtROV().

◆ ipAddr

uint8_t UwPosBasedRtROV::ipAddr
private

◆ list_posIP

std::list<pair_posIP> UwPosBasedRtROV::list_posIP
private

List with position of all the other nodes with its IP.

Referenced by command(), and findNextHop().

◆ maxTxRange

double UwPosBasedRtROV::maxTxRange
private

Maximum transmission range, in meters, for this node.

Referenced by findNextHop(), setMaxTxRange(), and UwPosBasedRtROV().

◆ ROV_pos

UWSMPosition* UwPosBasedRtROV::ROV_pos
private

Pointer to ROV position. Give ROV position via TCL command.

Referenced by command(), findNextHop(), and initPkt().


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