DESERT 4.0.0
MPhy_WakeUp Class Reference

#include <uw-phy-WakeUp.h>

Inheritance diagram for MPhy_WakeUp:
Inheritance graph
Collaboration diagram for MPhy_WakeUp:
Collaboration graph

Public Member Functions

 MPhy_WakeUp ()
 
virtual ~MPhy_WakeUp ()
 
virtual int getModulationType (Packet *)
 
virtual double getTxDuration (Packet *p)
 
virtual double getPER (double snr, int nbits)
 
virtual int getDroppedPktsTxPending ()
 
virtual int command (int argc, const char *const *argv)
 

Protected Member Functions

virtual void startTx (Packet *p)
 
virtual void endTx (Packet *p)
 
virtual void startRx (Packet *p)
 
virtual void endRx (Packet *p)
 
virtual double getNoisePower (Packet *p)
 
virtual MSpectralMask * getTxSpectralMask (Packet *p)
 
virtual void dropPacket (Packet *p)
 
void incrDroppedPktsTxPending ()
 
virtual void waitForUser ()
 

Protected Attributes

Packet * PktRx
 
bool txActive
 
double AcquisitionThreshold_dB_
 
double ToneDuration_
 
double MaxTxRange_
 
int droppedPktsTxPending
 

Static Protected Attributes

static bool initialized = false
 
static int modid = -1
 

Detailed Description

Class that describes the WakeUp PHY layer for T-LOHI MAC protocol

Constructor & Destructor Documentation

◆ MPhy_WakeUp()

MPhy_WakeUp::MPhy_WakeUp ( )

Class contructor

References AcquisitionThreshold_dB_, initialized, MaxTxRange_, modid, and ToneDuration_.

◆ ~MPhy_WakeUp()

MPhy_WakeUp::~MPhy_WakeUp ( )
virtual

Class destructor

Member Function Documentation

◆ command()

int MPhy_WakeUp::command ( int  argc,
const char *const *  argv 
)
virtual

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 getDroppedPktsTxPending().

Here is the call graph for this function:

◆ dropPacket()

void MPhy_WakeUp::dropPacket ( Packet *  p)
protectedvirtual

Drops a packet

Parameters
Packet*pointer to the packet to drop

Referenced by endRx().

◆ endRx()

void MPhy_WakeUp::endRx ( Packet *  p)
protectedvirtual

Notify to the MAC protocol that the reception is finished and send the packet to it

Parameters
Packet*pointer ot the packet received

References dropPacket(), hdr_wkup::endRx_time, getPER(), modid, PktRx, hdr_wkup::startRx_time, and WKUP_DISCARD.

Here is the call graph for this function:

◆ endTx()

void MPhy_WakeUp::endTx ( Packet *  p)
protectedvirtual

Notify to the MAC protocol that the transmission has been finished

Parameters
Packet*pointer to the packet just transmitted

References txActive.

◆ getDroppedPktsTxPending()

virtual int MPhy_WakeUp::getDroppedPktsTxPending ( )
inlinevirtual

Gets the number of Tx Pending dropped packets

Returns
Number of Tx Pending dropped packets

References droppedPktsTxPending.

Referenced by command().

◆ getModulationType()

int MPhy_WakeUp::getModulationType ( Packet *  )
virtual

Returns the Modulation type

Parameters
Packet*pointer to the packet where get the modulation
Returns
type of the modulation

References initialized, and modid.

◆ getNoisePower()

double MPhy_WakeUp::getNoisePower ( Packet *  p)
protectedvirtual

Returns the Power of the noise for a packet

Parameters
Packet*pointer to the packet where compute the noise
Returns
Noise power in dB

◆ getPER()

double MPhy_WakeUp::getPER ( double  snr,
int  nbits 
)
virtual

Returns the PER for a certain SNR and a dimension of packet

Parameters
doubleSNR
intnbits, dimension of the packet in bit
Returns
PER

Referenced by endRx().

◆ getTxDuration()

virtual double MPhy_WakeUp::getTxDuration ( Packet *  p)
inlinevirtual

Returns the duration of the transmission for the specified packet

Parameters
Packet*pointer to the packet in which compute the Tx Duration
Returns
duration of the Tone

References ToneDuration_.

Referenced by startRx().

◆ getTxSpectralMask()

MSpectralMask * MPhy_WakeUp::getTxSpectralMask ( Packet *  p)
protectedvirtual

Gets the Transmission Spectral Mask for the Packet p

Parameters
Packet*pointer to the packet where get the Spectral Mask
Returns
the pointer of an Object of MSpectralMask that indicates the type of Spectral Mask adopted

◆ incrDroppedPktsTxPending()

void MPhy_WakeUp::incrDroppedPktsTxPending ( )
inlineprotected

Increases the number of packet dropped

References droppedPktsTxPending.

◆ startRx()

void MPhy_WakeUp::startRx ( Packet *  p)
protectedvirtual

Notify to the MAC protocol the start of a reception

Parameters
Packet*pointer to the packet in reception

References AcquisitionThreshold_dB_, hdr_wkup::endRx_time, getTxDuration(), modid, PktRx, hdr_wkup::startRx_time, txActive, WKUP_BELOW_THRESHOLD, and WKUP_DISCARD.

Here is the call graph for this function:

◆ startTx()

void MPhy_WakeUp::startTx ( Packet *  p)
protectedvirtual

Starts to transmit a Packet

Parameters
Packet*pointer to the packet to transmit

References hdr_wkup::endRx_time, PktRx, hdr_wkup::startRx_time, txActive, and WKUP_DISCARD.

◆ waitForUser()

void MPhy_WakeUp::waitForUser ( )
protectedvirtual

Used for debug purposes. Permit a step-by-step behaviour of the PHY layer

Member Data Documentation

◆ AcquisitionThreshold_dB_

double MPhy_WakeUp::AcquisitionThreshold_dB_
protected

How many dB over noise are required for a signal to trigger acquisition (i.e., a RX attempt)

Referenced by MPhy_WakeUp(), and startRx().

◆ droppedPktsTxPending

int MPhy_WakeUp::droppedPktsTxPending
protected

Total number of dropped pkts due to tx pending

Referenced by getDroppedPktsTxPending(), and incrDroppedPktsTxPending().

◆ initialized

bool MPhy_WakeUp::initialized = false
staticprotected

used to register the modulation type only once

Referenced by getModulationType(), and MPhy_WakeUp().

◆ MaxTxRange_

double MPhy_WakeUp::MaxTxRange_
protected

Maximum Transmission Range

Referenced by MPhy_WakeUp().

◆ modid

int MPhy_WakeUp::modid = -1
staticprotected

modulation type id

Referenced by endRx(), getModulationType(), MPhy_WakeUp(), and startRx().

◆ PktRx

Packet* MPhy_WakeUp::PktRx
protected

Pointer to the packeti in reception

Referenced by endRx(), startRx(), and startTx().

◆ ToneDuration_

double MPhy_WakeUp::ToneDuration_
protected

predefined tone duration

Referenced by getTxDuration(), and MPhy_WakeUp().

◆ txActive

bool MPhy_WakeUp::txActive
protected

Referenced by endTx(), startRx(), and startTx().


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