DESERT 3.5.1
Loading...
Searching...
No Matches
UwMultiStackControllerPhyMaster Class Reference

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

Inheritance diagram for UwMultiStackControllerPhyMaster:
Collaboration diagram for UwMultiStackControllerPhyMaster:

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.

Definition at line 52 of file uwmulti-stack-controller-phy-master.h.

Constructor & Destructor Documentation

◆ UwMultiStackControllerPhyMaster()

UwMultiStackControllerPhyMaster::UwMultiStackControllerPhyMaster ( )

Constructor of UwMultiPhy class.

Definition at line 63 of file uwmulti-stack-controller-phy-master.cc.

◆ ~UwMultiStackControllerPhyMaster()

virtual UwMultiStackControllerPhyMaster::~UwMultiStackControllerPhyMaster ( )
inlinevirtual

Destructor of UwMultiPhy class.

Definition at line 64 of file uwmulti-stack-controller-phy-master.h.

Member Function Documentation

◆ checkAndSignal()

void UwMultiStackControllerPhyMaster::checkAndSignal ( )
protectedvirtual

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

Definition at line 151 of file uwmulti-stack-controller-phy-master.cc.

◆ checkBestLayer()

int UwMultiStackControllerPhyMaster::checkBestLayer ( )
protectedvirtual

Check the average power thresholds.

Definition at line 176 of file uwmulti-stack-controller-phy-master.cc.

◆ 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.

Definition at line 80 of file uwmulti-stack-controller-phy-master.cc.

◆ 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.

Definition at line 140 of file uwmulti-stack-controller-phy-master.cc.

◆ 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

Definition at line 185 of file uwmulti-stack-controller-phy-master.h.

◆ 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

Definition at line 174 of file uwmulti-stack-controller-phy-master.h.

◆ 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.

Definition at line 128 of file uwmulti-stack-controller-phy-master.cc.

◆ 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.

Definition at line 237 of file uwmulti-stack-controller-phy-master.cc.

◆ resetCheckAndSignal()

void UwMultiStackControllerPhyMaster::resetCheckAndSignal ( )
protectedvirtual

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

Definition at line 164 of file uwmulti-stack-controller-phy-master.cc.

◆ signalsBestPhy()

void UwMultiStackControllerPhyMaster::signalsBestPhy ( )
protectedvirtual

Signals the best phy.

Definition at line 211 of file uwmulti-stack-controller-phy-master.cc.

◆ 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

Definition at line 254 of file uwmulti-stack-controller-phy-master.cc.

Member Data Documentation

◆ alpha_

double UwMultiStackControllerPhyMaster::alpha_
protected

Address of the node which the master is collecting the average power.

IIR parameter

Definition at line 105 of file uwmulti-stack-controller-phy-master.h.

◆ last_layer_used_

int UwMultiStackControllerPhyMaster::last_layer_used_
protected

If true master is in signaling mode, otherwise not.

Definition at line 102 of file uwmulti-stack-controller-phy-master.h.

◆ power_stat_node_

int UwMultiStackControllerPhyMaster::power_stat_node_
protected

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

Definition at line 104 of file uwmulti-stack-controller-phy-master.h.

◆ power_statistics_

double UwMultiStackControllerPhyMaster::power_statistics_
protected

ID of the last PHY layer used.

Definition at line 103 of file uwmulti-stack-controller-phy-master.h.

◆ signaling_active_

int UwMultiStackControllerPhyMaster::signaling_active_
protected

Definition at line 101 of file uwmulti-stack-controller-phy-master.h.

◆ signaling_period_

double UwMultiStackControllerPhyMaster::signaling_period_
protected

Definition at line 106 of file uwmulti-stack-controller-phy-master.h.

◆ signaling_sent_

int UwMultiStackControllerPhyMaster::signaling_sent_
protected

Period to check the best layer if no interactions occurs.

Definition at line 107 of file uwmulti-stack-controller-phy-master.h.

◆ signaling_timer_

UwMultiStackSignalingTimer UwMultiStackControllerPhyMaster::signaling_timer_
protected

Number of signaling packets sent.

UwMultiStack signaling timer handler

Definition at line 108 of file uwmulti-stack-controller-phy-master.h.


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