#include <uwmodemcsa.h>
|
| virtual void | startTx (Packet *p) |
| |
| virtual void | startRx (Packet *p) |
| |
| virtual void | endRx (Packet *p) |
| |
| virtual void | start () |
| |
| virtual void | stop () |
| |
| virtual void | transmittingData () |
| |
| virtual void | receivingData () |
| |
| virtual std::string | findCommand (std::vector< char >::iterator beg_it, std::vector< char >::iterator end_it, std::vector< char >::iterator &cmd_b, std::vector< char >::iterator &cmd_e) |
| |
| virtual bool | parseCommand (std::vector< char >::iterator cmd_b, std::vector< char >::iterator cmd_e, std::string &rx_payload) |
| |
| virtual std::string | buildSend (const std::string &payload, int dest) |
| |
| void | startRealRx (const std::string &cmd) |
| |
| void | createRxPacket (Packet *p) |
| |
◆ UwModemCSA()
| UwModemCSA::UwModemCSA |
( |
| ) |
|
◆ ~UwModemCSA()
| UwModemCSA::~UwModemCSA |
( |
| ) |
|
|
virtual |
◆ buildSend()
| std::string UwModemCSA::buildSend |
( |
const std::string & |
payload, |
|
|
int |
dest |
|
) |
| |
|
privatevirtual |
◆ command()
| int UwModemCSA::command |
( |
int |
argc, |
|
|
const char *const * |
argv |
|
) |
| |
|
virtual |
Tcl command interpreter: Method that maps Tcl commands into C++ methods.
- Parameters
-
| 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). |
- Returns
- TCL_OK or TCL_ERROR whether the command has been dispatched successfully or not
Reimplemented from UwModem.
References UwModem::command(), and p_connector.
◆ createRxPacket()
| void UwModemCSA::createRxPacket |
( |
Packet * |
p | ) |
|
|
private |
◆ endRx()
| void UwModemCSA::endRx |
( |
Packet * |
p | ) |
|
|
privatevirtual |
Method that ends a packet reception. This method is also in charge of sending the received NS-MIRACLE packet to the upper layers
- Parameters
-
| p | Packet pointer to the packet being sent |
Implements UwModem.
References UwModem::INFO, and UwModem::printOnLog().
Referenced by recv().
◆ findCommand()
| std::string UwModemCSA::findCommand |
( |
std::vector< char >::iterator |
beg_it, |
|
|
std::vector< char >::iterator |
end_it, |
|
|
std::vector< char >::iterator & |
cmd_b, |
|
|
std::vector< char >::iterator & |
cmd_e |
|
) |
| |
|
privatevirtual |
◆ getTxDuration()
| double UwModemCSA::getTxDuration |
( |
Packet * |
p | ) |
|
|
virtual |
Method that returns 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.
- Parameters
-
| p | Packet pointer to the given packet being transmitted |
- Returns
- duration in seconds
Reimplemented from UwModem.
Referenced by recv(), and recvSyncClMsg().
◆ parseCommand()
| bool UwModemCSA::parseCommand |
( |
std::vector< char >::iterator |
cmd_b, |
|
|
std::vector< char >::iterator |
cmd_e, |
|
|
std::string & |
rx_payload |
|
) |
| |
|
privatevirtual |
◆ receivingData()
| void UwModemCSA::receivingData |
( |
| ) |
|
|
privatevirtual |
◆ recv()
| void UwModemCSA::recv |
( |
Packet * |
p | ) |
|
|
virtual |
◆ recvSyncClMsg()
| int UwModemCSA::recvSyncClMsg |
( |
ClMessage * |
m | ) |
|
|
virtual |
◆ start()
| void UwModemCSA::start |
( |
| ) |
|
|
privatevirtual |
Method that starts the driver operations. It performs all the needed operations to correctly fire up the device's driver.
Implements UwModem.
References UwModem::CheckTimer, UwModem::checkTimer, UwModem::ERROR, UwModem::modem_address, p_connector, UwModem::period, UwModem::printOnLog(), receiving, receivingData(), rx_thread, transmitting, transmittingData(), and tx_thread.
◆ startRealRx()
| void UwModemCSA::startRealRx |
( |
const std::string & |
cmd | ) |
|
|
private |
◆ startRx()
| void UwModemCSA::startRx |
( |
Packet * |
p | ) |
|
|
privatevirtual |
Method that starts a packet reception. This method is also in charge of sending a ClMsg, Phy2MacStartRx(p), to notify the upper layers of the simulator about the start of the reception
- Parameters
-
| p | Packet pointer to the packet to be received |
Implements UwModem.
References UwModem::INFO, and UwModem::printOnLog().
Referenced by recv().
◆ startTx()
| void UwModemCSA::startTx |
( |
Packet * |
p | ) |
|
|
privatevirtual |
Method that triggers the transmission of a packet through a specified modem.
- Parameters
-
| p | Packet pointer to the packet to be sent |
Implements UwModem.
References AVAILABLE, hdr_uwal::binPkt(), hdr_uwal::binPktLength(), buildSend(), BUSY, UwModem::ERROR, UwModem::event_q, UwModem::INFO, MODEM_TIMEOUT, p_connector, UwModem::printOnLog(), UwModem::realTxEnded(), status, status_cv, and status_m.
Referenced by transmittingData().
◆ stop()
| void UwModemCSA::stop |
( |
| ) |
|
|
privatevirtual |
◆ transmittingData()
| void UwModemCSA::transmittingData |
( |
| ) |
|
|
privatevirtual |
◆ del_b
| std::string UwModemCSA::del_b |
|
private |
◆ del_e
| std::string UwModemCSA::del_e |
|
private |
◆ EPSILON_S
| const double UwModemCSA::EPSILON_S = 0.01 |
|
staticprivate |
minimum time to wait before to schedule a new event in seconds
◆ MAX_TX_STATUS_POLL
| const size_t UwModemCSA::MAX_TX_STATUS_POLL = 20 |
|
staticprivate |
maximum number of time to poll the modem transmission status before to discard the transmitted packet
◆ MODEM_TIMEOUT
| const std::chrono::milliseconds UwModemCSA::MODEM_TIMEOUT |
|
staticprivate |
◆ p_connector
◆ receiving
| std::atomic<bool> UwModemCSA::receiving |
|
private |
◆ rx_payload
| std::string UwModemCSA::rx_payload |
|
private |
◆ rx_thread
| std::thread UwModemCSA::rx_thread |
|
private |
◆ status
◆ status_cv
| std::condition_variable UwModemCSA::status_cv |
|
private |
◆ status_m
| std::mutex UwModemCSA::status_m |
|
private |
◆ transmitting
| std::atomic<bool> UwModemCSA::transmitting |
|
private |
◆ tx_queue_cv
| std::condition_variable UwModemCSA::tx_queue_cv |
|
private |
◆ tx_queue_m
| std::mutex UwModemCSA::tx_queue_m |
|
private |
◆ tx_thread
| std::thread UwModemCSA::tx_thread |
|
private |
The documentation for this class was generated from the following files: