DESERT 3.5.1
|
#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 |
Definition at line 69 of file uwmodem.cpp.
|
virtual |
UwModem destructor.
Definition at line 95 of file uwmodem.cpp.
|
protected |
Method to check if any event from real world has to go to ns.
Definition at line 170 of file uwmodem.cpp.
|
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.
Definition at line 127 of file uwmodem.cpp.
|
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 |
Definition at line 163 of file uwmodem.cpp.
|
inline |
Method to return the flag used to enable debug messages.
|
inline |
Method to return the name of the file where to log messages.
|
inline |
Method to return the flag used to enable the printing of log messages in UwEvoLogicsS2CModem::logFile.
|
inline |
|
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.
|
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 |
Definition at line 52 of file uwmodem.cpp.
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.
Definition at line 102 of file uwmodem.cpp.
|
inline |
|
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.
|
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 |
|
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.
|
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.
|
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 |
Definition at line 34 of file uwmodem.cpp.
|
friend |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Log level on file, from ERROR (0) to DEBUG (2) in UwEvoLogicsS2CModem::logFile.
|
protected |
|
protected |
|
protected |
|
protected |
output strem to print into a disk-file log messages.
|
protected |
|
protected |
|
protected |