Loading...
Searching...
No Matches
udp_simple.hpp
Go to the documentation of this file.
//
// Copyright 2010,2014 Ettus Research LLC
// Copyright 2018 Ettus Research, a National Instruments Company
//
// SPDX-License-Identifier: GPL-3.0-or-later
//
#pragma once
#include <uhd/config.hpp>
#include <uhd/types/serial.hpp>
#include <uhd/utils/noncopyable.hpp>
#include <boost/asio/buffer.hpp>
#include <cstddef>
#include <memory>
#include <string>
namespace uhd { namespace transport {
class UHD_API udp_simple : uhd::noncopyable
{
public:
typedef std::shared_ptr<udp_simple> sptr;
virtual ~udp_simple(void) = 0;
static const size_t mtu = 1500 - 20 - 8; // default ipv4 mtu - ipv4 header - udp
// header
static sptr make_connected(const std::string& addr, const std::string& port);
static sptr make_broadcast(const std::string& addr, const std::string& port);
static uart_iface::sptr make_uart(sptr udp);
virtual size_t send(const boost::asio::const_buffer& buff) = 0;
virtual size_t recv(
const boost::asio::mutable_buffer& buff, double timeout = 0.1) = 0;
virtual std::string get_recv_addr(void) = 0;
virtual std::string get_send_addr(void) = 0;
};
}} // namespace uhd::transport
uhd::transport::udp_simple
Definition udp_simple.hpp:21
uhd::transport::udp_simple::sptr
std::shared_ptr< udp_simple > sptr
Definition udp_simple.hpp:23
uhd::transport::udp_simple::make_broadcast
static sptr make_broadcast(const std::string &addr, const std::string &port)
uhd::transport::udp_simple::make_uart
static uart_iface::sptr make_uart(sptr udp)
uhd::transport::udp_simple::make_connected
static sptr make_connected(const std::string &addr, const std::string &port)
uhd::transport::udp_simple::~udp_simple
virtual ~udp_simple(void)=0
uhd::transport::udp_simple::recv
virtual size_t recv(const boost::asio::mutable_buffer &buff, double timeout=0.1)=0
uhd::transport::udp_simple::get_send_addr
virtual std::string get_send_addr(void)=0
uhd::transport::udp_simple::send
virtual size_t send(const boost::asio::const_buffer &buff)=0
uhd::transport::udp_simple::mtu
static const size_t mtu
The maximum number of bytes per udp packet.
Definition udp_simple.hpp:28
uhd::transport::udp_simple::get_recv_addr
virtual std::string get_recv_addr(void)=0
uhd::uart_iface::sptr
std::shared_ptr< uart_iface > sptr
Definition serial.hpp:172
UHD_API
#define UHD_API
Definition config.h:87
config.hpp
uhd::transport
Definition adapter_id.hpp:11
uhd
Definition build_info.hpp:12
uhd::noncopyable
boost::noncopyable noncopyable
Definition noncopyable.hpp:45
noncopyable.hpp
serial.hpp