GNSS-SDR  0.0.13
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  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
8  *
9  * GNSS-SDR is a software defined Global Navigation
10  * Satellite Systems receiver
11  *
12  * This file is part of GNSS-SDR.
13  *
14  * SPDX-License-Identifier: GPL-3.0-or-later
15  *
16  * -----------------------------------------------------------------------------
17  */
18 
19 #ifndef GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
20 #define GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
21 
22 
23 #include "gnss_satellite.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 #if GNURADIO_USES_STD_POINTERS
31 #include <memory> // for std::shared_ptr
32 #else
33 #include <boost/shared_ptr.hpp>
34 #endif
35 
36 extern "C"
37 {
38 #include "cnav_msg.h"
39 }
40 
41 
43 
44 #if GNURADIO_USES_STD_POINTERS
45 using gps_l2c_telemetry_decoder_gs_sptr = std::shared_ptr<gps_l2c_telemetry_decoder_gs>;
46 #else
47 using gps_l2c_telemetry_decoder_gs_sptr = boost::shared_ptr<gps_l2c_telemetry_decoder_gs>;
48 #endif
49 
50 gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
51  const Gnss_Satellite &satellite,
52  bool dump);
53 
54 /*!
55  * \brief This class implements a block that decodes CNAV data defined in IS-GPS-200K
56  */
57 class gps_l2c_telemetry_decoder_gs : public gr::block
58 {
59 public:
61  void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN
62  void set_channel(int32_t channel); //!< Set receiver's channel
63  void reset();
64 
65  /*!
66  * \brief This is where all signal processing takes place
67  */
68  int general_work(int noutput_items, gr_vector_int &ninput_items,
69  gr_vector_const_void_star &input_items, gr_vector_void_star &output_items);
70 
71 private:
72  friend gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
73  const Gnss_Satellite &satellite,
74  bool dump);
75 
76  gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, bool dump);
77 
78  Gnss_Satellite d_satellite;
79 
80  cnav_msg_decoder_t d_cnav_decoder{};
81 
82  Gps_CNAV_Navigation_Message d_CNAV_Message;
83 
84  std::string d_dump_filename;
85  std::ofstream d_dump_file;
86 
87  double d_TOW_at_current_symbol;
88  double d_TOW_at_Preamble;
89 
90  uint64_t d_sample_counter;
91  uint64_t d_last_valid_preamble;
92 
93  int32_t d_channel;
94  int32_t d_state;
95  int32_t d_crc_error_count;
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 };
104 
105 
106 #endif // GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
Utilities for CNAV message manipulation of the libswiftnav library.
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.