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");
139 void setManager(
const boost::shared_ptr<Manager>& manager);
149 void send(std::string cmd);
177 #endif // for COMMUNICATION_CORE_HPP std::string serial_port_
Saves the port description.
virtual ~Comm_IO()=default
Default destructor of the class Comm_IO.
bool initializeTCP(std::string host, std::string port)
Initializes the TCP I/O.
CallbackHandlers getHandlers() const
Implements asynchronous operations for an I/O manager.
boost::shared_ptr< Manager > manager_
bool initializeSerial(std::string port, uint32_t baudrate=115200, std::string flowcontrol="None")
Initializes the serial port.
void send(std::string cmd)
Can search buffer for messages, read/parse them, and so on.
Represents ensemble of (to be constructed) ROS messages, to be handled at once by this class...
Handles communication with and configuration of the mosaic (and beyond) receiver(s) ...
std::string host_
Host currently connected to.
static const unsigned int SET_BAUDRATE_SLEEP_
void setManager(const boost::shared_ptr< Manager > &manager)
Set the I/O manager.
static const uint32_t BAUDRATES[]
Possible baudrates for the Rx.
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.
CallbackHandlers handlers_
Callback handlers for the inwards streaming messages.
Handles callbacks when reading NMEA/SBF messages.
Comm_IO()
Default constructor of the class Comm_IO.
uint32_t baudrate_
Baudrate at the moment, unless InitializeSerial or ResetSerial fail.