GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
rtl_tcp_signal_source.h
Go to the documentation of this file.
1 /*!
2  * \file rtl_tcp_signal_source.h
3  * \brief Signal source which reads from rtl_tcp.
4  * (see https://osmocom.org/projects/rtl-sdr/wiki for more information)
5  * \author Anthony Arnold, 2015. anthony.arnold(at)uqconnect.edu.au
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 #ifndef GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
19 #define GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
20 
21 #include "concurrent_queue.h"
23 #include "signal_source_base.h"
24 #include <gnuradio/blocks/deinterleave.h>
25 #include <gnuradio/blocks/file_sink.h>
26 #include <gnuradio/blocks/float_to_complex.h>
27 #include <pmt/pmt.h>
28 #include <stdexcept>
29 #include <string>
30 
31 
32 /** \addtogroup Signal_Source
33  * \{ */
34 /** \addtogroup Signal_Source_adapters
35  * \{ */
36 
37 
39 
40 /*!
41  * \brief This class reads from rtl_tcp, which streams interleaved
42  * I/Q samples over TCP.
43  * (see https://osmocom.org/projects/rtl-sdr/wiki)
44  */
46 {
47 public:
48  RtlTcpSignalSource(const ConfigurationInterface* configuration,
49  const std::string& role,
50  unsigned int in_stream,
51  unsigned int out_stream,
53 
54  ~RtlTcpSignalSource() = default;
55 
56  inline size_t item_size() override
57  {
58  return item_size_;
59  }
60 
61  void connect(gr::top_block_sptr top_block) override;
62  void disconnect(gr::top_block_sptr top_block) override;
63  gr::basic_block_sptr get_left_block() override;
64  gr::basic_block_sptr get_right_block() override;
65 
66 private:
67  void MakeBlock();
68 
69  rtl_tcp_signal_source_c_sptr signal_source_;
70 
71  gnss_shared_ptr<gr::block> valve_;
72  gr::blocks::file_sink::sptr file_sink_;
73 
74  std::string item_type_;
75  std::string dump_filename_;
76 
77  // rtl_tcp settings
78  std::string address_;
79  size_t item_size_;
80  uint64_t samples_;
81  double rf_gain_;
82  int sample_rate_;
83  int freq_;
84  int gain_;
85  int if_gain_;
86  unsigned int in_stream_;
87  unsigned int out_stream_;
88  int16_t port_;
89  bool AGC_enabled_;
90  bool flip_iq_;
91  bool dump_;
92 };
93 
94 
95 /** \} */
96 /** \} */
97 #endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
Interface of a thread-safe std::queue.
Interface of an rtl_tcp signal source reader.
Header file of the base class to signal_source GNSS blocks.
This abstract class represents an interface to configuration parameters.
This class reads from rtl_tcp, which streams interleaved I/Q samples over TCP. (see https://osmocom...