53 TclObject*
create(
int,
const char*
const*) {
69 Tcl& tcl = Tcl::instance();
72 if(strcasecmp(argv[1],
"signalingON") == 0)
77 else if(strcasecmp(argv[1],
"signalingOFF") == 0)
82 else if(strcasecmp(argv[1],
"getSignalsRecv") == 0)
90 if(strcasecmp(argv[1],
"setManualLowerlId") == 0)
103 hdr_cmn* ch = hdr_cmn::access(p);
108 hdr_mac* mach = HDR_MAC(p);
109 int my_mac_addr = -1;
110 ClMsgPhy2MacAddr msg;
112 my_mac_addr = msg.getAddr();
113 if (mach->macDA() == my_mac_addr || mach->macDA() == MAC_BROADCAST) {
114 mach->macDA() = mach->macSA();
115 mach->macSA() = my_mac_addr;
124 std::cout << NOW <<
" ControllerPhySlave::recv(Packet *p, int idSrc) signaling "<< ch->ptype() <<
" " <<
PT_MULTI_ST_SIGNALING<< std::endl;
132 if (m->type() == CLMSG_PHY2MAC_ENDTX)
134 hdr_cmn* ch = hdr_cmn::access(
static_cast<ClMsgPhy2MacEndTx *
>(m)->pkt);
138 else if (m->type() == CLMSG_PHY2MAC_STARTRX)
140 hdr_cmn* ch = hdr_cmn::access(
static_cast<ClMsgPhy2MacStartRx *
>(m)->pkt);
151 ClMsgPhy2MacAddr msg;
153 mac_addr = msg.getAddr();
157 std::cout << NOW <<
" ControllerPhySlave("<< mac_addr <<
")::getBestLayer(Packet *p) "<< std::endl;
167 hdr_mac* mach = HDR_MAC(p);
168 ClMsgPhy2MacAddr msg;
170 mac_addr = msg.getAddr();
171 if (mach->macDA() == mac_addr || mach->macDA() == MAC_BROADCAST)
175 std::cout << NOW <<
" ControllerPhySlave("<< mac_addr <<
")::updateSlave "
Class that represents the binding with the tcl configuration script.
TclObject * create(int, const char *const *)
Creates the TCL object needed for the tcl language interpretation.
UwMultiStackControllerPhySlaveClass()
Constructor of the class.
Class used to represents the UwMultiStackControllerPhySlave layer of a node.
virtual void updateSlave(Packet *p, int idSrc)
It implements the slave choice rule to choose the lower layer when the system works in AUTOMATIC_MODE...
int signaling_active_
Number of signaling packets received.
virtual void recv(Packet *p, int idSrc)
It manages each packet reception, either from the upper and the lower layer.
virtual int command(int, const char *const *)
TCL command interpreter.
virtual int getBestLayer(Packet *p)
If true slave is in signaling mode, otherwise not.
int recvSyncClMsg(ClMessage *m)
Cross-Layer messages synchronous interpreter.
UwMultiStackControllerPhySlave()
Constructor of UwMultiPhy class.
virtual void recv(Packet *p, int idSrc)
It manages each packet reception, either from the upper and the lower layer.
virtual int recvSyncClMsg(ClMessage *m)
Cross-Layer messages synchronous interpreter.
virtual int command(int, const char *const *)
TCL command interpreter.
int debug_
Flag to activate debug verbosity.
@ UW_AUTOMATIC_SWITCH
State to switch-mode automatically.
int lower_id_active_
<Current switch mode (either AUTOMATIC or MANUAL).
packet_t PT_MULTI_ST_SIGNALING
UwMultiStackControllerPhySlaveClass class_uwmulti_stack_controller_phy_slave
Definition of UwMultiStackControllerPhySlave class.