#include <uwevologicss2cmodem.h>
◆ Config
Enum listing the availbale configuration settings. See the EvoLogics S2C manuals or reach for www.evologics.de
| Enumerator |
|---|
| ATL_GET | |
| ATL_SET | |
| ATAL_GET | |
| ATAL_SET | |
| MODEM_STATUS | |
| CURR_SETTINGS | |
| UNKNOWN | |
◆ TransmissionMode
Transmission mode: either IM or BURST See the EvoLogics S2C manuals or reach for www.evologics.de
◆ TransmissionState
Transmission state: controls the flow of execution for sending commands to the S2C device
| Enumerator |
|---|
| TX_IDLE | |
| TX_PENDING | |
◆ UwEvoLogicsS2CModem()
| UwEvoLogicsS2CModem::UwEvoLogicsS2CModem |
( |
| ) |
|
◆ ~UwEvoLogicsS2CModem()
| UwEvoLogicsS2CModem::~UwEvoLogicsS2CModem |
( |
| ) |
|
|
virtual |
◆ command()
| int UwEvoLogicsS2CModem::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 ack_mode, BURST, UwModem::command(), IM, initializeLUT(), p_connector, p_interpreter, start(), stop(), tx_mode, txdur_file_name_, and txdur_token_separator_.
Referenced by configure().
◆ configure()
| bool UwEvoLogicsS2CModem::configure |
( |
Config |
cmd | ) |
|
|
virtual |
Method that sends a written configuration the the EvoLgoics modem. The configuration string could be a request of configurations (the AT commands conaining '?') or a setting command (the AT commands containing '!').
- Parameters
-
| command | the command string complying with the device format requirements. |
- Returns
- boolean true if the command was correctly sent to the device
References ATAL_GET, ATAL_SET, ATL_GET, ATL_SET, BUSY, command(), CURR_SETTINGS, UwModem::ERROR, MODEM_STATUS, MODEM_TIMEOUT, UwModem::modemID, p_connector, p_interpreter, pend_source_level, UwModem::printOnLog(), status, status_cv, status_m, TX_PENDING, tx_status, and tx_status_m.
◆ createRxPacket()
| void UwEvoLogicsS2CModem::createRxPacket |
( |
Packet * |
p | ) |
|
|
private |
◆ endRx()
| void UwEvoLogicsS2CModem::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().
◆ getTxDuration()
| double UwEvoLogicsS2CModem::getTxDuration |
( |
Packet * |
p | ) |
|
|
virtual |
◆ initializeLUT()
| void UwEvoLogicsS2CModem::initializeLUT |
( |
| ) |
|
|
virtual |
◆ receivingData()
| void UwEvoLogicsS2CModem::receivingData |
( |
| ) |
|
|
privatevirtual |
Mehod that detach a thread devoted to receiving data from the connector.
References UwModem::data_buffer, UwModem::DATA_BUFFER_LEN, UwModem::DEBUG, UwModem::MAX_READ_BYTES, UwInterpreterS2C::NO_COMMAND, p_connector, p_interpreter, UwModem::printOnLog(), receiving, rx_payload, and updateStatus().
Referenced by start().
◆ recv()
| void UwEvoLogicsS2CModem::recv |
( |
Packet * |
p | ) |
|
|
virtual |
◆ recvSyncClMsg()
| int UwEvoLogicsS2CModem::recvSyncClMsg |
( |
ClMessage * |
m | ) |
|
|
virtual |
Cross-Layer messages synchronous interpreter.
- Parameters
-
| ClMessage* | an instance of ClMessage that represent the message received |
- Returns
- 0 if successful.
Implements UwModem.
References BURST, CLMSG_S2C_POWER_LEVEL, CLMSG_S2C_RX_FAILED, CLMSG_S2C_TX_MODE, curr_source_level, ClMsgS2CPowerLevel::get_power_level(), ClMsgUwPhy::GET_REPLY, ClMsgUwPhy::GET_REQ, ClMsgS2CTxMode::get_tx_mode(), ClMsgUwPhy::getReqType(), getTxDuration(), IM, UwModem::INFO, n_rx_failed, pend_source_level, UwModem::printOnLog(), ClMsgS2CTxMode::S2C_TX_MODE_BURST, ClMsgS2CTxMode::S2C_TX_MODE_IM, ClMsgS2CRxFailed::set_n_rx_failed(), ClMsgS2CPowerLevel::set_power_level(), ClMsgUwPhy::SET_REPLY, ClMsgUwPhy::SET_REQ, ClMsgS2CTxMode::set_tx_mode(), ClMsgUwPhy::setReqType(), source_level_change, and tx_mode.
◆ setFailedTx()
| void UwEvoLogicsS2CModem::setFailedTx |
( |
Packet * |
p | ) |
|
|
private |
Method that allows to set the error flag on the packet to notify upper layers about un-tranmsitted packets due to, e.g., modem unavailability.
- Parameters
-
| p | Packet pointer ot the packet being transmitted |
◆ start()
| void UwEvoLogicsS2CModem::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.
Referenced by command().
◆ startRx()
| void UwEvoLogicsS2CModem::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 UwEvoLogicsS2CModem::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 ack_mode, AVAILABLE, hdr_uwal::binPkt(), hdr_uwal::binPktLength(), BUSY, UwModem::DEBUG, UwModem::ERROR, UwModem::event_q, IM, im_status_updated, UwModem::INFO, MAX_N_STATUS_QUERIES, MODEM_TIMEOUT, p_connector, p_interpreter, UwModem::printOnLog(), UwModem::realTxEnded(), status, status_cv, status_m, TX_IDLE, tx_mode, TX_PENDING, tx_status, tx_status_cv, tx_status_m, WAIT_DELIVERY_BURST, and WAIT_DELIVERY_IM.
Referenced by transmittingData().
◆ stop()
| void UwEvoLogicsS2CModem::stop |
( |
| ) |
|
|
privatevirtual |
Method that stops the driver operations. It performs all the needed operations to correctly stop the device's driver before closing the simulation.
Implements UwModem.
References UwModem::checkTimer, UwModem::ERROR, UwModem::INFO, p_connector, UwModem::printOnLog(), receiving, rx_thread, transmitting, tx_queue_cv, and tx_thread.
Referenced by command(), and ~UwEvoLogicsS2CModem().
◆ transmittingData()
| void UwEvoLogicsS2CModem::transmittingData |
( |
| ) |
|
|
privatevirtual |
◆ updateStatus()
Method that updates the status of the modem State Machine: state change is triggered by reception of commands on the connector interface, or by commands to be sent to the device, e.g., SEND or SENDIM.
- Parameters
-
| cmd | command received on the connector interface |
References AVAILABLE, UwInterpreterS2C::BITRATE, UwInterpreterS2C::BUFF_NOT_EMPTY, UwInterpreterS2C::BUFFER_FULL, BUSY, UwInterpreterS2C::BUSY, UwInterpreterS2C::CONN_CLOSED, createRxPacket(), DEAF, UwModem::DEBUG, UwInterpreterS2C::DELIVERED, UwInterpreterS2C::DELIVERING, UwInterpreterS2C::DROPCNT, UwInterpreterS2C::EMPTY, UwModem::event_q, UwInterpreterS2C::FAIL, im_status_updated, UwModem::INFO, UwInterpreterS2C::INIT_DEAF, UwInterpreterS2C::INIT_LISTEN, UwInterpreterS2C::INIT_NOISE, UwInterpreterS2C::INTERNAL, n_rx_failed, NOISE, UwInterpreterS2C::NOT_ACCEPTED, UwInterpreterS2C::OK, UwInterpreterS2C::OUT_OF_RANGE, p_interpreter, UwInterpreterS2C::PHYOFF, UwModem::printOnLog(), UwInterpreterS2C::PROTOCOL_ID, QUIT, UwInterpreterS2C::RECV, UwModem::recv(), UwInterpreterS2C::RECVEND, UwInterpreterS2C::RECVFAIL, UwInterpreterS2C::RECVIM, UwInterpreterS2C::RECVSTART, RESET, UwInterpreterS2C::SENDEND, UwInterpreterS2C::SENDSTART, status, status_cv, status_m, TX_IDLE, tx_status, tx_status_cv, tx_status_m, UwInterpreterS2C::UNKNOWN, UwInterpreterS2C::USBLANGLES, UwInterpreterS2C::USBLLONG, and UwInterpreterS2C::WRONG_ADDR.
Referenced by receivingData().
◆ ack_mode
| bool UwEvoLogicsS2CModem::ack_mode |
|
private |
◆ curr_source_level
| int UwEvoLogicsS2CModem::curr_source_level |
|
private |
◆ EPSILON_S
| const double UwEvoLogicsS2CModem::EPSILON_S |
|
staticprivate |
Minimum time to wait before to schedule a new event in seconds
◆ im_status_updated
| std::atomic<bool> UwEvoLogicsS2CModem::im_status_updated |
|
private |
Atomic boolean variable controlling if the modem had responded to ATDI
Referenced by startTx(), and updateStatus().
◆ initLUT_
| bool UwEvoLogicsS2CModem::initLUT_ |
|
private |
◆ MAX_N_STATUS_QUERIES
| uint UwEvoLogicsS2CModem::MAX_N_STATUS_QUERIES = 10 |
|
staticprivate |
Maximum number of time to query the modem transmission status before to discard the transmitted packet
Referenced by startTx(), and UwEvoLogicsS2CModem().
◆ MODEM_TIMEOUT
| const std::chrono::milliseconds UwEvoLogicsS2CModem::MODEM_TIMEOUT |
|
staticprivate |
◆ n_rx_failed
| int UwEvoLogicsS2CModem::n_rx_failed |
|
private |
◆ p_connector
| std::unique_ptr<UwConnector> UwEvoLogicsS2CModem::p_connector |
|
private |
◆ p_interpreter
◆ pend_source_level
| int UwEvoLogicsS2CModem::pend_source_level |
|
private |
◆ receiving
| std::atomic<bool> UwEvoLogicsS2CModem::receiving |
|
private |
◆ rx_payload
| std::string UwEvoLogicsS2CModem::rx_payload |
|
private |
◆ rx_thread
| std::thread UwEvoLogicsS2CModem::rx_thread |
|
private |
◆ size2dur_
◆ source_level_change
| bool UwEvoLogicsS2CModem::source_level_change |
|
private |
Flag that tells a new SL value to be applied
Referenced by recvSyncClMsg().
◆ status
◆ status_cv
| std::condition_variable UwEvoLogicsS2CModem::status_cv |
|
private |
◆ status_m
| std::mutex UwEvoLogicsS2CModem::status_m |
|
private |
◆ transmitting
| std::atomic<bool> UwEvoLogicsS2CModem::transmitting |
|
private |
◆ tx_mode
◆ tx_queue_cv
| std::condition_variable UwEvoLogicsS2CModem::tx_queue_cv |
|
private |
◆ tx_queue_m
| std::mutex UwEvoLogicsS2CModem::tx_queue_m |
|
private |
◆ tx_status
◆ tx_status_cv
| std::condition_variable UwEvoLogicsS2CModem::tx_status_cv |
|
private |
◆ tx_status_m
| std::mutex UwEvoLogicsS2CModem::tx_status_m |
|
private |
◆ tx_thread
| std::thread UwEvoLogicsS2CModem::tx_thread |
|
private |
◆ txdur_file_name_
| std::string UwEvoLogicsS2CModem::txdur_file_name_ |
|
private |
◆ txdur_token_separator_
| char UwEvoLogicsS2CModem::txdur_token_separator_ |
|
private |
◆ virtual_time_ref
| double UwEvoLogicsS2CModem::virtual_time_ref |
|
private |
◆ WAIT_DELIVERY_BURST
| const std::chrono::seconds UwEvoLogicsS2CModem::WAIT_DELIVERY_BURST |
|
staticprivate |
Initial value:=
std::chrono::seconds(5)
Time interval tu wait for a burst message tobe confirmed through a DELIVERED response. Given in SECONDS
Referenced by startTx().
◆ WAIT_DELIVERY_IM
| const std::chrono::milliseconds UwEvoLogicsS2CModem::WAIT_DELIVERY_IM |
|
staticprivate |
Initial value:=
std::chrono::milliseconds(200)
Time interval to wait for the modem notifying that there no more IM in its queue and a new IM can be sent
Referenced by startTx().
The documentation for this class was generated from the following files: