40 using boost::asio::ip::udp;
44 UDPBoard::UDPBoard(std::string bind_host, uint16_t bind_port, std::string remote_host, uint16_t remote_port) :
45 bind_host_(bind_host),
46 bind_port_(bind_port),
47 remote_host_(remote_host),
48 remote_port_(remote_port),
51 write_in_progress_(false)
67 void UDPBoard::set_ports(std::string bind_host, uint16_t bind_port, std::string remote_host, uint16_t remote_port)
91 socket_.set_option(udp::socket::reuse_address(
true));
145 boost::asio::placeholders::bytes_transferred));
171 boost::asio::placeholders::bytes_transferred));
187 buffer->
pos += bytes_transferred;
void serial_flush() override
boost::asio::ip::udp::socket socket_
std::list< Buffer * > write_queue_
static volatile bool error
void serial_init(uint32_t baud_rate, uint32_t dev) override
void serial_write(const uint8_t *src, size_t len) override
static uint8_t buffer[BMP280_DATA_FRAME_SIZE]
UDPBoard(std::string bind_host="localhost", uint16_t bind_port=14525, std::string remote_host="localhost", uint16_t remote_port=14520)
boost::asio::ip::udp::endpoint bind_endpoint_
const uint8_t * dpos() const
#define MAVLINK_MAX_PACKET_LEN
Maximum packet length.
boost::asio::ip::udp::endpoint remote_endpoint_
void async_write(bool check_write_state)
void async_read_end(const boost::system::error_code &error, size_t bytes_transferred)
boost::lock_guard< boost::recursive_mutex > MutexLock
boost::recursive_mutex write_mutex_
uint16_t serial_bytes_available(void) override
void set_ports(std::string bind_host, uint16_t bind_port, std::string remote_host, uint16_t remote_port)
uint8_t serial_read(void) override
boost::recursive_mutex read_mutex_
boost::asio::io_service io_service_
std::list< Buffer * > read_queue_
void async_write_end(const boost::system::error_code &error, size_t bytes_transferred)
uint8_t read_buffer_[MAVLINK_MAX_PACKET_LEN]