GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
tlm_crc_stats.h
Go to the documentation of this file.
1 /*!
2  * \file tlm_crc_stats.h
3  * \brief Class that computes the telemetry CRC statistics
4  * \author Marc Majoral, 2021. mmajoral(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 #ifndef GNSS_SDR_CRC_STATS_H
18 #define GNSS_SDR_CRC_STATS_H
19 
20 #include <cstdint>
21 #include <fstream> // for std::ofstream
22 #include <string> // for std::string
23 
24 /** \addtogroup Telemetry_Decoder
25  * \{ */
26 /** \addtogroup Telemetry_Decoder_libs telemetry_decoder_libs
27  * \{ */
28 
29 /*!
30  * \brief Class that computes the telemetry CRC statistics
31  */
33 {
34 public:
35  Tlm_CRC_Stats() = default;
36 
37  ~Tlm_CRC_Stats();
38 
39  /*!
40  * \brief Initialize the telemetry CRC statistics
41  */
42  void initialize(std::string dump_crc_stats_filename);
43 
44  /*!
45  * \brief Initialize the channel number and output file
46  */
47  bool set_channel(int32_t channel);
48 
49  /*!
50  * \brief Update the CRC statistics
51  */
52  void update_CRC_stats(bool CRC);
53 
54 private:
55  std::ofstream d_dump_file;
56  std::string d_dump_crc_stats_filename;
57  uint32_t d_num_crc_ok{0};
58  uint32_t d_num_crc_not_ok{0};
59  int32_t d_channel{0};
60  bool d_enable_crc_stats{false};
61 };
62 
63 
64 /** \} */
65 /** \} */
66 #endif // GNSS_SDR_CRC_STATS_H
Class that computes the telemetry CRC statistics.
Definition: tlm_crc_stats.h:32
void initialize(std::string dump_crc_stats_filename)
Initialize the telemetry CRC statistics.
void update_CRC_stats(bool CRC)
Update the CRC statistics.
bool set_channel(int32_t channel)
Initialize the channel number and output file.