DESERT 4.0.0
UwROVModule Class Reference

#include <uwrov-module.h>

Inheritance diagram for UwROVModule:
Inheritance graph
Collaboration diagram for UwROVModule:
Collaboration graph

Public Member Functions

 UwROVModule ()
 
virtual ~UwROVModule ()=default
 
virtual int command (int argc, const char *const *argv) override
 
virtual void initPkt (Packet *p) override
 
virtual void recv (Packet *) override
 
virtual void recv (Packet *p, Handler *h) override
 
virtual void sendAck ()
 
- Public Member Functions inherited from UwCbrModule
 UwCbrModule ()
 
virtual ~UwCbrModule ()=default
 
virtual double GetRTT () const
 
virtual double GetFTT () const
 
virtual double GetTxTime () const
 
virtual double GetPER () const
 
virtual double GetTHR () const
 
virtual double GetRTTstd () const
 
virtual double GetFTTstd () const
 
virtual void resetStats ()
 
void printIdsPkts () const
 

Static Public Member Functions

static int getROVMonHeaderSize ()
 
static int getROVCTRHeaderSize ()
 

Protected Types

enum  UWROV_ACK_POLICY { ACK_PIGGYBACK , ACK_IMMEDIATELY , ACK_PGBK_OR_TO }
 

Protected Attributes

int last_sn_confirmed
 
int ack
 
int ackPriority
 
int ackNotPgbk
 
int drop_old_waypoints
 
int ackTimeout
 
UWSMPositionposit
 
UwROVSendAckTimer ackTimer_
 
UWROV_ACK_POLICY ackPolicy
 
int log_flag
 
std::ofstream out_file_stats
 
- Protected Attributes inherited from UwCbrModule
uint16_t dstPort_
 
std::string log_suffix
 
nsaddr_t dstAddr_
 
char priority_
 
std::ofstream tracefile
 
std::string tracefilename
 
bool * sn_check
 
int PoissonTraffic_
 
int debug_
 
int drop_out_of_order_
 
uint traffic_type_
 
UwSendTimer sendTmr_
 
int txsn
 
int hrsn
 
int pkts_recv
 
int pkts_ooseq
 
int pkts_lost
 
int pkts_invalid
 
int pkts_last_reset
 
int cnt
 
double rftt
 
double srtt
 
double sftt
 
double lrtime
 
double sthr
 
double period_
 
int pktSize_
 
double sumrtt
 
double sumrtt2
 
int rttsamples
 
double sumftt
 
double sumftt2
 
int fttsamples
 
double sumtxtimes = 0
 
double sumbytes
 
double sumdt
 
uint32_t esn
 
int tracefile_enabler_
 

Friends

class UwROVSendAckTimer
 

Additional Inherited Members

- Protected Member Functions inherited from UwCbrModule
virtual void sendPkt ()
 
virtual void sendPktLowPriority ()
 
virtual void sendPktHighPriority ()
 
virtual void transmit ()
 
virtual void start ()
 
virtual void stop ()
 
virtual void updateRTT (const double &)
 
virtual void updateFTT (const double &)
 
virtual void updateThroughput (const int &, const double &)
 
virtual void incrPktLost (const int &)
 
virtual void incrPktRecv ()
 
virtual void incrPktOoseq ()
 
virtual void incrPktInvalid ()
 
virtual double getTimeBeforeNextPkt ()
 
virtual void printReceivedPacket (Packet *p)
 
- Static Protected Member Functions inherited from UwCbrModule
static int getCbrHeaderSize ()
 
- Static Protected Attributes inherited from UwCbrModule
static int uidcnt_ = 0
 

Detailed Description

UwROVModule class is used to manage UWROV packets and to collect statistics about them.

Member Enumeration Documentation

◆ UWROV_ACK_POLICY

Enumerator
ACK_PIGGYBACK 
ACK_IMMEDIATELY 
ACK_PGBK_OR_TO 

Constructor & Destructor Documentation

◆ UwROVModule()

UwROVModule::UwROVModule ( )

Default Constructor of UwROVModule class.

References ackPriority, ackTimeout, drop_old_waypoints, and log_flag.

◆ ~UwROVModule()

virtual UwROVModule::~UwROVModule ( )
virtualdefault

Destructor of UwROVModule class.

Member Function Documentation

◆ command()

int UwROVModule::command ( int  argc,
const char *const *  argv 
)
overridevirtual

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 from UwCbrModule.

References ACK_IMMEDIATELY, ACK_PGBK_OR_TO, ACK_PIGGYBACK, ackNotPgbk, ackPolicy, ackPriority, ackTimeout, UwCbrModule::command(), getROVCTRHeaderSize(), getROVMonHeaderSize(), UWSMPosition::getX(), UWSMPosition::getY(), UWSMPosition::getZ(), posit, and UWSMPosition::setdest().

Here is the call graph for this function:

◆ getROVCTRHeaderSize()

static int UwROVModule::getROVCTRHeaderSize ( )
inlinestatic

Returns the size in byte of a hdr_uwROV_ctr packet header.

Returns
The size of a hdr_uwROV_ctr packet header.

Referenced by command().

◆ getROVMonHeaderSize()

static int UwROVModule::getROVMonHeaderSize ( )
inlinestatic

Returns the size in byte of a hdr_uwROV_monitoring packet header.

Returns
The size of a hdr_uwROV_monitoring packet header.

Referenced by command().

◆ initPkt()

void UwROVModule::initPkt ( Packet *  p)
overridevirtual

Initializes a monitoring data packet passed as argument with the default values.

Parameters
Packet*Pointer to a packet already allocated to fill with the right values.

Reimplemented from UwCbrModule.

References ack, hdr_uwROV_monitoring::ack(), ackTimer_, UwCbrModule::debug_, UWSMPosition::getX(), UWSMPosition::getY(), UWSMPosition::getZ(), UwCbrModule::initPkt(), posit, hdr_uwcbr::priority(), UwCbrModule::priority_, hdr_uwROV_monitoring::x(), hdr_uwROV_monitoring::y(), and hdr_uwROV_monitoring::z().

Here is the call graph for this function:

◆ recv() [1/2]

void UwROVModule::recv ( Packet *  p)
overridevirtual

◆ recv() [2/2]

void UwROVModule::recv ( Packet *  p,
Handler *  h 
)
overridevirtual

Performs the reception of packets from upper and lower layers.

Parameters
Packet*Pointer to the packet will be received.
Handler*Handler.

Reimplemented from UwCbrModule.

References recv().

Here is the call graph for this function:

◆ sendAck()

void UwROVModule::sendAck ( )
virtual

Sends ACK if ackTimeout expire;

References ackNotPgbk, ackPriority, UwCbrModule::debug_, UwCbrModule::sendPkt(), and UwCbrModule::sendPktHighPriority().

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ UwROVSendAckTimer

friend class UwROVSendAckTimer
friend

Member Data Documentation

◆ ack

int UwROVModule::ack
protected

If not zero, contains the ACK to the last command packet received.

Referenced by initPkt(), and recv().

◆ ackNotPgbk

int UwROVModule::ackNotPgbk
protected

Referenced by command(), and sendAck().

◆ ackPolicy

UWROV_ACK_POLICY UwROVModule::ackPolicy
protected

Flag to set the policy for ACK transimission, ACK_PIGGYBACK: ACK is always sent in piggyback, ACK_IMMEDIATELY: ACK is always sent immediately with a dedicated packet after the reception of CTR packet, ACK_PGBK_OR_TO: ACK is sent in piggyback if a ROV packet is generated before an ackTimeout otherwise ACK is sent with a dedicated packet after the acKTimeout.

Referenced by command(), and recv().

◆ ackPriority

int UwROVModule::ackPriority
protected

Flag to give higher priority to ACK or not.

Referenced by command(), recv(), sendAck(), and UwROVModule().

◆ ackTimeout

int UwROVModule::ackTimeout
protected

< Flag set to 1 to drop waypoints with sequence number lower or equal than last_sn_confirmed. Timeout after which ACK is sent if ackPolicy = ACK_PGBK_OR_TO.

Referenced by command(), recv(), and UwROVModule().

◆ ackTimer_

UwROVSendAckTimer UwROVModule::ackTimer_
protected

Timer to schedule ACK transmission.

Referenced by initPkt(), and recv().

◆ drop_old_waypoints

int UwROVModule::drop_old_waypoints
protected

< Number of ACK not sent in piggyback when ackPolicy = 2.

Referenced by recv(), and UwROVModule().

◆ last_sn_confirmed

int UwROVModule::last_sn_confirmed
protected

Sequence number of the last command packet received.

Referenced by recv().

◆ log_flag

int UwROVModule::log_flag
protected

Flag to enable log file writing.

Referenced by recv(), and UwROVModule().

◆ out_file_stats

std::ofstream UwROVModule::out_file_stats
protected

Output stream for the textual file of debug

Referenced by recv().

◆ posit

UWSMPosition* UwROVModule::posit
protected

ROV position.

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


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