GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
plutosdr_signal_source.h
Go to the documentation of this file.
1 /*!
2  * \file plutosdr_signal_source.h
3  * \brief Signal source for PlutoSDR
4  * \author Rodrigo Muñoz, 2017, rmunozl(at)inacap.cl, rodrigo.munoz(at)proteinlab.cl
5  *
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
10  *
11  * GNSS-SDR is a software defined Global Navigation
12  * Satellite Systems receiver
13  *
14  * This file is part of GNSS-SDR.
15  *
16  * SPDX-License-Identifier: GPL-3.0-or-later
17  *
18  * -----------------------------------------------------------------------------
19  */
20 
21 
22 #ifndef GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
23 #define GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
24 
25 #include "gnss_block_interface.h"
26 #include <gnuradio/blocks/file_sink.h>
27 #if GRIIO_INCLUDE_HAS_GNURADIO
28 #include <gnuradio/iio/pluto_source.h>
29 #else
30 #include <iio/pluto_source.h>
31 #endif
32 #include "concurrent_queue.h"
33 #include <pmt/pmt.h>
34 #include <cstdint>
35 #include <memory>
36 #include <string>
37 #if GNURADIO_USES_STD_POINTERS
38 #else
39 #include <boost/shared_ptr.hpp>
40 #endif
41 
42 
44 
45 /*!
46  */
48 {
49 public:
50  PlutosdrSignalSource(const ConfigurationInterface* configuration,
51  const std::string& role, unsigned int in_stream,
52  unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
53 
54  ~PlutosdrSignalSource() = default;
55 
56  std::string role() override
57  {
58  return role_;
59  }
60 
61  /*!
62  * \brief Returns "Plutosdr_Signal_Source"
63  */
64  std::string implementation() override
65  {
66  return "Plutosdr_Signal_Source";
67  }
68  size_t item_size() override
69  {
70  return item_size_;
71  }
72 
73  void connect(gr::top_block_sptr top_block) override;
74  void disconnect(gr::top_block_sptr top_block) override;
75  gr::basic_block_sptr get_left_block() override;
76  gr::basic_block_sptr get_right_block() override;
77 
78 private:
79  gr::iio::pluto_source::sptr plutosdr_source_;
80 
81 #if GNURADIO_USES_STD_POINTERS
82  std::shared_ptr<gr::block> valve_;
83 #else
84  boost::shared_ptr<gr::block> valve_;
85 #endif
86  gr::blocks::file_sink::sptr file_sink_;
87 
88  std::string role_;
89  std::string dump_filename_;
90 
91  // Front-end settings
92  std::string uri_; // device direction
93  std::string gain_mode_;
94  std::string filter_file_;
95  std::string filter_source_;
96  std::string filter_filename_;
97  std::string item_type_;
98  double rf_gain_;
99  int64_t samples_;
100  uint64_t freq_; // frequency of local oscilator
101  uint64_t sample_rate_;
102  uint64_t bandwidth_;
103  uint64_t buffer_size_; // reception buffer
104  size_t item_size_;
105  float Fpass_;
106  float Fstop_;
107  unsigned int in_stream_;
108  unsigned int out_stream_;
109 
110  bool quadrature_;
111  bool rf_dc_;
112  bool bb_dc_;
113  bool filter_auto_;
114  bool dump_;
115 };
116 
117 #endif // GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
Interface of a thread-safe std::queue.
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
This abstract class represents an interface to GNSS blocks.
std::string implementation() override
Returns "Plutosdr_Signal_Source".