40 using boost::asio::ip::udp;
45 UDPBoard::UDPBoard(std::string bind_host, uint16_t bind_port, std::string remote_host, uint16_t remote_port) :
46 bind_host_(bind_host),
47 bind_port_(bind_port),
48 remote_host_(remote_host),
49 remote_port_(remote_port),
52 write_in_progress_(false)
68 void UDPBoard::set_ports(std::string bind_host, uint16_t bind_port, std::string remote_host, uint16_t remote_port)
92 socket_.set_option(udp::socket::reuse_address(
true));
138 if (!
socket_.is_open())
return;
146 boost::asio::placeholders::bytes_transferred));
175 boost::asio::placeholders::bytes_transferred));
191 buffer->
pos += bytes_transferred;
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_
#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
const uint8_t * dpos() const
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]