GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
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 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
10 * This file is part of GNSS-SDR.
11 *
12 * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
13 * SPDX-License-Identifier: GPL-3.0-or-later
14 *
15 * -----------------------------------------------------------------------------
16 */
17
18
19#ifndef GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
20#define GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
21
22#include "signal_source_base.h"
23#include <gnuradio/blocks/file_sink.h>
24#if GRIIO_INCLUDE_HAS_GNURADIO
25#if GR_IIO_TEMPLATIZED_API
26#include <gnuradio/iio/fmcomms2_source.h>
27#else
28#include <gnuradio/iio/pluto_source.h>
29#endif
30#else
31#include <iio/pluto_source.h>
32#endif
33#include "concurrent_queue.h"
34#include <pmt/pmt.h>
35#include <cstdint>
36#include <string>
37
38
39/** \addtogroup Signal_Source
40 * \{ */
41/** \addtogroup Signal_Source_adapters
42 * \{ */
43
44
46
47/*!
48 */
49class PlutosdrSignalSource : public SignalSourceBase
50{
51public:
52 PlutosdrSignalSource(const ConfigurationInterface* configuration,
53 const std::string& role, unsigned int in_stream,
54 unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
55
56 ~PlutosdrSignalSource() = default;
57
58 size_t item_size() override
59 {
60 return item_size_;
61 }
62
63 void connect(gr::top_block_sptr top_block) override;
64 void disconnect(gr::top_block_sptr top_block) override;
65 gr::basic_block_sptr get_left_block() override;
66 gr::basic_block_sptr get_right_block() override;
67
68private:
69 const std::string default_gain_mode = std::string("slow_attack");
70#if GR_IIO_TEMPLATIZED_API
71 gr::iio::fmcomms2_source<gr_complex>::sptr plutosdr_source_;
72#else
73 gr::iio::pluto_source::sptr plutosdr_source_;
74#endif
75
76 gnss_shared_ptr<gr::block> valve_;
77 gr::blocks::file_sink::sptr file_sink_;
78
79 std::string dump_filename_;
80
81 // Front-end settings
82 std::string uri_; // device direction
83 std::string gain_mode_;
84 std::string filter_file_;
85 std::string filter_source_;
86 std::string filter_filename_;
87 std::string item_type_;
88 double rf_gain_;
89 int64_t samples_;
90 uint64_t freq_; // frequency of local oscillator
91 uint64_t sample_rate_;
92 uint64_t bandwidth_;
93 uint64_t buffer_size_; // reception buffer
94 size_t item_size_;
95 float Fpass_;
96 float Fstop_;
97 unsigned int in_stream_;
98 unsigned int out_stream_;
99
100 bool quadrature_;
101 bool rf_dc_;
102 bool bb_dc_;
103 bool filter_auto_;
104 bool dump_;
105};
106
107
108/** \} */
109/** \} */
110#endif // GNSS_SDR_PLUTOSDR_SIGNAL_SOURCE_H
This class implements a thread-safe std::queue.
This abstract class represents an interface to configuration parameters.
SignalSourceBase(ConfigurationInterface const *configuration, std::string role, std::string impl)
Constructor.
Interface of a thread-safe std::queue.
Header file of the base class to signal_source GNSS blocks.