GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
gps_l2c_telemetry_decoder_gs.h
Go to the documentation of this file.
1 /*!
2  * \file gps_l2c_telemetry_decoder_gs.h
3  * \brief Interface of a CNAV message demodulator block
4  * \author Javier Arribas, 2015. 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 #ifndef GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
18 #define GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
19 
20 
21 #include "gnss_block_interface.h"
22 #include "gnss_satellite.h"
24 #include "nav_message_packet.h"
25 #include "tlm_conf.h"
26 #include "tlm_crc_stats.h"
27 #include <gnuradio/block.h>
28 #include <gnuradio/types.h> // for gr_vector_const_void_star
29 #include <cstdint>
30 #include <fstream>
31 #include <memory> // for std::unique_ptr
32 #include <string>
33 
34 extern "C"
35 {
36 #include "cnav_msg.h"
37 }
38 
39 /** \addtogroup Telemetry_Decoder
40  * \{ */
41 /** \addtogroup Telemetry_Decoder_gnuradio_blocks
42  * \{ */
43 
44 
46 
47 using gps_l2c_telemetry_decoder_gs_sptr = gnss_shared_ptr<gps_l2c_telemetry_decoder_gs>;
48 
49 gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
50  const Gnss_Satellite &satellite,
51  const Tlm_Conf &conf);
52 
53 /*!
54  * \brief This class implements a block that decodes CNAV data defined in IS-GPS-200M
55  */
56 class gps_l2c_telemetry_decoder_gs : public gr::block
57 {
58 public:
59  ~gps_l2c_telemetry_decoder_gs() override;
60  void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN
61  void set_channel(int32_t channel); //!< Set receiver's channel
62  void reset();
63 
64  /*!
65  * \brief This is where all signal processing takes place
66  */
67  int general_work(int noutput_items, gr_vector_int &ninput_items,
68  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override;
69 
70 private:
71  friend gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
72  const Gnss_Satellite &satellite,
73  const Tlm_Conf &conf);
74 
75  gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf);
76 
77  Gnss_Satellite d_satellite;
78 
79  cnav_msg_decoder_t d_cnav_decoder{};
80 
81  Gps_CNAV_Navigation_Message d_CNAV_Message;
82 
83  Nav_Message_Packet d_nav_msg_packet;
84  std::unique_ptr<Tlm_CRC_Stats> d_Tlm_CRC_Stats;
85 
86  std::string d_dump_filename;
87  std::ofstream d_dump_file;
88 
89  double d_TOW_at_current_symbol;
90  double d_TOW_at_Preamble;
91 
92  uint64_t d_sample_counter;
93  uint64_t d_last_valid_preamble;
94 
95  int32_t d_channel;
96 
97  uint32_t d_max_symbols_without_valid_frame;
98 
99  bool d_dump;
100  bool d_sent_tlm_failed_msg;
101  bool d_flag_PLL_180_deg_phase_locked;
102  bool d_flag_valid_word;
103  bool d_dump_mat;
104  bool d_remove_dat;
105  bool d_enable_navdata_monitor;
106  bool d_dump_crc_stats;
107 };
108 
109 
110 /** \} */
111 /** \} */
112 #endif // GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
Utilities for CNAV message manipulation of the libswiftnav library.
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override
This is where all signal processing takes place.
Class that contains all the configuration parameters for generic telemetry decoder block...
Class that computes the telemetry CRC statistics.
This interface represents a GNSS block.
This class implements a block that decodes CNAV data defined in IS-GPS-200M.
Interface of the Gnss_Satellite class.
This class represents a GNSS satellite.
Interface of a GPS CNAV Data message decoder.
This class decodes a GPS CNAV Data message as described in IS-GPS-200M.
void set_channel(int32_t channel)
Set receiver&#39;s channel.
void set_satellite(const Gnss_Satellite &satellite)
Set satellite PRN.