DESERT 4.0.0
MdriverS2C_Evo_lowlev Class Reference

#include <mdriverS2C_Evo_lowlev.h>

Inheritance diagram for MdriverS2C_Evo_lowlev:
Inheritance graph
Collaboration diagram for MdriverS2C_Evo_lowlev:
Collaboration graph

Public Member Functions

 MdriverS2C_Evo_lowlev (UWMPhy_modem *)
 
 ~MdriverS2C_Evo_lowlev ()
 
void start ()
 
void stop ()
 
void setBitrate (int index)
 
void setSourceLevel (int level)
 
void setPktBitLen (int bitlen)
 
void modemTx ()
 
void modemTxBurst ()
 
void modemTxPBM ()
 
void modemCfgDSP ()
 
void modemCfgBitrate ()
 
virtual void modemSetID ()
 
virtual modem_state_t updateStatus ()
 
- Public Member Functions inherited from UWMdriver
 UWMdriver (UWMPhy_modem *)
 
 ~UWMdriver ()
 
void setID (int ID_)
 
void resetModemStatus ()
 
void updateTx (int, std::string)
 
void updateRx (int, int, std::string)
 
int getID ()
 
modem_state_t getStatus ()
 
std::string getRxPayload ()
 
int getSrc ()
 
int getDstPktRx ()
 
log_level_t getDebug ()
 
void setModemID (bool set)
 
bool getModemID ()
 
void setResetModemQueue (bool reset_m_queue)
 
bool getResetModemQueue ()
 
log_level_t getLogLevel ()
 
std::string getLogFile ()
 
void printOnLog (log_level_t log_level, std::string module, std::string message)
 
 UWMdriver (UWMPhy_modem *)
 
 ~UWMdriver ()
 
void setID (int ID_)
 
void resetModemStatus ()
 
void updateTx (int, std::string)
 
void updateRx (int, int, std::string)
 
int getID ()
 
modem_state_t getStatus ()
 
std::string getRxPayload ()
 
int getSrc ()
 
int getDstPktRx ()
 
log_level_t getDebug ()
 
void setModemID (bool set)
 
bool getModemID ()
 
void setResetModemQueue (bool reset_m_queue)
 
bool getResetModemQueue ()
 
log_level_t getLogLevel ()
 
std::string getLogFile ()
 
void printOnLog (log_level_t log_level, std::string module, std::string message)
 

Protected Member Functions

void modemTxManager ()
 
void updateTxState (ll_tx_state_t)
 
- Protected Member Functions inherited from UWMdriver
void setConnections (UWMinterpreter *, UWMconnector *)
 
void setConnections (UWMinterpreter *, UWMconnector *)
 

Private Attributes

MinterpreterTEL mInterpreter
 
Msocket mConnector
 
ll_tx_state_t m_state_tx
 
ll_rx_state_t m_state_rx
 
std::queue< std::string > queue_tx
 
std::queue< std::string > queue_rx
 
int _gain
 
int _SL
 
int _bitrate_i
 
int _chipset
 
int _th
 
int _mps_th
 
double _delay
 
int _delay_flag
 
int _msg_bitlen
 

Additional Inherited Members

- Protected Attributes inherited from UWMdriver
UWMPhy_modempmModem
 
UWMinterpreterpmInterpreter
 
UWMconnectorpmConnector
 
int ID
 
modem_state_t status
 
std::string payload_tx
 
int dest
 
std::string payload_rx
 
int src
 
int dstPktRx
 
bool SetModemID
 
int debug_
 
std::ofstream outLog
 
bool ResetModemQueue
 

Detailed Description

Class containing the basic functions to drive the S2C EvoLogics acoustic modem transmissions/receptions according to Low Level drivers (this class is a derived class of UWMdriver).

Constructor & Destructor Documentation

◆ MdriverS2C_Evo_lowlev()

MdriverS2C_Evo_lowlev::MdriverS2C_Evo_lowlev ( UWMPhy_modem pmModem_)

Class constructor

References m_state_rx, m_state_tx, mConnector, mInterpreter, RX_STATE_IDLE, UWMdriver::setConnections(), and TX_STATE_IDLE.

Here is the call graph for this function:

◆ ~MdriverS2C_Evo_lowlev()

MdriverS2C_Evo_lowlev::~MdriverS2C_Evo_lowlev ( )

Class destructor

Member Function Documentation

◆ modemCfgBitrate()

void MdriverS2C_Evo_lowlev::modemCfgBitrate ( )

Method that notifies the driver that there is a configuration to be sent to the modem (Bitrate). NOTE: when this function is called (by an UWMPhy_modem object) the driver's status must be set to MODEM_TX and the configuration must be sent immediately to the modem.

◆ modemCfgDSP()

void MdriverS2C_Evo_lowlev::modemCfgDSP ( )

Method that notifies the driver that there is a configuration to be sent to the modem (DSP). NOTE: when this function is called (by an UWMPhy_modem object) the driver's status must be set to MODEM_TX and the configuration must be sent immediately to the modem.

◆ modemSetID()

void MdriverS2C_Evo_lowlev::modemSetID ( )
virtual

Method to set the ID of the modem. On the Low Level firmware is not possible to set any ID so the method is left empty.

Implements UWMdriver.

◆ modemTx()

void MdriverS2C_Evo_lowlev::modemTx ( )
virtual

Method that notifies the driver that there is a packet to be sent via the modem. NOTE: when this function is called (by an UWMPhy_modem object) the driver's status must be set to MODEM_TX and the packet must be sent immediately to the modem.

Implements UWMdriver.

References m_state_tx, MODEM_TX, modemTxManager(), UWMdriver::status, and TX_STATE_DATA.

Here is the call graph for this function:

◆ modemTxBurst()

void MdriverS2C_Evo_lowlev::modemTxBurst ( )

Method that notifies the driver that there is a packet to be sent via the modem. On the Low Level firmware nothing as this exists so the call is passed to modemTx(). NOTE: when this function is called (by an UWMPhy_modem object) the driver's status must be set to MODEM_TX and the packet must be sent immediately to the modem.

◆ modemTxManager()

◆ modemTxPBM()

void MdriverS2C_Evo_lowlev::modemTxPBM ( )

Method that notifies the driver that there is a packet to be sent via the modem. On the Low Level firmware nothing as this exists so the call is passed to modeTx(). NOTE: when this function is called (by an UWMPhy_modem object) the driver's status must be set to MODEM_TX and the packet must be sent immediately to the modem.

◆ setBitrate()

void MdriverS2C_Evo_lowlev::setBitrate ( int  index)

Method to set the bitrate that will be sent to the modem config

References _bitrate_i.

Referenced by MS2C_Evo_lowlev::MS2C_Evo_lowlev().

◆ setPktBitLen()

void MdriverS2C_Evo_lowlev::setPktBitLen ( int  bitlen)

Method to set the msg bitlength that will be received by rx

References _msg_bitlen.

Referenced by MS2C_Evo_lowlev::MS2C_Evo_lowlev().

◆ setSourceLevel()

void MdriverS2C_Evo_lowlev::setSourceLevel ( int  level)

Method to set the source level that will be sent to the modem config

References _SL.

Referenced by MS2C_Evo_lowlev::MS2C_Evo_lowlev().

◆ start()

void MdriverS2C_Evo_lowlev::start ( )
virtual

Method to let the driver start operations and initialize configurations.

Implements UWMdriver.

References LOG_LEVEL_DEBUG, m_state_tx, mConnector, MODEM_CFG, modemTxManager(), Msocket::openConnection(), UWMdriver::printOnLog(), UWMconnector::readFromModem(), UWMdriver::status, and TX_STATE_ON1.

Here is the call graph for this function:

◆ stop()

void MdriverS2C_Evo_lowlev::stop ( )
virtual

Method to stop the driver operations. To be called before finishing the simulation.

Implements UWMdriver.

References Msocket::closeConnection(), m_state_tx, mConnector, MODEM_QUIT, modemTxManager(), UWMconnector::readFromModem(), UWMdriver::status, and TX_STATE_OFF1.

Here is the call graph for this function:

◆ updateStatus()

modem_state_t MdriverS2C_Evo_lowlev::updateStatus ( )
virtual

Method to update modem status. This method has to update the modem status according to the messages received from the modem/channel (e.g., after a check of the modem buffer's output). NOTE: This method may return after an arbitrary period if nothing has happened, but it must return immediately after a change of UWMdriver::status.

Returns
UWMdriver::status, the updated modem's status.

Implements UWMdriver.

References LOG_LEVEL_INFO, m_state_rx, m_state_tx, mConnector, mInterpreter, MODEM_CFG, MODEM_IDLE, MODEM_IDLE_RX, MODEM_QUIT, MODEM_RESET, MODEM_RX, MODEM_TX, modemTxManager(), MinterpreterTEL::parse_TELEGRAM(), UWMdriver::payload_rx, UWMdriver::printOnLog(), queue_rx, queue_tx, UWMconnector::readFromModem(), RX_STATE_DATA, RX_STATE_IDLE, UWMdriver::status, TX_STATE_BITRATE_CFG, TX_STATE_DSP_CFG, and TX_STATE_IDLE.

Here is the call graph for this function:

◆ updateTxState()

void MdriverS2C_Evo_lowlev::updateTxState ( ll_tx_state_t  state)
protected

Method for updating the state after a significant change, namely: a configuration of the firmware parameters, a trasmission of a packet and a reception of a packet.

References m_state_tx, modemTxManager(), TX_STATE_ASK_BUSY, TX_STATE_BITRATE_CFG, TX_STATE_CLEAR_TX, TX_STATE_CTRL, TX_STATE_DATA, TX_STATE_DSP_CFG, TX_STATE_IDLE, TX_STATE_OFF1, TX_STATE_OFF2, TX_STATE_OFF3, TX_STATE_ON1, TX_STATE_ON2, TX_STATE_ON3, TX_STATE_ON4, and TX_STATE_STOP_LISTEN.

Referenced by modemTxManager().

Here is the call graph for this function:

Member Data Documentation

◆ _bitrate_i

int MdriverS2C_Evo_lowlev::_bitrate_i
private

Variable holding the bitrate index of the low level firmware

Referenced by modemTxManager(), and setBitrate().

◆ _chipset

int MdriverS2C_Evo_lowlev::_chipset
private

Variable holding the chipset that will be used by the low level firmware

Referenced by modemTxManager().

◆ _delay

double MdriverS2C_Evo_lowlev::_delay
private

Variable that holds the delay required for doing some operations, e.g., sending a message, stopping listening

Referenced by modemTxManager().

◆ _delay_flag

int MdriverS2C_Evo_lowlev::_delay_flag
private

Variable that holds that flag that triggers the waiting time for some operations e.g., sending a packet, stopping listening

Referenced by modemTxManager().

◆ _gain

int MdriverS2C_Evo_lowlev::_gain
private

Variable holding the Gain level of the low level driver

Referenced by modemTxManager().

◆ _mps_th

int MdriverS2C_Evo_lowlev::_mps_th
private

Variable holding the MPS treshold used by the low level firmware

Referenced by modemTxManager().

◆ _msg_bitlen

int MdriverS2C_Evo_lowlev::_msg_bitlen
private

Very very temporary parameter to let the receiver not screw up and read only the, known, number of bytes

Referenced by modemTxManager(), and setPktBitLen().

◆ _SL

int MdriverS2C_Evo_lowlev::_SL
private

Variable holding the Source Level of the low level driver

Referenced by modemTxManager(), and setSourceLevel().

◆ _th

int MdriverS2C_Evo_lowlev::_th
private

Variable holding the threshold used by the low level firmware

Referenced by modemTxManager().

◆ m_state_rx

ll_rx_state_t MdriverS2C_Evo_lowlev::m_state_rx
private

RX state to manage reception methods

Referenced by MdriverS2C_Evo_lowlev(), and updateStatus().

◆ m_state_tx

ll_tx_state_t MdriverS2C_Evo_lowlev::m_state_tx
private

TX state to manage transmission methods

Referenced by MdriverS2C_Evo_lowlev(), modemTx(), modemTxManager(), start(), stop(), updateStatus(), and updateTxState().

◆ mConnector

Msocket MdriverS2C_Evo_lowlev::mConnector
private

Object that handles the physical host to modem communications via TCP/IP sockets.

Referenced by MdriverS2C_Evo_lowlev(), modemTxManager(), start(), stop(), and updateStatus().

◆ mInterpreter

MinterpreterTEL MdriverS2C_Evo_lowlev::mInterpreter
private

Object that builds/parses TELEGRAMS and GPIO settings.

Referenced by MdriverS2C_Evo_lowlev(), modemTxManager(), and updateStatus().

◆ queue_rx

std::queue<std::string> MdriverS2C_Evo_lowlev::queue_rx
private

Queue used to buffer incoming strings for rx messages.

Referenced by updateStatus().

◆ queue_tx

std::queue<std::string> MdriverS2C_Evo_lowlev::queue_tx
private

Queue used to buffer incoming strings for tx messages.

Referenced by updateStatus().


The documentation for this class was generated from the following files: