gr-baz Package
baz_usrp_acquire.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2014 Balint Seeber <balint256@gmail.com>.
4  *
5  * This is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3, or (at your option)
8  * any later version.
9  *
10  * This software is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this software; see the file COPYING. If not, write to
17  * the Free Software Foundation, Inc., 51 Franklin Street,
18  * Boston, MA 02110-1301, USA.
19  */
20 
21 
22 #ifndef INCLUDED_BAZ_USRP_ACQUIRE_H
23 #define INCLUDED_BAZ_USRP_ACQUIRE_H
24 
25 #include <boost/thread/mutex.hpp>
26 #include <vector>
27 
28 #include <uhd/usrp/multi_usrp.hpp>
29 #include <uhd/types/time_spec.hpp>
30 
31 #include <gnuradio/uhd/usrp_source.h>
32 
33 namespace gr {
34  namespace baz {
35 
36  /*!
37  * \brief <+description+>
38  *
39  */
41  {
42  public:
43  usrp_acquire(::uhd::usrp::multi_usrp::sptr dev, const ::uhd::stream_args_t &stream_args);
44  ~usrp_acquire();
45  public:
46  typedef boost::shared_ptr<usrp_acquire> sptr;
47  static sptr make(::uhd::usrp::multi_usrp::sptr dev, const ::uhd::stream_args_t &stream_args);
48  static sptr make_from_source(/*::gr::uhd::usrp_source::sptr*/::gr::basic_block_sptr source, const ::uhd::stream_args_t &stream_args);
49  public:
50  std::vector<size_t> finite_acquisition_v(const size_t nsamps, bool stream_now = true, double delay = 0.0, size_t skip = 0, double timeout = 1.0, bool loop = false);
51  void set_gpio_attr(const std::string &bank, const std::string &attr, const boost::uint32_t value, const boost::uint32_t mask, const size_t mboard = 0);
52  void reset(void);
53  size_t flush(void);
54  private:
55  ::uhd::usrp::multi_usrp::sptr m_dev;
56  ::uhd::stream_args_t m_stream_args;
57  ::boost::mutex d_mutex;
58  ::uhd::rx_streamer::sptr m_rx_stream;
59  size_t m_samps_per_packet;
60  size_t m_buff_size;
61  size_t m_item_size;
62  std::vector<unsigned char* > m_data;
63  };
64 
65  } // namespace baz
66 } // namespace gr
67 
68 #endif /* INCLUDED_BAZ_USRP_ACQUIRE_H */
Definition: baz_additive_scrambler_bb.h:28
<+description+>
Definition: baz_usrp_acquire.h:40
boost::shared_ptr< usrp_acquire > sptr
Definition: baz_usrp_acquire.h:46
#define BAZ_API
Definition: config.h:8