USRP Hardware Driver and USRP Manual  Version: 4.4.0.HEAD-0-g5fac246b
UHD and USRP Manual
device.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2010-2011,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/property_tree.hpp>
12 #include <uhd/stream.hpp>
15 #include <functional>
16 #include <memory>
17 
18 namespace uhd {
19 
20 class property_tree; // forward declaration
21 
27 {
28 public:
29  typedef std::shared_ptr<device> sptr;
30  typedef std::function<device_addrs_t(const device_addr_t&)> find_t;
31  typedef std::function<sptr(const device_addr_t&)> make_t;
32 
34  enum device_filter_t { ANY, USRP, CLOCK };
35  virtual ~device(void) = 0;
36 
44  static void register_device(
45  const find_t& find, const make_t& make, const device_filter_t filter);
46 
57  static device_addrs_t find(const device_addr_t& hint, device_filter_t filter = ANY);
58 
73  static sptr make(
74  const device_addr_t& hint, device_filter_t filter = ANY, size_t which = 0);
75 
81  virtual rx_streamer::sptr get_rx_stream(const stream_args_t& args) = 0;
82 
88  virtual tx_streamer::sptr get_tx_stream(const stream_args_t& args) = 0;
89 
100  virtual bool recv_async_msg(
101  async_metadata_t& async_metadata, double timeout = 0.1) = 0;
102 
104  uhd::property_tree::sptr get_tree(void) const;
105 
107  device_filter_t get_device_type() const;
108 
109 protected:
112 };
113 
114 } // namespace uhd
device_addr.hpp
config.hpp
uhd::device_addrs_t
std::vector< device_addr_t > device_addrs_t
A typedef for a vector of device addresses.
Definition: device_addr.hpp:93
property_tree.hpp
uhd::rx_streamer::sptr
std::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:169
uhd::tx_streamer::sptr
std::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:267
uhd::device::_tree
uhd::property_tree::sptr _tree
Definition: device.hpp:110
UHD_API
#define UHD_API
Definition: config.h:87
uhd::property_tree::sptr
std::shared_ptr< property_tree > sptr
Definition: property_tree.hpp:222
noncopyable.hpp
uhd::device_addr_t
Definition: device_addr.hpp:37
uhd::device::find_t
std::function< device_addrs_t(const device_addr_t &)> find_t
Definition: device.hpp:30
uhd::async_metadata_t
Definition: metadata.hpp:202
uhd::device::USRP
@ USRP
Definition: device.hpp:34
uhd::device::make_t
std::function< sptr(const device_addr_t &)> make_t
Definition: device.hpp:31
uhd
Definition: build_info.hpp:12
uhd::stream_args_t
Definition: stream.hpp:47
uhd::device::sptr
std::shared_ptr< device > sptr
Definition: device.hpp:29
stream.hpp
uhd::noncopyable
boost::noncopyable noncopyable
Definition: noncopyable.hpp:45
uhd::device::_type
device_filter_t _type
Definition: device.hpp:111
uhd::device::device_filter_t
device_filter_t
Device type, used as a filter in make.
Definition: device.hpp:34
uhd::device
Definition: device.hpp:26