DESERT 3.5.1
|
#include <uwmdriver.h>
Public Member Functions | |
UWMdriver (UWMPhy_modem *) | |
~UWMdriver () | |
virtual void | modemSetID ()=0 |
virtual void | start ()=0 |
virtual void | stop ()=0 |
virtual void | modemTx ()=0 |
virtual modem_state_t | updateStatus ()=0 |
void | setID (int ID_) |
void | resetModemStatus () |
void | updateTx (int, std::string) |
void | updateRx (int, int, std::string) |
int | getID () |
modem_state_t | getStatus () |
std::string | getRxPayload () |
int | getSrc () |
int | getDstPktRx () |
log_level_t | getDebug () |
void | setModemID (bool set) |
bool | getModemID () |
void | setResetModemQueue (bool reset_m_queue) |
bool | getResetModemQueue () |
log_level_t | getLogLevel () |
std::string | getLogFile () |
void | printOnLog (log_level_t log_level, std::string module, std::string message) |
UWMdriver (UWMPhy_modem *) | |
~UWMdriver () | |
virtual void | modemSetID ()=0 |
virtual void | start ()=0 |
virtual void | stop ()=0 |
virtual void | modemTx ()=0 |
virtual modem_state_t | updateStatus ()=0 |
void | setID (int ID_) |
void | resetModemStatus () |
void | updateTx (int, std::string) |
void | updateRx (int, int, std::string) |
int | getID () |
modem_state_t | getStatus () |
std::string | getRxPayload () |
int | getSrc () |
int | getDstPktRx () |
log_level_t | getDebug () |
void | setModemID (bool set) |
bool | getModemID () |
void | setResetModemQueue (bool reset_m_queue) |
bool | getResetModemQueue () |
log_level_t | getLogLevel () |
std::string | getLogFile () |
void | printOnLog (log_level_t log_level, std::string module, std::string message) |
Protected Member Functions | |
void | setConnections (UWMinterpreter *, UWMconnector *) |
virtual void | modemTxManager ()=0 |
void | setConnections (UWMinterpreter *, UWMconnector *) |
virtual void | modemTxManager ()=0 |
Protected Attributes | |
UWMPhy_modem * | pmModem |
UWMinterpreter * | pmInterpreter |
UWMconnector * | pmConnector |
int | ID |
modem_state_t | status |
std::string | payload_tx |
int | dest |
std::string | payload_rx |
int | src |
int | dstPktRx |
bool | SetModemID |
int | debug_ |
std::ofstream | outLog |
bool | ResetModemQueue |
The class needed by UWMPhy_modem to handle the different transmissions cases and corresponding protocol messages to be generated according to the tcl-user choices and modem firmware, respectively.
This class contains all the basic functions needed to drive modem in transmitting/receiving messages. NOTE: this class must be inherited and extended to implement any specific modem driver.
Definition at line 95 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
UWMdriver::UWMdriver | ( | UWMPhy_modem * | pmModem_ | ) |
Class constructor.
pmModem_ | pointer to the UWMPhy_modem object to link with this UWMdriver object. |
Definition at line 40 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
UWMdriver::~UWMdriver | ( | ) |
Class destructor.
Definition at line 60 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
UWMdriver::UWMdriver | ( | UWMPhy_modem * | ) |
Class constructor.
pmModem_ | pointer to the UWMPhy_modem object to link with this UWMdriver object. |
UWMdriver::~UWMdriver | ( | ) |
Class destructor.
|
inline |
Method to return the flag used to enable debug messages.
Definition at line 281 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Method to return the flag used to enable debug messages.
Definition at line 281 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
Method to access to the ID of the destination of the last packet acoustically received.
NOTE: This function should be used by the UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem) to recover the orginal NS-Miracle to be sent to the above protocol layers of the simulator.
Definition at line 270 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Method to access to the ID of the destination of the last packet acoustically received.
NOTE: This function should be used by the UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem) to recover the orginal NS-Miracle to be sent to the above protocol layers of the simulator.
Definition at line 270 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
Method to return modem ID.
Definition at line 211 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Method to return modem ID.
Definition at line 211 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
std::string UWMdriver::getLogFile | ( | ) |
Method to return the name of the disk-fiel used to print the log messages.
std::string UWMdriver::getLogFile | ( | ) |
Method to return the name of the disk-fiel used to print the log messages.
Definition at line 75 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
log_level_t UWMdriver::getLogLevel | ( | ) |
Method to return the flag used to enable the printing of log messages in UWMPhy_modem::logFile.
log_level_t UWMdriver::getLogLevel | ( | ) |
Method to return the flag used to enable the printing of log messages in UWMPhy_modem::logFile.
Definition at line 81 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
|
inline |
Definition at line 300 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Definition at line 300 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
Definition at line 312 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Definition at line 312 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
Method to access to the payload of the last packet acoustically received.
NOTE: This function should be used by the UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem) to recover the orginal NS-Miracle to be sent to the above protocol layers of the simulator.
Definition at line 238 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Method to access to the payload of the last packet acoustically received.
NOTE: This function should be used by the UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem) to recover the orginal NS-Miracle to be sent to the above protocol layers of the simulator.
Definition at line 238 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
Method to access to the ID of the source of the last packet acoustically received.
NOTE: This function should be used by the UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem) to recover the orginal NS-Miracle to be sent to the above protocol layers of the simulator.
Definition at line 254 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Method to access to the ID of the source of the last packet acoustically received.
NOTE: This function should be used by the UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem) to recover the orginal NS-Miracle to be sent to the above protocol layers of the simulator.
Definition at line 254 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
Method to return the modem's status.
Definition at line 222 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Method to return the modem's status.
Definition at line 222 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
pure virtual |
Implemented in MdriverS2C_Evo_lowlev.
|
pure virtual |
Implemented in MdriverS2C_Evo_lowlev.
|
pure virtual |
Method to notify to the driver that there is a packet to be sent via modem.
NOTE: when this function is called (by an UWMPhy_modem object), the driver's status must be set to TX_ and the packet must be sent immediately to the modem.
Implemented in MdriverS2C_Evo_lowlev.
|
pure virtual |
Method to notify to the driver that there is a packet to be sent via modem.
NOTE: when this function is called (by an UWMPhy_modem object), the driver's status must be set to TX_ and the packet must be sent immediately to the modem.
Implemented in MdriverS2C_Evo_lowlev.
|
protectedpure virtual |
Method to manage modem to host and host to modem communications.
This method has to handle the different transmissions cases and corresponding protocol messages to be generated according to the tcl-user choices and modem firmware, respectively.
Implemented in MdriverS2C_Evo_lowlev.
|
protectedpure virtual |
Method to manage modem to host and host to modem communications.
This method has to handle the different transmissions cases and corresponding protocol messages to be generated according to the tcl-user choices and modem firmware, respectively.
Implemented in MdriverS2C_Evo_lowlev.
void UWMdriver::printOnLog | ( | log_level_t | log_level, |
std::string | module, | ||
std::string | message | ||
) |
void UWMdriver::printOnLog | ( | log_level_t | log_level, |
std::string | module, | ||
std::string | message | ||
) |
void UWMdriver::resetModemStatus | ( | ) |
Method to reset the modem status.
NOTE: this function should be used by the UWMPhy_modem object linked to this UWMdriver (the one pointed by pmModem) to reset the status to _IDLE after the processing of a received packet or to abort a given ongoing reception process.
[out] | status | (i.e., the member UWMdriver::status), changed to IDLE_. |
void UWMdriver::resetModemStatus | ( | ) |
Method to reset the modem status.
NOTE: this function should be used by the UWMPhy_modem object linked to this UWMdriver (the one pointed by pmModem) to reset the status to _IDLE after the processing of a received packet or to abort a given ongoing reception process.
[out] | status | (i.e., the member UWMdriver::status), changed to IDLE_. |
Definition at line 87 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
|
protected |
Link connector.
This method must be used by any derived class D of UWDriver to link the members pmInterpreter and pmConnector of UWMdriver to the corresponding derived objects contained in D.
[in] | pmInterpreter_ | pointer to a UWMinterpreter object |
[in] | pmConnector_ | pointer to an UWMconnector object |
[out] | pmInterpreter | (i.e., the member UWMPhy_modem::pmInterpreter) |
[out] | pmConnector | (i.e., the member UWMPhy_modem::pmConnector) |
|
protected |
Link connector.
This method must be used by any derived class D of UWDriver to link the members pmInterpreter and pmConnector of UWMdriver to the corresponding derived objects contained in D.
[in] | pmInterpreter_ | pointer to a UWMinterpreter object |
[in] | pmConnector_ | pointer to an UWMconnector object |
[out] | pmInterpreter | (i.e., the member UWMPhy_modem::pmInterpreter) |
[out] | pmConnector | (i.e., the member UWMPhy_modem::pmConnector) |
Definition at line 65 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
|
inline |
Method to change the modem ID.
This method is called by the UWMPhy_modem object linked to this UWMdriver (the one pointed by pmModem).
[in] | ID | the ID that must be assigned to the modem. |
[out] | ID | (i.e., the member UWMdriver::ID), changed to ID_. |
Definition at line 155 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Method to change the modem ID.
This method is called by the UWMPhy_modem object linked to this UWMdriver (the one pointed by pmModem).
[in] | ID | the ID that must be assigned to the modem. |
[out] | ID | (i.e., the member UWMdriver::ID), changed to ID_. |
Definition at line 155 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
set | true if the interface has to set the modem ID |
Definition at line 291 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
set | true if the interface has to set the modem ID |
Definition at line 291 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
inline |
Definition at line 306 of file DESERT_Addons/uwmphy_modem/uwmdriver.h.
|
inline |
Definition at line 306 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
pure virtual |
Driver starter.
This method starts the driver performing all the needed operations to open an host-modem connection.
Implemented in MdriverS2C_Evo_lowlev.
|
pure virtual |
Driver starter.
This method starts the driver performing all the needed operations to open an host-modem connection.
Implemented in MdriverS2C_Evo_lowlev.
|
pure virtual |
Driver stopper.
This method should be used before stopping the simulation. It closes and, if needed, resets all the opened files and ports.
Implemented in MdriverS2C_Evo_lowlev.
|
pure virtual |
Driver stopper.
This method should be used before stopping the simulation. It closes and, if needed, resets all the opened files and ports.
Implemented in MdriverS2C_Evo_lowlev.
void UWMdriver::updateRx | ( | int | , |
int | , | ||
std::string | |||
) |
Method to write in UWMdriver::payload_rx, UWMdriver::src and UWMdriver::dstPktRx.
NOTE: This method should be used by an UWMinterpreter object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem)
[in] | s | the ID of the modem that sent the last received packet. |
[in] | d | the ID of the modem that is the destination of the last received packet. |
[in] | prx | the payload of the last packet acoustically received. |
[out] | src | (i.e., the member UWMdriver::src), changed to s. |
[out] | dstPktRx | (i.e., the member UWMdriver::dstPktRx), changed to d. |
[out] | payload_rx | (i.e., the member UWMdriver::payload_rx), changed to prx. |
void UWMdriver::updateRx | ( | int | s, |
int | d, | ||
std::string | prx | ||
) |
Method to write in UWMdriver::payload_rx, UWMdriver::src and UWMdriver::dstPktRx.
NOTE: This method should be used by an UWMinterpreter object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem)
[in] | s | the ID of the modem that sent the last received packet. |
[in] | d | the ID of the modem that is the destination of the last received packet. |
[in] | prx | the payload of the last packet acoustically received. |
[out] | src | (i.e., the member UWMdriver::src), changed to s. |
[out] | dstPktRx | (i.e., the member UWMdriver::dstPktRx), changed to d. |
[out] | payload_rx | (i.e., the member UWMdriver::payload_rx), changed to prx. |
Definition at line 100 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
|
pure virtual |
Method to update modem status.
This method has to update the modem status according to the messages received from the modem/channel (e.g., after a check of the modem buffer's output). NOTE: This method may return after an arbitrary period if nothing has happened, but it must return immediately after a change of UWMdriver::status.
Implemented in MdriverS2C_Evo_lowlev.
|
pure virtual |
Method to update modem status.
This method has to update the modem status according to the messages received from the modem/channel (e.g., after a check of the modem buffer's output). NOTE: This method may return after an arbitrary period if nothing has happened, but it must return immediately after a change of UWMdriver::status.
Implemented in MdriverS2C_Evo_lowlev.
void UWMdriver::updateTx | ( | int | , |
std::string | |||
) |
Method to update the values of both UWMdriver::payload_tx and UWMdriver::dest.
NOTE: This method should be used by an UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem)
[in] | d | the ID of the modem to which transmit the next packet. |
[in] | ptx | the payload of the modem packet to transmit acoustically. |
[out] | dest | (i.e., the member UWMdriver::dest), changed to d. |
[out] | payload_tx | (i.e., the member UWMdriver::payload_tx), changed to ptx. |
void UWMdriver::updateTx | ( | int | d, |
std::string | ptx | ||
) |
Method to update the values of both UWMdriver::payload_tx and UWMdriver::dest.
NOTE: This method should be used by an UWMcodec object linked to this UWMdriver (and contained in the UWMPhy_modem object pointed by pmModem)
[in] | d | the ID of the modem to which transmit the next packet. |
[in] | ptx | the payload of the modem packet to transmit acoustically. |
[out] | dest | (i.e., the member UWMdriver::dest), changed to d. |
[out] | payload_tx | (i.e., the member UWMdriver::payload_tx), changed to ptx. |
Definition at line 93 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.cpp.
|
protected |
Flag to enable debug mode (i.e., printing of debug messages) if set to 1.
Definition at line 397 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
Variable where to save the destination ID of the next packet to send via modem.
NOTE: an object of the class UWMcodec must write here after the host-to-modem demapping.
Definition at line 365 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
Variable where to save the destination ID of the last packet received via modem.
NOTE: an object of the class UWMinterpreter must write here after a the parsing of a received data packet; instead, an object of the class UWMcodec reads here before the modem-to-host mapping.
Definition at line 389 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
ID of the modem.
NOTE: UWMdriver::ID (i.e., modem ID, hardware side) is set equal to UWMPhy_modem::ID (i.e., node ID, simulator side) (therefore when node ID transmits, it also coincides with the source ID).
Definition at line 348 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
output strem to print into a disk-file log messages.
Definition at line 399 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
String where to save the payload of the last packet received via modem.
NOTE: an object of the class UWMinterpreter must write here after a the parsing of a received data packet; instead, an object of the class UWMcodec reads here before the modem-to-host mapping.
Definition at line 372 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
String where to save the payload of the next packet to send via modem.
NOTE: an object of the class UWMcodec must write here after the host-to-modem mapping.
Definition at line 361 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
pointer to the object that handles the physical transmission and reception of acoustic packets
Definition at line 344 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
pointer to the object that builds/parses the necessary messages to make UWMdriver able to communicate with a real modem
Definition at line 339 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
link to the UWMPhy_modem object that contains this driver
Definition at line 335 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
Definition at line 401 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
Variable to decide whether the interface has to set the acoustic ID of the modem or not.
Definition at line 395 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
Variable storing the source ID of the last packet received via modem.
NOTE: an object of the class UWMinterpreter must write here after a the parsing of a received data packet; instead, an object of the class UWMcodec reads here before the modem-to-host mapping.
Definition at line 381 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.
|
protected |
Status of the driver's general state machine.
Seven possible statuses = _IDLE, _TX, _RX , _IDLE_RX,_CFG, _TX_PAUSED and _TX_RX.
Definition at line 354 of file DESERT_Framework/DESERT/physical/uwmphy_modem/uwmdriver.h.