39#ifndef UWOPTICAL_ACOUSTIC_CONTROLLER_MASTER_H
40#define UWOPTICAL_ACOUSTIC_CONTROLLER_MASTER_H
74 virtual int command(
int,
const char*
const*);
84 virtual void recv(Packet *p,
int idSrc);
96 virtual void expire(Event *e);
virtual void expire(Event *e)
UwMultiStackSignalingTimer(UwMultiStackControllerPhyMaster *m)
Class used to represents the UwMultiStackControllerPhyMaster layer of a node.
int getLongerRangeLayer(int layer_id)
Return the previous layer in order which can achieve longer range with lower bitrete.
int getShorterRangeLayer(int layer_id)
Return the next layer in order which can achieve shorter range with higer bitrete.
virtual void resetCheckAndSignal()
If signaling is active and signaling timer expires, check the average power thresholds at each packet...
double power_statistics_
ID of the last PHY layer used.
virtual int checkBestLayer()
Check the average power thresholds.
virtual int getBestLayer(Packet *p)
Return the best layer to forward the packet when the system works in AUTOMATIC_MODE.
UwMultiStackSignalingTimer signaling_timer_
Number of signaling packets sent.
double alpha_
Address of the node which the master is collecting the average power.
virtual ~UwMultiStackControllerPhyMaster()
Destructor of UwMultiPhy class.
int power_stat_node_
Average received power from the closest node according to the IIR filter.
virtual void checkAndSignal()
If signaling is active, check the average power thresholds at each packet received.
int last_layer_used_
If true master is in signaling mode, otherwise not.
virtual void signalsBestPhy()
Signals the best phy.
UwMultiStackControllerPhyMaster()
Constructor of UwMultiPhy class.
virtual int command(int, const char *const *)
TCL command interpreter.
int signaling_sent_
Period to check the best layer if no interactions occurs.
virtual void updateMasterStatistics(Packet *p, int idSrc)
It implements the slave choice rule to choose the lower layer when the system works in AUTOMATIC_MODE...
int recvSyncClMsg(ClMessage *m)
Cross-Layer messages synchronous interpreter.
virtual void recv(Packet *p, int idSrc)
It manages each packet reception, either from the upper and the lower layer.
int getOrder(int layer_id)
return the order of the id for the controller logic
static int const layer_not_exist
This constant is returned when a searched layer does not exist>
int getId(int layer_order)
return the id of the controlled layer given its order in the controller logic
Definition of UwMultiStackControllerPhy class.