USRP Hardware Driver and USRP Manual Version: 4.1.0.1
UHD and USRP Manual
udp_simple.hpp
Go to the documentation of this file.
1//
2// Copyright 2010,2014 Ettus Research LLC
3// Copyright 2018 Ettus Research, a National Instruments Company
4//
5// SPDX-License-Identifier: GPL-3.0-or-later
6//
7
8#pragma once
9
10#include <uhd/config.hpp>
11#include <uhd/types/serial.hpp>
13#include <boost/asio/buffer.hpp>
14#include <memory>
15
16namespace uhd { namespace transport {
17
19{
20public:
21 typedef std::shared_ptr<udp_simple> sptr;
22
23 virtual ~udp_simple(void) = 0;
24
26 static const size_t mtu = 1500 - 20 - 8; // default ipv4 mtu - ipv4 header - udp
27 // header
28
42 static sptr make_connected(const std::string& addr, const std::string& port);
43
56 static sptr make_broadcast(const std::string& addr, const std::string& port);
57
64
71 virtual size_t send(const boost::asio::const_buffer& buff) = 0;
72
80 virtual size_t recv(
81 const boost::asio::mutable_buffer& buff, double timeout = 0.1) = 0;
82
87 virtual std::string get_recv_addr(void) = 0;
88
92 virtual std::string get_send_addr(void) = 0;
93};
94
95}} // namespace uhd::transport
Definition: udp_simple.hpp:19
std::shared_ptr< udp_simple > sptr
Definition: udp_simple.hpp:21
static sptr make_broadcast(const std::string &addr, const std::string &port)
static uart_iface::sptr make_uart(sptr udp)
static sptr make_connected(const std::string &addr, const std::string &port)
virtual ~udp_simple(void)=0
virtual size_t recv(const boost::asio::mutable_buffer &buff, double timeout=0.1)=0
virtual std::string get_send_addr(void)=0
virtual size_t send(const boost::asio::const_buffer &buff)=0
virtual std::string get_recv_addr(void)=0
std::shared_ptr< uart_iface > sptr
Definition: serial.hpp:164
#define UHD_API
Definition: config.h:70
Definition: build_info.hpp:12
boost::noncopyable noncopyable
Definition: noncopyable.hpp:45