USRP Hardware Driver and USRP Manual  Version: 4.2.0.0-143-g2ad30980f
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 #pragma once
9 
10 #include <uhd/config.hpp>
12 #include <uhd/types/metadata.hpp>
13 #include <uhd/types/ref_vector.hpp>
14 #include <uhd/types/stream_cmd.hpp>
16 #include <boost/utility.hpp>
17 #include <memory>
18 #include <string>
19 #include <vector>
20 
21 namespace uhd {
22 
48 {
50  stream_args_t(const std::string& cpu = "", const std::string& otw = "")
51  {
52  cpu_format = cpu;
53  otw_format = otw;
54  }
55 
72  std::string cpu_format;
73 
92  std::string otw_format;
93 
130 
158  std::vector<size_t> channels;
159 };
160 
167 {
168 public:
169  typedef std::shared_ptr<rx_streamer> sptr;
170 
171  virtual ~rx_streamer(void);
172 
174  virtual size_t get_num_channels(void) const = 0;
175 
177  virtual size_t get_max_num_samps(void) const = 0;
178 
181 
239  virtual size_t recv(const buffs_type& buffs,
240  const size_t nsamps_per_buff,
241  rx_metadata_t& metadata,
242  const double timeout = 0.1,
243  const bool one_packet = false) = 0;
244 
256  virtual void issue_stream_cmd(const stream_cmd_t& stream_cmd) = 0;
257 };
258 
265 {
266 public:
267  typedef std::shared_ptr<tx_streamer> sptr;
268 
269  virtual ~tx_streamer(void);
270 
272  virtual size_t get_num_channels(void) const = 0;
273 
275  virtual size_t get_max_num_samps(void) const = 0;
276 
279 
308  virtual size_t send(const buffs_type& buffs,
309  const size_t nsamps_per_buff,
310  const tx_metadata_t& metadata,
311  const double timeout = 0.1) = 0;
312 
319  virtual bool recv_async_msg(
320  async_metadata_t& async_metadata, double timeout = 0.1) = 0;
321 };
322 
323 } // namespace uhd
std::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:169
Definition: stream_cmd.hpp:39
Definition: stream.hpp:166
boost::noncopyable noncopyable
Definition: noncopyable.hpp:45
Definition: stream.hpp:264
std::vector< size_t > channels
Definition: stream.hpp:158
std::string otw_format
Definition: stream.hpp:92
ref_vector< void * > buffs_type
Typedef for a pointer to a single, or a collection of recv buffers.
Definition: stream.hpp:180
Definition: metadata.hpp:22
Definition: metadata.hpp:162
Definition: build_info.hpp:12
std::string cpu_format
Definition: stream.hpp:72
Definition: ref_vector.hpp:21
stream_args_t(const std::string &cpu="", const std::string &otw="")
Convenience constructor for streamer args.
Definition: stream.hpp:50
device_addr_t args
Definition: stream.hpp:129
Definition: stream.hpp:47
#define UHD_API
Definition: config.h:87
Definition: metadata.hpp:202
std::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:267
ref_vector< const void * > buffs_type
Typedef for a pointer to a single, or a collection of send buffers.
Definition: stream.hpp:278
Definition: device_addr.hpp:37