DESERT 4.0.0
UWMconnector Class Referenceabstract

#include <uwmconnector.h>

Inheritance diagram for UWMconnector:
Inheritance graph
Collaboration diagram for UWMconnector:
Collaboration graph

Public Member Functions

 UWMconnector (UWMdriver *, std::string)
 
 ~UWMconnector ()
 
virtual int openConnection ()=0
 
virtual void closeConnection ()
 
virtual int writeToModem (std::string)=0
 
std::string readFromModem ()
 
void setDriverQueueLength (int length)
 
uint getDriverQueueLength ()
 
 UWMconnector (UWMdriver *, std::string)
 
 ~UWMconnector ()
 
virtual int openConnection ()=0
 
virtual void closeConnection ()
 
virtual int writeToModem (std::string)=0
 
std::string readFromModem ()
 
void setDriverQueueLength (int length)
 
uint getDriverQueueLength ()
 

Public Attributes

std::queue< msgModemqueueMsg
 

Protected Attributes

UWMdriverpmDriver
 
std::string pathToDevice
 
uint driver_queue_length
 

Detailed Description

The class needed by UWMPhy_modem to manage string exchange with the modem. This class just provides the definition of the basic needed functionalities and it must be extended to handle e.g., serial connection (see Mserial) or TCP/IP connection (see Msocket).

Constructor & Destructor Documentation

◆ UWMconnector() [1/2]

UWMconnector::UWMconnector ( UWMdriver pmDriver_,
std::string  pathToDevice_ 
)

Class constructor.

Parameters
pmDriver_pointer to the UWMdriver object to link with this UWMconnector object.
pathToDevice_the path to the device that must be connected with NS-Miracle (e.g., /dev/ttyUSB0 for a serial connection)

References pathToDevice, and pmDriver.

◆ ~UWMconnector() [1/2]

UWMconnector::~UWMconnector ( )

Class destructor.

◆ UWMconnector() [2/2]

UWMconnector::UWMconnector ( UWMdriver ,
std::string   
)

Class constructor.

Parameters
pmDriver_pointer to the UWMdriver object to link with this UWMconnector object.
pathToDevice_the path to the device that must be connected with NS-Miracle (e.g., /dev/ttyUSB0 for a serial connection)

◆ ~UWMconnector() [2/2]

UWMconnector::~UWMconnector ( )

Class destructor.

Member Function Documentation

◆ closeConnection() [1/2]

virtual void UWMconnector::closeConnection ( )
virtual

Method to close the connection with the modem.

Reimplemented in Msocket, and Msocket.

◆ closeConnection() [2/2]

void UWMconnector::closeConnection ( )
virtual

Method to close the connection with the modem.

Reimplemented in Msocket, and Msocket.

◆ getDriverQueueLength() [1/2]

uint UWMconnector::getDriverQueueLength ( )
inline

References driver_queue_length.

◆ getDriverQueueLength() [2/2]

uint UWMconnector::getDriverQueueLength ( )
inline

References driver_queue_length.

Referenced by read_process_msocket().

◆ openConnection() [1/2]

virtual int UWMconnector::openConnection ( )
pure virtual

Method to open the connection with the modem.

Returns
_MODEM_OK if everything went fine, any other int value otherwise.

Implemented in Msocket, and Msocket.

◆ openConnection() [2/2]

virtual int UWMconnector::openConnection ( )
pure virtual

Method to open the connection with the modem.

Returns
_MODEM_OK if everything went fine, any other int value otherwise.

Implemented in Msocket, and Msocket.

◆ readFromModem() [1/2]

std::string UWMconnector::readFromModem ( )

Method to check the receiving modem buffer.

Returns
return_str the string corresponding to the last received message from the modem

◆ readFromModem() [2/2]

std::string UWMconnector::readFromModem ( )

Method to check the receiving modem buffer.

Returns
return_str the string corresponding to the last received message from the modem

References LOG_LEVEL_ERROR, msgModem::msg_rx, pmDriver, UWMdriver::printOnLog(), and queueMsg.

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

Here is the call graph for this function:

◆ setDriverQueueLength() [1/2]

void UWMconnector::setDriverQueueLength ( int  length)

◆ setDriverQueueLength() [2/2]

void UWMconnector::setDriverQueueLength ( int  length)

◆ writeToModem() [1/2]

virtual int UWMconnector::writeToModem ( std::string  )
pure virtual

Method for writing to the modem.

Parameters
[in]strthe string to pass to the modem
Returns
the number of transmitted bytes

Implemented in Msocket, and Msocket.

◆ writeToModem() [2/2]

virtual int UWMconnector::writeToModem ( std::string  )
pure virtual

Method for writing to the modem.

Parameters
[in]strthe string to pass to the modem
Returns
the number of transmitted bytes

Implemented in Msocket, and Msocket.

Member Data Documentation

◆ driver_queue_length

uint UWMconnector::driver_queue_length
protected

◆ pathToDevice

std::string UWMconnector::pathToDevice
protected

The path to be connected with the modem device

Referenced by Msocket::Msocket(), and UWMconnector().

◆ pmDriver

UWMdriver * UWMconnector::pmDriver
protected

Pointer to UWMdriver object that contains this UWMconnector.

Referenced by readFromModem(), and UWMconnector().

◆ queueMsg

std::queue< msgModem > UWMconnector::queueMsg

Queue used to buffer incoming strings from the modem.

Referenced by read_process_msocket(), and readFromModem().


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