USRP Hardware Driver and USRP Manual: udp_simple.hpp Source File

| USRP Hardware Driver and USRP Manual Version: 4.8.0.makepkg-0-g308126a4 UHD and USRP Manual |

Loading...
Searching...
No Matches
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>
12#include <uhd/utils/noncopyable.hpp>
13#include <boost/asio/buffer.hpp>
14#include <cstddef>
15#include <memory>
16#include <string>
17
18namespace uhd { namespace transport {
19
20 class UHD_API udp_simple : uhd::noncopyable
21{
22public:
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
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