DESERT 4.0.0
UwPosBasedRt Class Reference

#include <uwPosBasedRt.h>

Inheritance diagram for UwPosBasedRt:
Inheritance graph
Collaboration diagram for UwPosBasedRt:
Collaboration graph

Public Member Functions

 UwPosBasedRt ()
 
virtual ~UwPosBasedRt ()
 

Protected Member Functions

virtual int command (int, const char *const *)
 
virtual void recv (Packet *p)
 
virtual void initPkt (Packet *p)
 
virtual void updatePosInfo (Packet *p)
 
virtual uint8_t findNextHop (const Packet *p)
 
virtual void addRoute (const uint8_t &dst, const uint8_t &next, const int toFixedNode)
 
virtual void setMaxTxRange (double newRange)
 

Private Member Functions

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

Private Attributes

uint8_t ipAddr
 
double timestamp
 
double ROV_speed
 
double maxTxRange
 
Position node_pos
 
std::map< uint8_t, uint8_t > static_routing
 
std::map< uint8_t, UwPosEstimationROV_routing
 
int debug_
 

Constructor & Destructor Documentation

◆ UwPosBasedRt()

UwPosBasedRt::UwPosBasedRt ( )

Constructor of UwPosBasedRt class

References debug_, maxTxRange, ROV_speed, and static_routing.

◆ ~UwPosBasedRt()

UwPosBasedRt::~UwPosBasedRt ( )
virtual

Destructor of UwPosBasedRt class

Member Function Documentation

◆ addRoute()

void UwPosBasedRt::addRoute ( const uint8_t &  dst,
const uint8_t &  next,
const int  toFixedNode 
)
protectedvirtual

Add new entry to the routing table

Parameters
uint8_tAddress of the destination.
uint8_tAddress of the next hop.
intParameter to find if the dest address is a static node or a vehicle

References debug_, ipAddr, ROV_routing, and static_routing.

Referenced by command().

◆ command()

int UwPosBasedRt::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 addRoute(), ipAddr, node_pos, and setMaxTxRange().

Here is the call graph for this function:

◆ findNextHop()

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

Find next hop of a packet passed as input

Parameters
Packet*Pointer to the packet will be received.

References hdr_uwip::daddr(), debug_, ipAddr, maxTxRange, node_pos, nodesDistance(), ROV_routing, and static_routing.

Referenced by recv().

Here is the call graph for this function:

◆ initPkt()

void UwPosBasedRt::initPkt ( Packet *  p)
protectedvirtual

◆ nodesDistance()

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

Compute absoulute distance between 2 nodes

Parameters
Positionposition first node.
Positionposition second node.

Referenced by findNextHop().

◆ recv()

void UwPosBasedRt::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(), ipAddr, and updatePosInfo().

Here is the call graph for this function:

◆ setMaxTxRange()

void UwPosBasedRt::setMaxTxRange ( double  newRange)
protectedvirtual

Set maximum transmission range

Parameters
floatNew value for transmission range.

References debug_, ipAddr, and maxTxRange.

Referenced by command().

◆ updatePosInfo()

void UwPosBasedRt::updatePosInfo ( Packet *  p)
protectedvirtual

update informations regardin position, if needed

Parameters
Packet*Pointer to the packet will be received.

References debug_, hdr_uwpos_based_rt::IP_ROV(), ipAddr, ROV_routing, hdr_uwpos_based_rt::ROV_speed(), hdr_uwpos_based_rt::timestamp(), hdr_uwpos_based_rt::x_ROV(), hdr_uwpos_based_rt::x_waypoint(), hdr_uwpos_based_rt::y_ROV(), hdr_uwpos_based_rt::y_waypoint(), hdr_uwpos_based_rt::z_ROV(), and hdr_uwpos_based_rt::z_waypoint().

Referenced by recv().

Here is the call graph for this function:

Member Data Documentation

◆ debug_

int UwPosBasedRt::debug_
private

Flag to enable or disable dirrefent levels of debug.

Referenced by addRoute(), findNextHop(), initPkt(), recv(), setMaxTxRange(), updatePosInfo(), and UwPosBasedRt().

◆ ipAddr

uint8_t UwPosBasedRt::ipAddr
private

◆ maxTxRange

double UwPosBasedRt::maxTxRange
private

Maximum transmission range, in meters, for this node.

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

◆ node_pos

Position UwPosBasedRt::node_pos
private

Position of this node

Referenced by command(), and findNextHop().

◆ ROV_routing

std::map<uint8_t, UwPosEstimation> UwPosBasedRt::ROV_routing
private

Rouitng table for ROV.

Referenced by addRoute(), findNextHop(), initPkt(), and updatePosInfo().

◆ ROV_speed

double UwPosBasedRt::ROV_speed
private

Last known ROV speed.

Referenced by UwPosBasedRt().

◆ static_routing

std::map<uint8_t, uint8_t> UwPosBasedRt::static_routing
private

Routing table: destination - next hop.

Referenced by addRoute(), findNextHop(), and UwPosBasedRt().

◆ timestamp

double UwPosBasedRt::timestamp
private

Timestamp for the validity of last received ROV position.


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