GNSS-SDR  0.0.21
An Open Source GNSS Software Defined Receiver
telemetry_impl_interface.h
Go to the documentation of this file.
1 /*!
2  * \file telemetry_impl_interface.h
3  * \brief Base class for telemetry decoder GNU Radio blocks.
4  * \author Carles Fernandez-Prades, 2025 cfernandez@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-2024 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 #ifndef GNSS_SDR_TELEMETRY_IMPL_INTERFACE_H
18 #define GNSS_SDR_TELEMETRY_IMPL_INTERFACE_H
19 
20 #include "gnss_block_interface.h"
21 #include "gnss_satellite.h"
22 #include <gnuradio/block.h>
23 #include <gnuradio/io_signature.h>
24 #include <cstdint>
25 #include <fstream>
26 #include <memory>
27 #include <string>
28 #include <utility>
29 
30 class Tlm_CRC_Stats;
31 
32 /** \addtogroup Telemetry_Decoder
33  * \{
34  */
35 /** \addtogroup Telemetry_Decoder_gnuradio_blocks telemetry_decoder_gr_blocks
36  * \{
37  */
38 
40 using telemetry_impl_interface_sptr = gnss_shared_ptr<telemetry_impl_interface>;
41 
42 /*!
43  * \brief Common base class for telemetry decoder GNU Radio implementations.
44  */
45 class telemetry_impl_interface : public gr::block
46 {
47 public:
48  telemetry_impl_interface(const std::string& name,
49  gr::io_signature::sptr input_signature,
50  gr::io_signature::sptr output_signature)
51  : gr::block(name,
52  std::move(input_signature),
53  std::move(output_signature)) {}
54 
55  ~telemetry_impl_interface() override = default;
56 
57  virtual void set_satellite(const Gnss_Satellite& satellite) = 0;
58  virtual void set_channel(int channel) = 0;
59  virtual void reset() = 0;
60 
61 protected:
62  void configure_basic_outputs();
63 
64  void configure_dump_file(int32_t channel,
65  bool enable_dump,
66  std::string& dump_filename,
67  std::ofstream& dump_file) const;
68 
69  void configure_crc_stats_channel(int32_t channel,
70  bool& dump_crc_stats,
71  std::unique_ptr<Tlm_CRC_Stats>& crc_stats) const;
72 };
73 
74 /** \} */
75 /** \} */
76 
77 #endif // GNSS_SDR_TELEMETRY_IMPL_INTERFACE_H
Common base class for telemetry decoder GNU Radio implementations.
Class that computes the telemetry CRC statistics.
Definition: tlm_crc_stats.h:32
This interface represents a GNSS block.
Interface of the Gnss_Satellite class.
This class represents a GNSS satellite.