60 #ifndef COMMUNICATION_CORE_HPP // This block is called a conditional group. The controlled text will get included 62 #define COMMUNICATION_CORE_HPP // Include guards help to avoid the double inclusion of header files, by defining a token = macro. 65 #include <boost/function.hpp> 66 #include <boost/date_time/posix_time/posix_time.hpp> 67 #include <boost/asio.hpp> 68 #include <boost/exception/diagnostic_information.hpp> 69 #include <boost/bind.hpp> 70 #include <boost/asio/serial_port.hpp> 93 const static uint32_t
BAUDRATES[] = {1200, 2400, 4800, 9600, 19200, 38400, 57600,
94 115200, 230400, 460800, 500000, 576000, 921600,
95 1000000, 1152000, 1500000, 2000000, 2500000,
96 3000000, 3500000, 4000000};
124 bool initializeSerial(std::string port, uint32_t baudrate = 115200, std::string flowcontrol =
"None");
149 void send(std::string cmd);
177 #endif // for COMMUNICATION_CORE_HPP boost::shared_ptr< Manager > manager_
uint32_t baudrate_
Baudrate at the moment, unless InitializeSerial or ResetSerial fail.
Represents ensemble of (to be constructed) ROS messages, to be handled at once by this class...
static const unsigned int SET_BAUDRATE_SLEEP_
bool initializeSerial(std::string port, uint32_t baudrate=115200, std::string flowcontrol="None")
Initializes the serial port.
virtual ~Comm_IO()=default
Default destructor of the class Comm_IO.
Implements asynchronous operations for an I/O manager.
std::string serial_port_
Saves the port description.
std::string port_
Port over which TCP/IP connection is currently established.
void resetSerial(std::string port)
Reset the Serial I/O port, e.g. after a Rx reset.
bool initializeTCP(std::string host, std::string port)
Initializes the TCP I/O.
Comm_IO()
Default constructor of the class Comm_IO.
CallbackHandlers getHandlers() const
static const uint32_t BAUDRATES[]
Possible baudrates for the Rx.
void setManager(const boost::shared_ptr< Manager > &manager)
Set the I/O manager.
CallbackHandlers handlers_
Callback handlers for the inwards streaming messages.
void send(std::string cmd)
Handles callbacks when reading NMEA/SBF messages.
Can search buffer for messages, read/parse them, and so on.
Handles communication with and configuration of the mosaic (and beyond) receiver(s) ...
std::string host_
Host currently connected to.