24#ifndef GOBY_MIDDLEWARE_IO_MAVLINK_SERIAL_H
25#define GOBY_MIDDLEWARE_IO_MAVLINK_SERIAL_H
29#include <boost/asio/buffer.hpp>
30#include <boost/asio/completion_condition.hpp>
31#include <boost/asio/read.hpp>
32#include <boost/system/error_code.hpp>
63template <
const goby::middleware::Group& line_in_group,
64 const goby::middleware::Group& line_out_group,
PubSubLayer publish_layer,
65 PubSubLayer subscribe_layer,
template <
class>
class ThreadType>
67 line_in_group, line_out_group, publish_layer, subscribe_layer,
104 subscribe_layer, ThreadType>::async_read()
106 boost::asio::async_read(
107 this->mutable_serial_port(), boost::asio::buffer(this->buffer()),
108 boost::asio::transfer_at_least(1),
109 [
this](
const boost::system::error_code& ec, std::size_t bytes_transferred)
111 if (!ec && bytes_transferred > 0)
113 this->try_parse(bytes_transferred);
118 this->handle_read_error(ec);
Class for grouping publications in the Goby middleware. Analogous to "topics" in ROS,...
Reads/Writes MAVLink message packages from/to serial port.
SerialThreadMAVLink(const goby::middleware::protobuf::SerialConfig &config)
virtual void async_read()=0
IOThreadMAVLink< line_in_group, line_out_group, publish_layer, subscribe_layer, detail::SerialThread< line_in_group, line_out_group, publish_layer, subscribe_layer, ThreadType >, goby::middleware::protobuf::SerialConfig > SerialThreadMAVLinkBase
Objects implementing the Goby nested middleware.
middleware::SimpleThread< Config, detail::InterProcessTag > SimpleThread
Zeromq-backed SimpleThread. Derives from middleware::SimpleThread using InterProcessTag.
The global namespace for the Goby project.