MIRA
|
The communication module provides wrappers and additional functionality to the boost::asio library.
For asynchronous I/O operations, boost asio provides the io_service class. Therefore, the run() or one of the run_one(), poll() or poll_one() functions must be called. The run() function will block the calling thread until all async I/O operations are finished. More than one thread can call the run() method to join the list of worker threads used to process the io operations. For that purpose, the IOService class provides functionality to start and stop multiple threads on an io_service class. The object can be casted to an io_service object for compatibility reasons to the boost::asio functions.
The mira::SerialPort class enables the use of non-standard baud rates such as 345600.
For reading data from a serial port, the mira::Buffer class can be used as a data container. The communication module also provides a function for reading data from serial port using a timeout. This boost::asio::read_some() method is located in the boost::asio namespace for compatibility.