GNU Radio Manual and C++ API Reference  3.10.9.1
The Free & Open Software Radio Ecosystem
gr-soapy/include/gnuradio/soapy/source.h
Go to the documentation of this file.
1 /* -*- c++ -*- */
2 /*
3  * Copyright 2021 Jeff Long
4  * Copyright 2018-2021 Libre Space Foundation <http://libre.space/>
5  *
6  * SPDX-License-Identifier: GPL-3.0-or-later
7  */
8 
9 #ifndef INCLUDED_GR_SOAPY_SOURCE_H
10 #define INCLUDED_GR_SOAPY_SOURCE_H
11 
12 #include <gnuradio/soapy/api.h>
13 #include <gnuradio/soapy/block.h>
14 #include <gnuradio/sync_block.h>
15 #include <cstdint>
16 #include <string>
17 #include <vector>
18 
19 namespace gr {
20 namespace soapy {
21 
22 /*!
23  * \addtogroup block
24  * \brief <b>Source</b> block implements SoapySDR functionality for RX.
25  * \ingroup soapy
26  * \section source Soapy Source
27  * The soapy source block receives samples and writes to a stream.
28  * The source block also provides Soapy API calls for receiver settings.
29  * Includes all parameters for full RX implementation.
30  * Device is a string containing the driver and type name of the
31  * device the user wants to use according to the Soapy* module
32  * documentation.
33  * Make parameters are passed through the xml block.
34  * Some of the available parameters can be seen at Figure 2
35  * Antenna and clock source can be left empty and default values
36  * will be used.
37  * This block has a message port, which consumes PMT messages.
38  * For a description of the command syntax, see \ref cmd_handler_t.
39  */
40 class SOAPY_API source : virtual public block
41 {
42 public:
43  using sptr = std::shared_ptr<source>;
44 
45  /*!
46  * \brief Return a shared_ptr to a new instance of soapy::source.
47  *
48  * To avoid accidental use of raw pointers, soapy::source's
49  * constructor is in a private implementation
50  * class. soapy::source::make is the public interface for
51  * creating new instances.
52  * \param device the device driver and type
53  * \param type output stream format
54  * \param nchan number of channels
55  * \param dev_args device specific arguments
56  * \param stream_args stream arguments. Same for all enabled channels
57  * \param tune_args list with tuning specific arguments, one entry for every
58  * enabled channel, or a single entry to apply to all
59  * \param other_settings list with general settings, one entry for every
60  * enabled channel, or a single entry to apply to all. Supports also specific
61  * gain settings.
62  *
63  * Driver name can be any of "uhd", "lime", "airspy",
64  * "rtlsdr" or others
65  */
66  static sptr make(const std::string& device,
67  const std::string& type,
68  size_t nchan,
69  const std::string& dev_args = "",
70  const std::string& stream_args = "",
71  const std::vector<std::string>& tune_args = { "" },
72  const std::vector<std::string>& other_settings = { "" });
73 };
74 
75 } // namespace soapy
76 } // namespace gr
77 
78 #endif /* INCLUDED_GR_SOAPY_SOURCE_H */
Definition: gr-soapy/include/gnuradio/soapy/block.h:23
Definition: gr-soapy/include/gnuradio/soapy/source.h:41
std::shared_ptr< source > sptr
Definition: gr-soapy/include/gnuradio/soapy/source.h:43
static sptr make(const std::string &device, const std::string &type, size_t nchan, const std::string &dev_args="", const std::string &stream_args="", const std::vector< std::string > &tune_args={ "" }, const std::vector< std::string > &other_settings={ "" })
Return a shared_ptr to a new instance of soapy::source.
#define SOAPY_API
Definition: gr-soapy/include/gnuradio/soapy/api.h:19
GNU Radio logging wrapper.
Definition: basic_block.h:29