53 TclObject*
create(
int,
const char*
const*) {
64current_state(UWPHY_CONTROLLER_STATE_IDLE)
78 Tcl& tcl = Tcl::instance();
81 if(strcasecmp(argv[1],
"getStatus") == 0)
96 mac_addr = msg.getAddr();
99 std::cout << NOW <<
" ControllerPhy("<< mac_addr <<
")::recvSyncClMsg(ClMessage* m), state_info: "
103 if (m->direction() == DOWN)
106 std::cout <<
" direction = DOWN "<< std::endl;
108 sendSyncClMsgDown(m);
111 else if (m->type() == CLMSG_PHY2MAC_STARTRX)
114 std::cout <<
" type = CLMSG_PHY2MAC_STARTRX "<< std::endl;
125 std::cout <<
"ControllerPhy("<< mac_addr <<
")::recvSyncClMsg(ClMessage* m), nothing done."<<std::endl;
135 std::cout <<
" endTx "<< std::endl;
141 std::cout <<
" altro, ClMsg type = " << m->type() << std::endl;
153 ClMsgPhy2MacAddr msg;
155 mac_addr = msg.getAddr();
168 ClMsgPhy2MacAddr msg;
170 mac_addr = msg.getAddr();
173 std::cout << NOW <<
" ControllerPhy("<< mac_addr <<
")::stateBusy2Rx(id), state_info: "
183 ClMsgPhy2MacAddr msg;
185 mac_addr = msg.getAddr();
188 std::cout << NOW <<
" ControllerPhy("<< mac_addr <<
")::stateBusy2Tx(), state_info: "
199 ClMsgPhy2MacAddr msg;
201 mac_addr = msg.getAddr();
202 hdr_cmn *ch = HDR_CMN(p);
207 std::cout << NOW <<
" ControllerPhy("<< mac_addr <<
")::recv(Packet *p, int idSrc) FromUpperLayer idSrc = "
208 << idSrc << std::endl;
214 std::cout << NOW <<
" ControllerPhy("<< mac_addr <<
")::recv(Packet *p, int idSrc) sendUp"
221 std::cout << NOW <<
" ControllerPhy("<< mac_addr <<
")::recv(Packet *p, int idSrc) block direction = "
222 << ch->direction() <<
" idSrc = " << idSrc << std::endl;
Class that represents the binding with the tcl configuration script.
UwMultiStackControllerPhyClass()
Constructor of the class.
TclObject * create(int, const char *const *)
Creates the TCL object needed for the tcl language interpretation.
virtual void recv(Packet *p, int idSrc)
It manages each packet reception, either from the upper and the lower layer.
UwMultiStackControllerPhy()
Constructor of UwMultiPhy class.
static map< UWPHY_CONTROLLER_STATE, string > state_info
virtual void stateBusy2Tx(Packet *p)
Called when a node is transmitting a packet.
virtual void stateBusy2Rx(int id)
Called when a node is receiving correctely a packet from the lower layer.
virtual int recvSyncClMsg(ClMessage *m)
Cross-Layer messages synchronous interpreter.
virtual int command(int, const char *const *)
TCL command interpreter.
int receiving_id
current receiving PHY ID
UWPHY_CONTROLLER_STATE current_state
virtual void initInfo()
This function is used to initialize the UwMultiStackControllerPhy debugging info.
@ UWPHY_CONTROLLER_STATE_IDLE
@ UWPHY_CONTROLLER_STATE_BUSY_2_TX
@ UWPHY_CONTROLLER_STATE_BUSY_2_RX
virtual void stateIdle()
Node is in Idle state.
Class used to represents the UwMultiStackController layer of a node.
int debug_
Flag to activate debug verbosity.
virtual int command(int, const char *const *)
TCL command interpreter.
int lower_id_active_
<Current switch mode (either AUTOMATIC or MANUAL).
virtual void recvFromUpperLayers(Packet *p)
By default the signaling is not employed, if it is needed, here where to set the signaling packet siz...
UwMultiStackControllerPhyClass class_uwmulti_stack_controller_phy
Definition of UwMultiStackControllerPhy class.