Loading [MathJax]/extensions/tex2jax.js
USRP Hardware Driver and USRP Manual  Version: 4.8.0.0
UHD and USRP Manual
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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 <cstddef>
15 #include <memory>
16 #include <string>
17 
18 namespace uhd { namespace transport {
19 
21 {
22 public:
23  typedef std::shared_ptr<udp_simple> sptr;
24 
25  virtual ~udp_simple(void) = 0;
26 
28  static const size_t mtu = 1500 - 20 - 8; // default ipv4 mtu - ipv4 header - udp
29  // header
30 
44  static sptr make_connected(const std::string& addr, const std::string& port);
45 
58  static sptr make_broadcast(const std::string& addr, const std::string& port);
59 
65  static uart_iface::sptr make_uart(sptr udp);
66 
73  virtual size_t send(const boost::asio::const_buffer& buff) = 0;
74 
82  virtual size_t recv(
83  const boost::asio::mutable_buffer& buff, double timeout = 0.1) = 0;
84 
89  virtual std::string get_recv_addr(void) = 0;
90 
94  virtual std::string get_send_addr(void) = 0;
95 };
96 
97 }} // 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:172
uhd::transport::udp_simple::sptr
std::shared_ptr< udp_simple > sptr
Definition: udp_simple.hpp:23
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:20