GNSS-SDR  0.0.14
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 "tlm_conf.h"
25 #include <gnuradio/block.h>
26 #include <gnuradio/types.h> // for gr_vector_const_void_star
27 #include <cstdint>
28 #include <fstream>
29 #include <string>
30 
31 extern "C"
32 {
33 #include "cnav_msg.h"
34 }
35 
36 /** \addtogroup Telemetry_Decoder
37  * \{ */
38 /** \addtogroup Telemetry_Decoder_gnuradio_blocks
39  * \{ */
40 
41 
43 
44 using gps_l2c_telemetry_decoder_gs_sptr = gnss_shared_ptr<gps_l2c_telemetry_decoder_gs>;
45 
46 gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
47  const Gnss_Satellite &satellite,
48  const Tlm_Conf &conf);
49 
50 /*!
51  * \brief This class implements a block that decodes CNAV data defined in IS-GPS-200K
52  */
53 class gps_l2c_telemetry_decoder_gs : public gr::block
54 {
55 public:
57  void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN
58  void set_channel(int32_t channel); //!< Set receiver's channel
59  void reset();
60 
61  /*!
62  * \brief This is where all signal processing takes place
63  */
64  int general_work(int noutput_items, gr_vector_int &ninput_items,
65  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
66 
67 private:
68  friend gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
69  const Gnss_Satellite &satellite,
70  const Tlm_Conf &conf);
71 
72  gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf);
73 
74  Gnss_Satellite d_satellite;
75 
76  cnav_msg_decoder_t d_cnav_decoder{};
77 
78  Gps_CNAV_Navigation_Message d_CNAV_Message;
79 
80  std::string d_dump_filename;
81  std::ofstream d_dump_file;
82 
83  double d_TOW_at_current_symbol;
84  double d_TOW_at_Preamble;
85 
86  uint64_t d_sample_counter;
87  uint64_t d_last_valid_preamble;
88 
89  int32_t d_channel;
90  int32_t d_state;
91  int32_t d_crc_error_count;
92 
93  uint32_t d_max_symbols_without_valid_frame;
94 
95  bool d_dump;
96  bool d_sent_tlm_failed_msg;
97  bool d_flag_PLL_180_deg_phase_locked;
98  bool d_flag_valid_word;
99  bool d_dump_mat;
100  bool d_remove_dat;
101 };
102 
103 
104 /** \} */
105 /** \} */
106 #endif // GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
Utilities for CNAV message manipulation of the libswiftnav library.
Class that contains all the configuration parameters for generic telemetry decoder block...
This interface represents a GNSS block.
This class implements a block that decodes CNAV data defined in IS-GPS-200K.
Interface of the Gnss_Satellite class.
This class represents a GNSS satellite.
Interface of a GPS CNAV Data message decoder.
int general_work(int noutput_items, gr_vector_int &ninput_items, gr_vector_const_void_star &input_items, gr_vector_void_star &output_items)
This is where all signal processing takes place.
This class decodes a GPS CNAV Data message as described in IS-GPS-200K.
void set_channel(int32_t channel)
Set receiver&#39;s channel.
void set_satellite(const Gnss_Satellite &satellite)
Set satellite PRN.