|
DESERT 4.0.0
|
#include <uwmodem.h>


Public Types | |
| enum class | LogLevel { ERROR = 0 , INFO = 1 , DEBUG = 2 } |
Public Member Functions | |
| UwModem () | |
| virtual | ~UwModem () |
| virtual void | recv (Packet *p)=0 |
| virtual int | command (int argc, const char *const *argv) |
| virtual int | recvSyncClMsg (ClMessage *m)=0 |
| virtual double | getTxDuration (Packet *p) |
| virtual int | getModulationType (Packet *P) |
| void | setModemID (int ID) |
| int | getModemID () |
| void | printOnLog (LogLevel log_level, string module, string message) |
| LogLevel | getLogLevel () |
| int | getDebug () |
| std::string | getLogFile () |
| void | realTxEnded (Packet *p) |
Static Public Member Functions | |
| static bool | string2log (const std::string &ll_string, LogLevel &ll) |
| static bool | log2string (LogLevel ll, std::string &ll_string) |
Protected Member Functions | |
| virtual void | startTx (Packet *p)=0 |
| virtual void | endTx (Packet *p) |
| virtual void | startRx (Packet *p)=0 |
| virtual void | endRx (Packet *p)=0 |
| virtual void | start ()=0 |
| virtual void | stop ()=0 |
| void | checkEvent () |
Protected Attributes | |
| int | modemID |
| std::vector< char > | data_buffer |
| std::queue< Packet * > | tx_queue |
| std::queue< Packet * > | rx_queue |
| unsigned int | DATA_BUFFER_LEN |
| int | MAX_READ_BYTES |
| std::string | modem_address |
| int | debug_ |
| std::ofstream | outLog |
| std::string | logFile |
| std::string | log_suffix |
| LogLevel | loglevel_ |
| bool | log_is_open |
| CheckTimer * | checkTimer |
| double | period |
| std::queue< ModemEvent > | event_q |
Friends | |
| class | CheckTimer |
Class that implements the interface to DESERT, as used through Tcl scripts. This class provides common functions to operate as a physical layer; its derivate classes will implement its virtual methods as specific to each device.
|
strong |
| UwModem::UwModem | ( | ) |
UwModem constructor
| address | string representing the address to connect to |
References DATA_BUFFER_LEN, debug_, MAX_READ_BYTES, modemID, and period.
|
protected |
Method to check if any event from real world has to go to ns
References checkTimer, event_q, ModemEvent::f, ModemEvent::p, and period.
Referenced by CheckTimer::expire().
|
virtual |
Tcl command interpreter: Method that maps Tcl commands into C++ methods.
| argc | number of arguments in argv |
| argv | array of strings which are the command parameters (Note that argv[0] is the name of the object). |
Reimplemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
References log_suffix, loglevel_, modem_address, start(), stop(), and string2log().
Referenced by UwAhoiModem::command(), UwEvoLogicsS2CModem::command(), UwMODAModem::command(), and UwModemCSA::command().

|
protectedpure virtual |
Method that ends a packet reception. This method is also in charge of sending the received NS-MIRACLE packet to the upper layers
| p | Packet pointer to the packet being sent |
Implemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
|
protectedvirtual |
Method that ends a packet transmission. This method is also in charge of sending a CrLayerMsg, Phy2MacEndTx(p), to notify the above layers of the simulator about the end of a transmission
| p | Packet pointer to the packet being received |
Referenced by realTxEnded().
|
inline |
Method to return the flag used to enable debug messages.
References debug_.
Referenced by CheckTimer::CheckTimer(), and CheckTimer::CheckTimer().
|
inline |
Method to return the name of the file where to log messages.
References log_suffix, logFile, and modemID.
Referenced by printOnLog().
|
inline |
Method to return the flag used to enable the printing of log messages in UwEvoLogicsS2CModem::logFile.
References loglevel_.
Referenced by printOnLog().
|
inline |
Method that returns the current ID of the modem.
References modemID.
|
inlinevirtual |
Method that should return the modulation type used for the packet being transmitted. Inherited from MPhy, in NS-MIRACLE, could be left empty if no way exists to retrieve this information
| p | Packet pointer to the given packet being transmitted |
| modulation | type represented by an integer |
Reimplemented in UwMODAModem.
Referenced by UwAhoiModem::recv(), UwEvoLogicsS2CModem::recv(), and UwModemCSA::recv().
|
inlinevirtual |
Method that returnd the duration of a given transmitted packet. Inherited from MPhy, in NS-MIRACLE, could be empty if there is no way to retrieve this information.
| p | Packet pointer to the given packet being transmitted |
Reimplemented in UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
|
static |
Method that converts an enum type of the loglevel into the string representing it
| ll | return loglevel to be converted |
| ll_string | return param string representing the loglevel |
References DEBUG, ERROR, and INFO.
Referenced by printOnLog().
| void UwModem::printOnLog | ( | LogLevel | log_level, |
| string | module, | ||
| string | message | ||
| ) |
Function that, given the appropriate level of log, prints to the set log file the provided log message.
References getLogFile(), getLogLevel(), log2string(), log_is_open, and outLog.
Referenced by UwEvoLogicsS2CModem::configure(), UwAhoiModem::endRx(), UwEvoLogicsS2CModem::endRx(), UwMODAModem::endRx(), UwModemCSA::endRx(), UwEvoLogicsS2CModem::getTxDuration(), UwEvoLogicsS2CModem::initializeLUT(), UwAhoiModem::receivingData(), UwEvoLogicsS2CModem::receivingData(), UwMODAModem::receivingData(), UwAhoiModem::recv(), UwEvoLogicsS2CModem::recv(), UwMODAModem::recv(), UwModemCSA::recv(), UwEvoLogicsS2CModem::recvSyncClMsg(), UwMODAModem::recvSyncClMsg(), UwModemCSA::recvSyncClMsg(), UwAhoiModem::start(), UwEvoLogicsS2CModem::start(), UwMODAModem::start(), UwModemCSA::start(), UwAhoiModem::startRx(), UwEvoLogicsS2CModem::startRx(), UwMODAModem::startRx(), UwModemCSA::startRx(), UwAhoiModem::startTx(), UwEvoLogicsS2CModem::startTx(), UwMODAModem::startTx(), UwModemCSA::startTx(), UwAhoiModem::stop(), UwEvoLogicsS2CModem::stop(), UwMODAModem::stop(), UwModemCSA::stop(), UwAhoiModem::storePacketInfo(), UwAhoiModem::transmittingData(), UwEvoLogicsS2CModem::transmittingData(), UwMODAModem::transmittingData(), UwModemCSA::transmittingData(), UwAhoiModem::updateSN(), UwMODAModem::updateStatus(), UwAhoiModem::updateStatus(), and UwEvoLogicsS2CModem::updateStatus().

|
inline |
Method to call endTx from end of real packet transmission
| p | Packet pointer to the packet being received |
References endTx().
Referenced by UwEvoLogicsS2CModem::startTx(), UwMODAModem::startTx(), UwModemCSA::startTx(), and UwAhoiModem::transmittingData().

|
pure virtual |
Method that handles the reception of packets arriving from the upper layers of the network simulator.
| p | pointer to the packet that has been received from the simulator upper layers |
Implemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
Referenced by UwMODAModem::receivingData(), UwModemCSA::startRealRx(), UwAhoiModem::updateStatus(), and UwEvoLogicsS2CModem::updateStatus().
|
pure virtual |
Cross-Layer messages synchronous interpreter.
| ClMessage* | an instance of ClMessage that represent the message received |
Implemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
|
inline |
Set the modem's ID number. Used for identification purposes
| ID | integer number used as modem ID |
References modemID.
|
protectedpure virtual |
Method that starts the driver operations. It performs all the needed operations to correctly fire up the device's driver.
Implemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
Referenced by command().
|
protectedpure virtual |
Method that starts a packet reception. This method is also in charge of sending a CrLayerMsg, Phy2MacStartRx(p), to notify the upper layers of the simulator about the start of the reception
| p | Packet pointer to the packet to be received |
Implemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
|
protectedpure virtual |
Method that triggers the transmission of a packet through a specified modem.
| p | Packet pointer to the packet to be sent |
Implemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
|
protectedpure virtual |
Method that stops the driver operations. It performs all the needed operations to correctly stop the device's driver before closing the simulation.
Implemented in UwAhoiModem, UwEvoLogicsS2CModem, UwMODAModem, and UwModemCSA.
Referenced by command().
|
static |
Method that converts a string representing the loglevel into the enum type of loglevel
| ll_string | string to be converted |
| ll | return parameter containing the converted loglevel |
References DEBUG, ERROR, and INFO.
Referenced by command().
|
friend |
Referenced by UwAhoiModem::start(), UwEvoLogicsS2CModem::start(), UwMODAModem::start(), and UwModemCSA::start().
|
protected |
Pointer to an object to schedule the "check-modem" events.
Referenced by checkEvent(), UwAhoiModem::start(), UwEvoLogicsS2CModem::start(), UwMODAModem::start(), UwModemCSA::start(), UwAhoiModem::stop(), UwEvoLogicsS2CModem::stop(), UwMODAModem::stop(), and UwModemCSA::stop().
|
protected |
Char buffer (vector) that holds data read from the modem (unparsed data) Main container for data received by the connector.
Referenced by UwAhoiModem::receivingData(), UwEvoLogicsS2CModem::receivingData(), UwMODAModem::receivingData(), UwModemCSA::receivingData(), and UwMODAModem::UwMODAModem().
|
protected |
Size of the buffer that holds data
Referenced by UwAhoiModem::receivingData(), UwEvoLogicsS2CModem::receivingData(), UwMODAModem::receivingData(), UwModemCSA::receivingData(), UwMODAModem::receivingSignaling(), UwAhoiModem::UwAhoiModem(), UwEvoLogicsS2CModem::UwEvoLogicsS2CModem(), UwModem(), and UwModemCSA::UwModemCSA().
|
protected |
Usual debug value that chooses the debug level through Tcl interface
Referenced by getDebug(), and UwModem().
|
protected |
Queue of events that are scheduled for NS2 to execute (callbacks)
Referenced by checkEvent(), UwMODAModem::receivingData(), UwModemCSA::startRealRx(), UwEvoLogicsS2CModem::startTx(), UwMODAModem::startTx(), UwModemCSA::startTx(), UwAhoiModem::transmittingData(), UwAhoiModem::updateStatus(), and UwEvoLogicsS2CModem::updateStatus().
|
protected |
Flag to check if log file has already be opened
Referenced by printOnLog().
|
protected |
Possibility to insert a log suffix
Referenced by command(), and getLogFile().
|
protected |
Name of the disk-file where to write the interface's log messages.
Referenced by getLogFile().
|
protected |
Log level on file, from ERROR (0) to DEBUG (2) in UwEvoLogicsS2CModem::logFile.
Referenced by command(), and getLogLevel().
|
protected |
Maximum number of bytes to be read by a single dump of data
Referenced by UwAhoiModem::receivingData(), UwEvoLogicsS2CModem::receivingData(), UwMODAModem::receivingData(), UwModemCSA::receivingData(), UwMODAModem::receivingSignaling(), UwAhoiModem::UwAhoiModem(), UwEvoLogicsS2CModem::UwEvoLogicsS2CModem(), UwModem(), and UwModemCSA::UwModemCSA().
|
protected |
String containing the address needed to connect to the device In case of socket, it may be expressed as: 192.168.XXX.XXX:PORTNUM In case of serial, it will be expressed in some other way
Referenced by command(), UwAhoiModem::start(), UwEvoLogicsS2CModem::start(), UwMODAModem::start(), and UwModemCSA::start().
|
protected |
Number used for identification purposes: not specified
Referenced by UwEvoLogicsS2CModem::configure(), UwAhoiModem::fillAhoiPkt(), getLogFile(), getModemID(), setModemID(), UwAhoiModem::updateStatus(), and UwModem().
|
protected |
output strem to print into a disk-file log messages. See UwEvoLogicsS2CModem::logFile.
Referenced by printOnLog(), and ~UwModem().
|
protected |
Checking period of the modem's buffer.
Referenced by checkEvent(), UwAhoiModem::start(), UwEvoLogicsS2CModem::start(), UwMODAModem::start(), UwModemCSA::start(), and UwModem().
|
protected |
Modem's reception queue: holds packets eceived from the channel awaiting to be pushed up the stack
|
protected |
Modem's transmission queue: holds packets that are to be transmitted
Referenced by UwAhoiModem::recv(), UwEvoLogicsS2CModem::recv(), UwMODAModem::recv(), UwModemCSA::recv(), UwAhoiModem::transmittingData(), UwEvoLogicsS2CModem::transmittingData(), UwMODAModem::transmittingData(), and UwModemCSA::transmittingData().