USRP Hardware Driver and USRP Manual  Version: 3.15.0.HEAD-0-gaea0e2de
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>
13 #include <uhd/types/metadata.hpp>
14 #include <uhd/types/ref_vector.hpp>
15 #include <uhd/types/stream_cmd.hpp>
17 #include <boost/shared_ptr.hpp>
18 #include <boost/utility.hpp>
19 #include <string>
20 #include <vector>
21 
22 namespace uhd {
23 
60 {
62  stream_args_t(const std::string& cpu = "", const std::string& otw = "")
63  {
64  cpu_format = cpu;
65  otw_format = otw;
66  }
67 
84  std::string cpu_format;
85 
104  std::string otw_format;
105 
142 
162  std::vector<size_t> channels;
163 };
164 
171 {
172 public:
173  typedef boost::shared_ptr<rx_streamer> sptr;
174 
175  virtual ~rx_streamer(void);
176 
178  virtual size_t get_num_channels(void) const = 0;
179 
181  virtual size_t get_max_num_samps(void) const = 0;
182 
185 
223  virtual size_t recv(const buffs_type& buffs,
224  const size_t nsamps_per_buff,
225  rx_metadata_t& metadata,
226  const double timeout = 0.1,
227  const bool one_packet = false) = 0;
228 
240  virtual void issue_stream_cmd(const stream_cmd_t& stream_cmd) = 0;
241 };
242 
249 {
250 public:
251  typedef boost::shared_ptr<tx_streamer> sptr;
252 
253  virtual ~tx_streamer(void);
254 
256  virtual size_t get_num_channels(void) const = 0;
257 
259  virtual size_t get_max_num_samps(void) const = 0;
260 
263 
292  virtual size_t send(const buffs_type& buffs,
293  const size_t nsamps_per_buff,
294  const tx_metadata_t& metadata,
295  const double timeout = 0.1) = 0;
296 
303  virtual bool recv_async_msg(
304  async_metadata_t& async_metadata, double timeout = 0.1) = 0;
305 };
306 
307 } // namespace uhd
308 
309 #endif /* INCLUDED_UHD_STREAM_HPP */
Definition: stream_cmd.hpp:36
Definition: stream.hpp:170
boost::noncopyable noncopyable
Definition: noncopyable.hpp:46
Definition: stream.hpp:248
std::vector< size_t > channels
Definition: stream.hpp:162
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:173
std::string otw_format
Definition: stream.hpp:104
ref_vector< void * > buffs_type
Typedef for a pointer to a single, or a collection of recv buffers.
Definition: stream.hpp:184
Definition: metadata.hpp:23
Definition: metadata.hpp:135
Definition: build_info.hpp:13
std::string cpu_format
Definition: stream.hpp:84
Definition: ref_vector.hpp:21
stream_args_t(const std::string &cpu="", const std::string &otw="")
Convenience constructor for streamer args.
Definition: stream.hpp:62
device_addr_t args
Definition: stream.hpp:141
Definition: stream.hpp:59
#define UHD_API
Definition: config.h:68
Definition: metadata.hpp:163
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:251
ref_vector< const void * > buffs_type
Typedef for a pointer to a single, or a collection of send buffers.
Definition: stream.hpp:262
Definition: device_addr.hpp:38