109 virtual void recv(Packet *p) = 0;
120 virtual int command(
int argc,
const char *
const *argv);
284 virtual void endTx(Packet *p);
340 <<
": in constructor of CheckTimer which points to modem: "
351 virtual void expire(Event *e);
The class used by UwModem to handle simulator's event expirations; it is exploited to schedule the re...
UwModem * pmModem
Pointer to an UwModem object.
virtual void expire(Event *e)
Method to handle the expiration of a given event.
CheckTimer(UwModem *pmModem_)
Class constructor.
Class that implements the interface to DESERT, as used through Tcl scripts.
void setModemID(int ID)
Set the modem's ID number.
void realTxEnded(Packet *p)
Method to call endTx from end of real packet transmission.
LogLevel
Enum representing the amount of logs being generated ERROR: only errors will be generated INFO : gene...
std::string log_suffix
Possibility to insert a log suffix.
static bool string2log(const std::string &ll_string, LogLevel &ll)
Method that converts a string representing the loglevel into the enum type of loglevel.
std::string modem_address
String containing the address needed to connect to the device In case of socket, it may be expressed ...
UwModem()
UwModem constructor.
virtual void stop()=0
Method that stops the driver operations.
virtual void recv(Packet *p)=0
Method that handles the reception of packets arriving from the upper layers of the network simulator.
std::queue< ModemEvent > event_q
Queue of events that are scheduled for NS2 to execute (callbacks)
int getModemID()
Method that returns the current ID of the modem.
static bool log2string(LogLevel ll, std::string &ll_string)
Method that converts an enum type of the loglevel into the string representing it.
virtual void startTx(Packet *p)=0
Method that triggers the transmission of a packet through a specified modem.
virtual void endRx(Packet *p)=0
Method that ends a packet reception.
bool log_is_open
Flag to check if log file has already be opened.
std::string logFile
Name of the disk-file where to write the interface's log messages.
virtual void start()=0
Method that starts the driver operations.
virtual int recvSyncClMsg(ClMessage *m)=0
Cross-Layer messages synchronous interpreter.
void checkEvent()
Method to check if any event from real world has to go to ns.
int MAX_READ_BYTES
Maximum number of bytes to be read by a single dump of data.
int debug_
Usual debug value that chooses the debug level through Tcl interface.
CheckTimer * checkTimer
Pointer to an object to schedule the "check-modem" events.
LogLevel loglevel_
Log level on file, from ERROR (0) to DEBUG (2) in UwEvoLogicsS2CModem::logFile.
std::queue< Packet * > tx_queue
Modem's transmission queue: holds packets that are to be transmitted.
void 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 messag...
virtual ~UwModem()
UwModem destructor.
unsigned int DATA_BUFFER_LEN
Size of the buffer that holds data.
virtual void endTx(Packet *p)
Method that ends a packet transmission.
std::ofstream outLog
output strem to print into a disk-file log messages.
virtual int getModulationType(Packet *P)
Method that should return the modulation type used for the packet being transmitted.
int getDebug()
Method to return the flag used to enable debug messages.
virtual int command(int argc, const char *const *argv)
Tcl command interpreter: Method that maps Tcl commands into C++ methods.
virtual void startRx(Packet *p)=0
Method that starts a packet reception.
std::vector< char > data_buffer
Char buffer (vector) that holds data read from the modem (unparsed data) Main container for data rece...
std::queue< Packet * > rx_queue
Modem's reception queue: holds packets eceived from the channel awaiting to be pushed up the stack.
virtual double getTxDuration(Packet *p)
Method that returnd the duration of a given transmitted packet.
int modemID
Number used for identification purposes: not specified.
double period
Checking period of the modem's buffer.
LogLevel getLogLevel()
Method to return the flag used to enable the printing of log messages in UwEvoLogicsS2CModem::logFile...
std::string getLogFile()
Method to return the name of the file where to log messages.
Header of the class providing the Uwal header's description.
std::function< void(UwModem &, Packet *p)> f
Header of the main class that implements the adaptation layer between ns2/NS-Miracle and binary data ...
Provides the UWIP packets header description. Definition of the class that define the network layer.