USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-g6563c537
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 #ifndef INCLUDED_UHD_TRANSPORT_UDP_SIMPLE_HPP
9 #define INCLUDED_UHD_TRANSPORT_UDP_SIMPLE_HPP
10 
11 #include <uhd/config.hpp>
12 #include <uhd/types/serial.hpp>
14 #include <boost/asio/buffer.hpp>
15 #include <boost/shared_ptr.hpp>
16 
17 namespace uhd { namespace transport {
18 
20 {
21 public:
22  typedef boost::shared_ptr<udp_simple> sptr;
23 
24  virtual ~udp_simple(void) = 0;
25 
27  static const size_t mtu = 1500 - 20 - 8; // default ipv4 mtu - ipv4 header - udp
28  // header
29 
43  static sptr make_connected(const std::string& addr, const std::string& port);
44 
57  static sptr make_broadcast(const std::string& addr, const std::string& port);
58 
64  static uart_iface::sptr make_uart(sptr udp);
65 
72  virtual size_t send(const boost::asio::const_buffer& buff) = 0;
73 
81  virtual size_t recv(
82  const boost::asio::mutable_buffer& buff, double timeout = 0.1) = 0;
83 
88  virtual std::string get_recv_addr(void) = 0;
89 
93  virtual std::string get_send_addr(void) = 0;
94 };
95 
96 }} // namespace uhd::transport
97 
98 #endif /* INCLUDED_UHD_TRANSPORT_UDP_SIMPLE_HPP */
Definition: udp_simple.hpp:19
boost::noncopyable noncopyable
Definition: noncopyable.hpp:46
Definition: build_info.hpp:13
#define UHD_API
Definition: config.h:68
boost::shared_ptr< uart_iface > sptr
Definition: serial.hpp:164
boost::shared_ptr< udp_simple > sptr
Definition: udp_simple.hpp:22