DESERT 4.0.0
UwMultiStackControllerPhy Class Reference

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

Inheritance diagram for UwMultiStackControllerPhy:
Inheritance graph
Collaboration diagram for UwMultiStackControllerPhy:
Collaboration graph

Public Member Functions

 UwMultiStackControllerPhy ()
 
virtual ~UwMultiStackControllerPhy ()
 
virtual int command (int, const char *const *)
 
virtual int recvSyncClMsg (ClMessage *m)
 
virtual void recv (Packet *p, int idSrc)
 
- 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 Types

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 }
 

Protected Member Functions

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 int getBestLayer (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 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_
 

Static Protected Attributes

static map< UWPHY_CONTROLLER_STATE, string > state_info
 

Additional Inherited Members

- Static Public Attributes inherited from UwMultiStackController
static int const layer_not_exist = -1
 

Member Enumeration Documentation

◆ UWPHY_CONTROLLER_STATE

Enumerator
UWPHY_CONTROLLER_STATE_IDLE 
UWPHY_CONTROLLER_STATE_BUSY_2_TX 
UWPHY_CONTROLLER_STATE_BUSY_2_RX 

Constructor & Destructor Documentation

◆ UwMultiStackControllerPhy()

UwMultiStackControllerPhy::UwMultiStackControllerPhy ( )

Constructor of UwMultiPhy class.

References initInfo().

Here is the call graph for this function:

◆ ~UwMultiStackControllerPhy()

virtual UwMultiStackControllerPhy::~UwMultiStackControllerPhy ( )
inlinevirtual

Destructor of UwMultiPhy class.

Member Function Documentation

◆ command()

int UwMultiStackControllerPhy::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 UwMultiStackController.

Reimplemented in UwMultiStackControllerPhyMaster, and UwMultiStackControllerPhySlave.

References UwMultiStackController::command(), and current_state.

Referenced by UwMultiStackControllerPhyMaster::command(), and UwMultiStackControllerPhySlave::command().

Here is the call graph for this function:

◆ initInfo()

void UwMultiStackControllerPhy::initInfo ( )
protectedvirtual

◆ recv()

void UwMultiStackControllerPhy::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 in UwMultiStackControllerPhyMaster, and UwMultiStackControllerPhySlave.

References current_state, UwMultiStackController::debug_, UwMultiStackController::min_delay_, receiving_id, stateBusy2Tx(), stateIdle(), UWPHY_CONTROLLER_STATE_BUSY_2_RX, and UWPHY_CONTROLLER_STATE_IDLE.

Referenced by UwMultiStackControllerPhyMaster::recv(), and UwMultiStackControllerPhySlave::recv().

Here is the call graph for this function:

◆ recvSyncClMsg()

int UwMultiStackControllerPhy::recvSyncClMsg ( ClMessage *  m)
virtual

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

Reimplemented in UwMultiStackControllerPhyMaster, and UwMultiStackControllerPhySlave.

References current_state, UwMultiStackController::debug_, UwMultiStackController::lower_id_active_, state_info, stateBusy2Rx(), stateIdle(), UWPHY_CONTROLLER_STATE_BUSY_2_TX, and UWPHY_CONTROLLER_STATE_IDLE.

Referenced by UwMultiStackControllerPhyMaster::recvSyncClMsg(), and UwMultiStackControllerPhySlave::recvSyncClMsg().

Here is the call graph for this function:

◆ stateBusy2Rx()

void UwMultiStackControllerPhy::stateBusy2Rx ( int  id)
protectedvirtual

Called when a node is receiving correctely a packet from the lower layer. It sets the state busy due to the reception.

Parameters
idthe identifier of the lower layer

References current_state, UwMultiStackController::debug_, receiving_id, state_info, and UWPHY_CONTROLLER_STATE_BUSY_2_RX.

Referenced by recvSyncClMsg().

◆ stateBusy2Tx()

void UwMultiStackControllerPhy::stateBusy2Tx ( Packet *  p)
protectedvirtual

Called when a node is transmitting a packet. The state is set busy due to the transmitting operation.

Parameters
ppointer to the packet will be received

References current_state, UwMultiStackController::debug_, UwMultiStackController::recvFromUpperLayers(), state_info, UWPHY_CONTROLLER_STATE_BUSY_2_TX, and UWPHY_CONTROLLER_STATE_IDLE.

Referenced by recv().

Here is the call graph for this function:

◆ stateIdle()

void UwMultiStackControllerPhy::stateIdle ( )
protectedvirtual

Node is in Idle state. It changes its state only when it has to manage a packet reception.

References current_state, UwMultiStackController::debug_, receiving_id, state_info, and UWPHY_CONTROLLER_STATE_IDLE.

Referenced by recv(), and recvSyncClMsg().

Member Data Documentation

◆ current_state

UWPHY_CONTROLLER_STATE UwMultiStackControllerPhy::current_state
protected

◆ receiving_id

int UwMultiStackControllerPhy::receiving_id
protected

current receiving PHY ID

Referenced by recv(), stateBusy2Rx(), and stateIdle().

◆ state_info

map< UwMultiStackControllerPhy::UWPHY_CONTROLLER_STATE, string > UwMultiStackControllerPhy::state_info
staticprotected

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