GNSS-SDR  0.0.14
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"
22 #include "gnss_block_interface.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 std::string role() override
57  {
58  return role_;
59  }
60 
61  /*!
62  * \brief Returns "RtlTcp_Signal_Source"
63  */
64  inline std::string implementation() override
65  {
66  return "RtlTcp_Signal_Source";
67  }
68 
69  inline size_t item_size() override
70  {
71  return item_size_;
72  }
73 
74  void connect(gr::top_block_sptr top_block) override;
75  void disconnect(gr::top_block_sptr top_block) override;
76  gr::basic_block_sptr get_left_block() override;
77  gr::basic_block_sptr get_right_block() override;
78 
79 private:
80  void MakeBlock();
81 
82  rtl_tcp_signal_source_c_sptr signal_source_;
83 
84  gnss_shared_ptr<gr::block> valve_;
85  gr::blocks::file_sink::sptr file_sink_;
86 
87  std::string role_;
88  std::string item_type_;
89  std::string dump_filename_;
90 
91  // rtl_tcp settings
92  std::string address_;
93  size_t item_size_;
94  uint64_t samples_;
95  int sample_rate_;
96  int freq_;
97  int gain_;
98  int if_gain_;
99  double rf_gain_;
100  unsigned int in_stream_;
101  unsigned int out_stream_;
102  int16_t port_;
103  bool AGC_enabled_;
104  bool flip_iq_;
105  bool dump_;
106 };
107 
108 
109 /** \} */
110 /** \} */
111 #endif // GNSS_SDR_RTL_TCP_SIGNAL_SOURCE_H
Interface of a thread-safe std::queue.
Interface of an rtl_tcp signal source reader.
This interface represents a GNSS block.
This abstract class represents an interface to configuration parameters.
std::string implementation() override
Returns "RtlTcp_Signal_Source".
This class reads from rtl_tcp, which streams interleaved I/Q samples over TCP. (see https://osmocom...
This abstract class represents an interface to GNSS blocks.