USRP Hardware Driver and USRP Manual  Version: 3.13.0.HEAD-0-g0ddc19e5
UHD and USRP Manual
stream.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2011-2013 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_STREAM_HPP
9 #define INCLUDED_UHD_STREAM_HPP
10 
11 #include <uhd/config.hpp>
12 #include <uhd/types/metadata.hpp>
14 #include <uhd/types/stream_cmd.hpp>
15 #include <uhd/types/ref_vector.hpp>
16 #include <boost/utility.hpp>
17 #include <boost/shared_ptr.hpp>
18 #include <vector>
19 #include <string>
20 
21 namespace uhd{
22 
59 
62  const std::string &cpu = "",
63  const std::string &otw = ""
64  ){
65  cpu_format = cpu;
66  otw_format = otw;
67  }
68 
85  std::string cpu_format;
86 
105  std::string otw_format;
106 
142 
162  std::vector<size_t> channels;
163 };
164 
170 class UHD_API rx_streamer : boost::noncopyable{
171 public:
172  typedef boost::shared_ptr<rx_streamer> sptr;
173 
174  virtual ~rx_streamer(void);
175 
177  virtual size_t get_num_channels(void) const = 0;
178 
180  virtual size_t get_max_num_samps(void) const = 0;
181 
184 
219  virtual size_t recv(
220  const buffs_type &buffs,
221  const size_t nsamps_per_buff,
222  rx_metadata_t &metadata,
223  const double timeout = 0.1,
224  const bool one_packet = false
225  ) = 0;
226 
238  virtual void issue_stream_cmd(const stream_cmd_t &stream_cmd) = 0;
239 };
240 
246 class UHD_API tx_streamer : boost::noncopyable{
247 public:
248  typedef boost::shared_ptr<tx_streamer> sptr;
249 
250  virtual ~tx_streamer(void);
251 
253  virtual size_t get_num_channels(void) const = 0;
254 
256  virtual size_t get_max_num_samps(void) const = 0;
257 
260 
282  virtual size_t send(
283  const buffs_type &buffs,
284  const size_t nsamps_per_buff,
285  const tx_metadata_t &metadata,
286  const double timeout = 0.1
287  ) = 0;
288 
295  virtual bool recv_async_msg(
296  async_metadata_t &async_metadata, double timeout = 0.1
297  ) = 0;
298 };
299 
300 } //namespace uhd
301 
302 #endif /* INCLUDED_UHD_STREAM_HPP */
Definition: stream_cmd.hpp:36
Definition: stream.hpp:170
Definition: stream.hpp:246
std::vector< size_t > channels
Definition: stream.hpp:162
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:172
std::string otw_format
Definition: stream.hpp:105
Definition: metadata.hpp:23
Definition: metadata.hpp:132
Definition: build_info.hpp:14
std::string cpu_format
Definition: stream.hpp:85
Definition: ref_vector.hpp:21
ref_vector< void * > buffs_type
Typedef for a pointer to a single, or a collection of recv buffers.
Definition: stream.hpp:183
stream_args_t(const std::string &cpu="", const std::string &otw="")
Convenience constructor for streamer args.
Definition: stream.hpp:61
device_addr_t args
Definition: stream.hpp:141
ref_vector< const void * > buffs_type
Typedef for a pointer to a single, or a collection of send buffers.
Definition: stream.hpp:259
Definition: stream.hpp:58
#define UHD_API
Definition: config.h:63
Definition: metadata.hpp:159
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:248
Definition: device_addr.hpp:38