Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | Friends | List of all members
io_comm_rx::Comm_IO Class Reference

Handles communication with and configuration of the mosaic (and beyond) receiver(s) More...

#include <communication_core.hpp>

Public Member Functions

 Comm_IO ()
 Default constructor of the class Comm_IO. More...
 
CallbackHandlers getHandlers () const
 
bool initializeSerial (std::string port, uint32_t baudrate=115200, std::string flowcontrol="None")
 Initializes the serial port. More...
 
bool initializeTCP (std::string host, std::string port)
 Initializes the TCP I/O. More...
 
void resetSerial (std::string port)
 Reset the Serial I/O port, e.g. after a Rx reset. More...
 
void send (std::string cmd)
 
void setManager (const boost::shared_ptr< Manager > &manager)
 Set the I/O manager. More...
 
virtual ~Comm_IO ()=default
 Default destructor of the class Comm_IO. More...
 

Public Attributes

CallbackHandlers handlers_
 Callback handlers for the inwards streaming messages. More...
 

Private Attributes

uint32_t baudrate_
 Baudrate at the moment, unless InitializeSerial or ResetSerial fail. More...
 
std::string host_
 Host currently connected to. More...
 
boost::shared_ptr< Managermanager_
 
std::string port_
 Port over which TCP/IP connection is currently established. More...
 
std::string serial_port_
 Saves the port description. More...
 

Static Private Attributes

static const unsigned int SET_BAUDRATE_SLEEP_ = 500000
 

Friends

class CallbackHandlers
 
class RxMessage
 

Detailed Description

Handles communication with and configuration of the mosaic (and beyond) receiver(s)

Definition at line 102 of file communication_core.hpp.

Constructor & Destructor Documentation

◆ Comm_IO()

io_comm_rx::Comm_IO::Comm_IO ( )

Default constructor of the class Comm_IO.

Definition at line 39 of file communication_core.cpp.

◆ ~Comm_IO()

virtual io_comm_rx::Comm_IO::~Comm_IO ( )
virtualdefault

Default destructor of the class Comm_IO.

Member Function Documentation

◆ getHandlers()

CallbackHandlers io_comm_rx::Comm_IO::getHandlers ( ) const
inline

Definition at line 147 of file communication_core.hpp.

◆ initializeSerial()

bool io_comm_rx::Comm_IO::initializeSerial ( std::string  port,
uint32_t  baudrate = 115200,
std::string  flowcontrol = "None" 
)

Initializes the serial port.

Parameters
[in]portThe device's port address
[in]baudrateThe chosen baud rate of the port
[in]flowcontrolDefault is "None", set variable (not yet checked) to "RTS|CTS" to activate hardware flow control (only for serial ports COM1, COM2 and COM3 (for mosaic))
Returns
True if connection could be established, false otherwise

Definition at line 101 of file communication_core.cpp.

◆ initializeTCP()

bool io_comm_rx::Comm_IO::initializeTCP ( std::string  host,
std::string  port 
)

Initializes the TCP I/O.

Parameters
[in]hostThe TCP host
[in]portThe TCP port
Returns
True if connection could be established, false otherwise

Definition at line 47 of file communication_core.cpp.

◆ resetSerial()

void io_comm_rx::Comm_IO::resetSerial ( std::string  port)

Reset the Serial I/O port, e.g. after a Rx reset.

Parameters
[in]portThe device's port address

Definition at line 249 of file communication_core.cpp.

◆ send()

void io_comm_rx::Comm_IO::send ( std::string  cmd)

Definition at line 41 of file communication_core.cpp.

◆ setManager()

void io_comm_rx::Comm_IO::setManager ( const boost::shared_ptr< Manager > &  manager)

Set the I/O manager.

Parameters
[in]managerAn I/O handler

Definition at line 240 of file communication_core.cpp.

Friends And Related Function Documentation

◆ CallbackHandlers

friend class CallbackHandlers
friend

Definition at line 164 of file communication_core.hpp.

◆ RxMessage

friend class RxMessage
friend

Definition at line 165 of file communication_core.hpp.

Member Data Documentation

◆ baudrate_

uint32_t io_comm_rx::Comm_IO::baudrate_
private

Baudrate at the moment, unless InitializeSerial or ResetSerial fail.

Definition at line 162 of file communication_core.hpp.

◆ handlers_

CallbackHandlers io_comm_rx::Comm_IO::handlers_

Callback handlers for the inwards streaming messages.

Definition at line 152 of file communication_core.hpp.

◆ host_

std::string io_comm_rx::Comm_IO::host_
private

Host currently connected to.

Definition at line 168 of file communication_core.hpp.

◆ manager_

boost::shared_ptr<Manager> io_comm_rx::Comm_IO::manager_
private

Processes I/O stream data This declaration is deliberately stream-independent (Serial or TCP).

Definition at line 160 of file communication_core.hpp.

◆ port_

std::string io_comm_rx::Comm_IO::port_
private

Port over which TCP/IP connection is currently established.

Definition at line 170 of file communication_core.hpp.

◆ serial_port_

std::string io_comm_rx::Comm_IO::serial_port_
private

Saves the port description.

Definition at line 157 of file communication_core.hpp.

◆ SET_BAUDRATE_SLEEP_

const unsigned int io_comm_rx::Comm_IO::SET_BAUDRATE_SLEEP_ = 500000
staticprivate

Sleep time in microseconds (there is no Unix command for milliseconds) after setting the baudrate to certain value (important between increments)

Definition at line 173 of file communication_core.hpp.


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


rosaic
Author(s): Tibor Dome
autogenerated on Wed Oct 14 2020 03:43:50