|
DESERT 4.0.0
|
#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.
| UWMdriver::UWMdriver | ( | UWMPhy_modem * | pmModem_ | ) |
Class constructor.
| pmModem_ | pointer to the UWMPhy_modem object to link with this UWMdriver object. |
References debug_, dest, UWMPhy_modem::getDebug(), UWMPhy_modem::getID(), ID, MODEM_IDLE, payload_rx, payload_tx, pmConnector, pmInterpreter, pmModem, SetModemID, src, and status.

| UWMdriver::~UWMdriver | ( | ) |
Class destructor.
| 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.
References debug_.
|
inline |
Method to return the flag used to enable debug messages.
References debug_.
Referenced by UWMinterpreter::UWMinterpreter().
|
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.
References dstPktRx.
|
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.
References dstPktRx.
|
inline |
|
inline |
| 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.
References UWMPhy_modem::getLogFile(), and pmModem.

| 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.
References UWMPhy_modem::getLogLevel(), and pmModem.

|
inline |
References SetModemID.
|
inline |
References SetModemID.
|
inline |
References ResetModemQueue.
|
inline |
References ResetModemQueue.
|
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.
References payload_rx.
|
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.
References payload_rx.
Referenced by UWMPhy_modem::endRx().
|
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.
References src.
|
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.
References src.
|
inline |
|
inline |
Method to return the modem's status.
References status.
Referenced by MS2C_Evo_lowlev::check_modem(), and UWMPhy_modem::recv().
|
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.
Referenced by UWMPhy_modem::startTx().
|
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 | ||
| ) |
Referenced by MS2C_Evo_lowlev::check_modem(), UWMPhy_modem::endRx(), UWMPhy_modem::endTx(), MdriverS2C_Evo_lowlev::modemTxManager(), UWMconnector::readFromModem(), UWMPhy_modem::recv(), MdriverS2C_Evo_lowlev::start(), UWMPhy_modem::startRx(), UWMPhy_modem::startTx(), and MdriverS2C_Evo_lowlev::updateStatus().
| 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_. |
References MODEM_IDLE, and status.
Referenced by UWMPhy_modem::endRx(), and UWMPhy_modem::recv().
|
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) |
References UWMPhy_modem::getQueueLength(), pmConnector, pmInterpreter, pmModem, and UWMconnector::setDriverQueueLength().
Referenced by MdriverS2C_Evo_lowlev::MdriverS2C_Evo_lowlev().

|
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_. |
References ID.
|
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_. |
References ID.
Referenced by UWMPhy_modem::start().
|
inline |
| set | true if the interface has to set the modem ID |
References SetModemID.
|
inline |
| set | true if the interface has to set the modem ID |
References SetModemID.
Referenced by UWMPhy_modem::start().
|
inline |
References ResetModemQueue.
|
inline |
References ResetModemQueue.
Referenced by DropTimer::expire().
|
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.
Referenced by UWMPhy_modem::start().
|
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.
Referenced by UWMPhy_modem::stop().
| 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. |
References dstPktRx, payload_rx, and src.
Referenced by MinterpreterTEL::parse_TELEGRAM().
|
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.
Referenced by MS2C_Evo_lowlev::check_modem().
| 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. |
References dest, and payload_tx.
Referenced by UWMPhy_modem::recv().
|
protected |
Flag to enable debug mode (i.e., printing of debug messages) if set to 1
Referenced by getDebug(), and UWMdriver().
|
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.
Referenced by updateTx(), and UWMdriver().
|
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.
Referenced by getDstPktRx(), and updateRx().
|
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).
Referenced by getID(), setID(), and UWMdriver().
|
protected |
output strem to print into a disk-file log messages. See UWMPhy_modem::logFile.
|
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.
Referenced by getRxPayload(), updateRx(), MdriverS2C_Evo_lowlev::updateStatus(), and UWMdriver().
|
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.
Referenced by MdriverS2C_Evo_lowlev::modemTxManager(), updateTx(), and UWMdriver().
|
protected |
pointer to the object that handles the physical transmission and reception of acoustic packets
Referenced by setConnections(), and UWMdriver().
|
protected |
pointer to the object that builds/parses the necessary messages to make UWMdriver able to communicate with a real modem
Referenced by setConnections(), and UWMdriver().
|
protected |
link to the UWMPhy_modem object that contains this driver
Referenced by getLogFile(), getLogLevel(), setConnections(), and UWMdriver().
|
protected |
Referenced by getResetModemQueue(), and setResetModemQueue().
|
protected |
Variable to decide whether the interface has to set the acoustic ID of the modem or not
Referenced by getModemID(), setModemID(), and UWMdriver().
|
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.
Referenced by getSrc(), updateRx(), and UWMdriver().
|
protected |
Status of the driver's general state machine. Seven possible statuses = _IDLE, _TX, _RX , _IDLE_RX,_CFG, _TX_PAUSED and _TX_RX.
Referenced by getStatus(), MdriverS2C_Evo_lowlev::modemTx(), resetModemStatus(), MdriverS2C_Evo_lowlev::start(), MdriverS2C_Evo_lowlev::stop(), MdriverS2C_Evo_lowlev::updateStatus(), and UWMdriver().