DESERT 4.0.0
UwMultiStackControllerPhyMaster Class Reference

#include <uwmulti-stack-controller-phy-master.h>

Inheritance diagram for UwMultiStackControllerPhyMaster:
Inheritance graph
Collaboration diagram for UwMultiStackControllerPhyMaster:
Collaboration graph

Classes

class  UwMultiStackSignalingTimer
 

Public Member Functions

 UwMultiStackControllerPhyMaster ()
 
virtual ~UwMultiStackControllerPhyMaster ()
 
virtual int command (int, const char *const *)
 
virtual void recv (Packet *p, int idSrc)
 
- Public Member Functions inherited from UwMultiStackControllerPhy
 UwMultiStackControllerPhy ()
 
virtual ~UwMultiStackControllerPhy ()
 
- Public Member Functions inherited from UwMultiStackController
 UwMultiStackController ()
 
virtual ~UwMultiStackController ()
 
virtual void addLayer (int id, int order)
 
virtual void addThreshold (int i, int j, double thres_ij)
 
virtual void recv (Packet *p)
 
int getOrder (int layer_id)
 
int getId (int layer_order)
 

Protected Member Functions

virtual int getBestLayer (Packet *p)
 
virtual void checkAndSignal ()
 
virtual void resetCheckAndSignal ()
 
virtual int checkBestLayer ()
 
virtual void signalsBestPhy ()
 
int recvSyncClMsg (ClMessage *m)
 
virtual void updateMasterStatistics (Packet *p, int idSrc)
 
int getShorterRangeLayer (int layer_id)
 
int getLongerRangeLayer (int layer_id)
 
- Protected Member Functions inherited from UwMultiStackControllerPhy
virtual void initInfo ()
 
virtual void stateIdle ()
 
virtual void stateBusy2Rx (int id)
 
virtual void stateBusy2Tx (Packet *p)
 
- Protected Member Functions inherited from UwMultiStackController
virtual void recvFromUpperLayers (Packet *p)
 
virtual bool isLayerAvailable (int id)
 
virtual double getMetricFromSelectedLowerLayer (int id, Packet *p)
 
virtual bool getThreshold (int i, int j, double &thres_ij)
 
virtual void eraseThreshold (int i, int j)
 
void setThreshold (int i, int j, double thres_ij)
 

Protected Attributes

int signaling_active_
 
int last_layer_used_
 
double power_statistics_
 
int power_stat_node_
 
double alpha_
 
double signaling_period_
 
int signaling_sent_
 
UwMultiStackSignalingTimer signaling_timer_
 
- Protected Attributes inherited from UwMultiStackControllerPhy
int receiving_id
 
UWPHY_CONTROLLER_STATE current_state
 
- Protected Attributes inherited from UwMultiStackController
int debug_
 
double min_delay_
 
Mode switch_mode_
 
int lower_id_active_
 
std::map< int, int > id2order
 
ThresMatrix threshold_map
 
std::map< int, int > order2id
 
int signaling_pktSize_
 

Additional Inherited Members

- Static Public Attributes inherited from UwMultiStackController
static int const layer_not_exist = -1
 
- Protected Types inherited from UwMultiStackControllerPhy
enum  UWPHY_CONTROLLER_STATE { UWPHY_CONTROLLER_STATE_IDLE = 1 , UWPHY_CONTROLLER_STATE_BUSY_2_TX , UWPHY_CONTROLLER_STATE_BUSY_2_RX }
 
- Protected Types inherited from UwMultiStackController
enum  Mode { UW_MANUAL_SWITCH = 0 , UW_AUTOMATIC_SWITCH }
 
- Static Protected Attributes inherited from UwMultiStackControllerPhy
static map< UWPHY_CONTROLLER_STATE, string > state_info
 

Detailed Description

Class used to represents the UwMultiStackControllerPhyMaster layer of a node.

Constructor & Destructor Documentation

◆ UwMultiStackControllerPhyMaster()

UwMultiStackControllerPhyMaster::UwMultiStackControllerPhyMaster ( )

Constructor of UwMultiPhy class.

References alpha_, signaling_active_, and signaling_period_.

◆ ~UwMultiStackControllerPhyMaster()

virtual UwMultiStackControllerPhyMaster::~UwMultiStackControllerPhyMaster ( )
inlinevirtual

Destructor of UwMultiPhy class.

Member Function Documentation

◆ checkAndSignal()

void UwMultiStackControllerPhyMaster::checkAndSignal ( )
protectedvirtual

If signaling is active, check the average power thresholds at each packet received

References checkBestLayer(), last_layer_used_, UwMultiStackController::lower_id_active_, power_statistics_, signaling_active_, and signalsBestPhy().

Referenced by resetCheckAndSignal(), and updateMasterStatistics().

Here is the call graph for this function:

◆ checkBestLayer()

int UwMultiStackControllerPhyMaster::checkBestLayer ( )
protectedvirtual

◆ command()

int UwMultiStackControllerPhyMaster::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.

Reimplemented from UwMultiStackControllerPhy.

References alpha_, UwMultiStackControllerPhy::command(), last_layer_used_, UwMultiStackController::lower_id_active_, signaling_active_, and signaling_sent_.

Here is the call graph for this function:

◆ getBestLayer()

int UwMultiStackControllerPhyMaster::getBestLayer ( Packet *  p)
protectedvirtual

Return the best layer to forward the packet when the system works in AUTOMATIC_MODE. It overloads in the extended classes to implement the choice rule.

Parameters
ppointer to the packet
Returns
id of the module representing the best layer

Reimplemented from UwMultiStackController.

References checkBestLayer(), last_layer_used_, UwMultiStackController::lower_id_active_, power_statistics_, signaling_active_, UwMultiStackController::switch_mode_, and UwMultiStackController::UW_AUTOMATIC_SWITCH.

Here is the call graph for this function:

◆ getLongerRangeLayer()

int UwMultiStackControllerPhyMaster::getLongerRangeLayer ( int  layer_id)
inlineprotected

Return the previous layer in order which can achieve longer range with lower bitrete.

Parameters
layer_idid of the current layer
Returns
id of the previous layer in order

References UwMultiStackController::getId(), UwMultiStackController::getOrder(), and UwMultiStackController::layer_not_exist.

Referenced by checkBestLayer().

Here is the call graph for this function:

◆ getShorterRangeLayer()

int UwMultiStackControllerPhyMaster::getShorterRangeLayer ( int  layer_id)
inlineprotected

Return the next layer in order which can achieve shorter range with higer bitrete.

Parameters
layer_idid of the current layer
Returns
id of the next layer in order

References UwMultiStackController::getId(), UwMultiStackController::getOrder(), and UwMultiStackController::layer_not_exist.

Referenced by checkBestLayer().

Here is the call graph for this function:

◆ recv()

void UwMultiStackControllerPhyMaster::recv ( Packet *  p,
int  idSrc 
)
virtual

It manages each packet reception, either from the upper and the lower layer

Parameters
ppointer to the packet will be received
idSrcunique id of the module that has sent the packet
See also
SAP, ChSAP

Reimplemented from UwMultiStackControllerPhy.

References PT_MULTI_ST_SIGNALING, UwMultiStackControllerPhy::recv(), and updateMasterStatistics().

Here is the call graph for this function:

◆ recvSyncClMsg()

int UwMultiStackControllerPhyMaster::recvSyncClMsg ( ClMessage *  m)
protectedvirtual

Cross-Layer messages synchronous interpreter. It has to be properly extended in order to interpret custom cross-layer messages used by this particular plug-in. This type of communication need to be directly answered in the message exchanged in order to be synchronous with the source.

Parameters
man instance of ClMessage that represent the message received and used for the answer
Returns
zero if successful
See also
NodeCore, ClMessage, ClSAP, ClTracer, UwMultiStackControllerPhy

Reimplemented from UwMultiStackControllerPhy.

References PT_MULTI_ST_SIGNALING, and UwMultiStackControllerPhy::recvSyncClMsg().

Here is the call graph for this function:

◆ resetCheckAndSignal()

void UwMultiStackControllerPhyMaster::resetCheckAndSignal ( )
protectedvirtual

If signaling is active and signaling timer expires, check the average power thresholds at each packet received

References checkAndSignal(), UwMultiStackController::debug_, power_stat_node_, power_statistics_, and signaling_active_.

Here is the call graph for this function:

◆ signalsBestPhy()

◆ updateMasterStatistics()

void UwMultiStackControllerPhyMaster::updateMasterStatistics ( Packet *  p,
int  idSrc 
)
protectedvirtual

It implements the slave choice rule to choose the lower layer when the system works in AUTOMATIC_MODE.

Parameters
ppointer to the packet
idSrcunique id of the module that has sent the packet

References alpha_, checkAndSignal(), UwMultiStackController::debug_, UwMultiStackController::lower_id_active_, power_stat_node_, power_statistics_, and signaling_active_.

Referenced by recv().

Here is the call graph for this function:

Member Data Documentation

◆ alpha_

double UwMultiStackControllerPhyMaster::alpha_
protected

Address of the node which the master is collecting the average power IIR parameter

Referenced by command(), updateMasterStatistics(), and UwMultiStackControllerPhyMaster().

◆ last_layer_used_

int UwMultiStackControllerPhyMaster::last_layer_used_
protected

If true master is in signaling mode, otherwise not

Referenced by checkAndSignal(), checkBestLayer(), command(), and getBestLayer().

◆ power_stat_node_

int UwMultiStackControllerPhyMaster::power_stat_node_
protected

Average received power from the closest node according to the IIR filter

Referenced by resetCheckAndSignal(), signalsBestPhy(), and updateMasterStatistics().

◆ power_statistics_

double UwMultiStackControllerPhyMaster::power_statistics_
protected

◆ signaling_active_

int UwMultiStackControllerPhyMaster::signaling_active_
protected

◆ signaling_period_

double UwMultiStackControllerPhyMaster::signaling_period_
protected

◆ signaling_sent_

int UwMultiStackControllerPhyMaster::signaling_sent_
protected

Period to check the best layer if no interactions occurs

Referenced by command(), and signalsBestPhy().

◆ signaling_timer_

UwMultiStackSignalingTimer UwMultiStackControllerPhyMaster::signaling_timer_
protected

Number of signaling packets sent UwMultiStack signaling timer handler

Referenced by checkBestLayer().


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