USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
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 
16 namespace uhd { namespace transport {
17 
19 {
20 public:
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 
63  static uart_iface::sptr make_uart(sptr udp);
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
config.hpp
UHD_API
#define UHD_API
Definition: config.h:87
noncopyable.hpp
uhd::uart_iface::sptr
std::shared_ptr< uart_iface > sptr
Definition: serial.hpp:171
uhd::transport::udp_simple::sptr
std::shared_ptr< udp_simple > sptr
Definition: udp_simple.hpp:21
uhd
Definition: build_info.hpp:12
serial.hpp
uhd::noncopyable
boost::noncopyable noncopyable
Definition: noncopyable.hpp:45
uhd::transport::udp_simple
Definition: udp_simple.hpp:18