USRP Hardware Driver and USRP Manual  Version: 3.11.0.HEAD-0-gdca39145
UHD and USRP Manual
stream.hpp
Go to the documentation of this file.
1 //
2 // Copyright 2011-2013 Ettus Research LLC
3 //
4 // SPDX-License-Identifier: GPL-3.0
5 //
6 
7 #ifndef INCLUDED_UHD_STREAM_HPP
8 #define INCLUDED_UHD_STREAM_HPP
9 
10 #include <uhd/config.hpp>
11 #include <uhd/types/metadata.hpp>
13 #include <uhd/types/stream_cmd.hpp>
14 #include <uhd/types/ref_vector.hpp>
15 #include <boost/utility.hpp>
16 #include <boost/shared_ptr.hpp>
17 #include <vector>
18 #include <string>
19 
20 namespace uhd{
21 
47 
50  const std::string &cpu = "",
51  const std::string &otw = ""
52  ){
53  cpu_format = cpu;
54  otw_format = otw;
55  }
56 
73  std::string cpu_format;
74 
93  std::string otw_format;
94 
130 
150  std::vector<size_t> channels;
151 };
152 
158 class UHD_API rx_streamer : boost::noncopyable{
159 public:
160  typedef boost::shared_ptr<rx_streamer> sptr;
161 
162  virtual ~rx_streamer(void);
163 
165  virtual size_t get_num_channels(void) const = 0;
166 
168  virtual size_t get_max_num_samps(void) const = 0;
169 
172 
207  virtual size_t recv(
208  const buffs_type &buffs,
209  const size_t nsamps_per_buff,
210  rx_metadata_t &metadata,
211  const double timeout = 0.1,
212  const bool one_packet = false
213  ) = 0;
214 
226  virtual void issue_stream_cmd(const stream_cmd_t &stream_cmd) = 0;
227 };
228 
234 class UHD_API tx_streamer : boost::noncopyable{
235 public:
236  typedef boost::shared_ptr<tx_streamer> sptr;
237 
238  virtual ~tx_streamer(void);
239 
241  virtual size_t get_num_channels(void) const = 0;
242 
244  virtual size_t get_max_num_samps(void) const = 0;
245 
248 
270  virtual size_t send(
271  const buffs_type &buffs,
272  const size_t nsamps_per_buff,
273  const tx_metadata_t &metadata,
274  const double timeout = 0.1
275  ) = 0;
276 
283  virtual bool recv_async_msg(
284  async_metadata_t &async_metadata, double timeout = 0.1
285  ) = 0;
286 };
287 
288 } //namespace uhd
289 
290 #endif /* INCLUDED_UHD_STREAM_HPP */
Definition: stream_cmd.hpp:35
Definition: stream.hpp:158
Definition: stream.hpp:234
std::vector< size_t > channels
Definition: stream.hpp:150
boost::shared_ptr< rx_streamer > sptr
Definition: stream.hpp:160
std::string otw_format
Definition: stream.hpp:93
Definition: metadata.hpp:22
Definition: metadata.hpp:131
Definition: build_info.hpp:14
std::string cpu_format
Definition: stream.hpp:73
Definition: ref_vector.hpp:20
ref_vector< void * > buffs_type
Typedef for a pointer to a single, or a collection of recv buffers.
Definition: stream.hpp:171
stream_args_t(const std::string &cpu="", const std::string &otw="")
Convenience constructor for streamer args.
Definition: stream.hpp:49
device_addr_t args
Definition: stream.hpp:129
ref_vector< const void * > buffs_type
Typedef for a pointer to a single, or a collection of send buffers.
Definition: stream.hpp:247
Definition: stream.hpp:46
#define UHD_API
Definition: config.h:62
Definition: metadata.hpp:158
boost::shared_ptr< tx_streamer > sptr
Definition: stream.hpp:236
Definition: device_addr.hpp:36