GNSS-SDR  0.0.14
An Open Source GNSS Software Defined Receiver
gn3s_signal_source.h
Go to the documentation of this file.
1 /*!
2  * \file gn3s_signal_source.h
3  * \brief GN3S USB dongle GPS RF front-end signal sampler driver
4  * \author Javier Arribas, jarribas(at)cttc.es
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 
18 #ifndef GNSS_SDR_GN3S_SIGNAL_SOURCE_H
19 #define GNSS_SDR_GN3S_SIGNAL_SOURCE_H
20 
21 #include "concurrent_queue.h"
22 #include "gnss_block_interface.h"
23 #include <gnuradio/blocks/file_sink.h>
24 #include <gnuradio/hier_block2.h>
25 #include <pmt/pmt.h>
26 #include <cstdint>
27 #include <memory>
28 #include <string>
29 
30 /** \addtogroup Signal_Source
31  * \{ */
32 /** \addtogroup Signal_Source_adapters
33  * \{ */
34 
35 
37 
38 /*!
39  * \brief This class reads samples from a GN3S USB dongle, a RF front-end signal sampler
40  */
42 {
43 public:
44  Gn3sSignalSource(const ConfigurationInterface* configuration,
45  std::string role, unsigned int in_stream,
46  unsigned int out_stream, Concurrent_Queue<pmt::pmt_t>* queue);
47 
48  ~Gn3sSignalSource() = default;
49 
50  inline std::string role() override
51  {
52  return role_;
53  }
54 
55  /*!
56  * \brief Returns "Gn3s_Signal_Source".
57  */
58  inline std::string implementation() override
59  {
60  return "Gn3s_Signal_Source";
61  }
62 
63  inline size_t item_size() override
64  {
65  return item_size_;
66  }
67 
68  void connect(gr::top_block_sptr top_block) override;
69  void disconnect(gr::top_block_sptr top_block) override;
70  gr::basic_block_sptr get_left_block() override;
71  gr::basic_block_sptr get_right_block() override;
72 
73 private:
74  gr::block_sptr gn3s_source_;
75  gr::blocks::file_sink::sptr file_sink_;
76  std::string role_;
77  std::string item_type_;
78  std::string dump_filename_;
79  size_t item_size_;
80  int64_t samples_;
81  unsigned int in_stream_;
82  unsigned int out_stream_;
83  bool dump_;
84 };
85 
86 
87 /** \} */
88 /** \} */
89 #endif // GNSS_SDR_GN3S_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.
std::string implementation() override
Returns "Gn3s_Signal_Source".
This class reads samples from a GN3S USB dongle, a RF front-end signal sampler.
This abstract class represents an interface to GNSS blocks.