2015-05-05 16:18:16 +00:00
|
|
|
/*!
|
2019-03-02 01:21:03 +00:00
|
|
|
* \file gps_l2c_telemetry_decoder_gs.h
|
2019-07-20 09:13:28 +00:00
|
|
|
* \brief Interface of a CNAV message demodulator block
|
2015-05-05 16:18:16 +00:00
|
|
|
* \author Javier Arribas, 2015. jarribas(at)cttc.es
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-05-05 16:18:16 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2015-05-05 16:18:16 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2015-05-05 16:18:16 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-05-05 16:18:16 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
|
|
|
|
#define GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
|
2015-05-05 16:18:16 +00:00
|
|
|
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2020-11-03 19:51:57 +00:00
|
|
|
#include "gnss_block_interface.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include "gnss_satellite.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "gps_cnav_navigation_message.h"
|
2021-09-05 22:05:29 +00:00
|
|
|
#include "nav_message_packet.h"
|
2020-11-21 18:37:22 +00:00
|
|
|
#include "tlm_conf.h"
|
2021-09-13 21:19:37 +00:00
|
|
|
#include "tlm_crc_stats.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <gnuradio/block.h>
|
2019-03-05 21:17:09 +00:00
|
|
|
#include <gnuradio/types.h> // for gr_vector_const_void_star
|
2018-08-13 11:03:01 +00:00
|
|
|
#include <cstdint>
|
2015-05-05 16:18:16 +00:00
|
|
|
#include <fstream>
|
2021-09-13 21:19:37 +00:00
|
|
|
#include <memory> // for std::unique_ptr
|
2015-05-05 16:18:16 +00:00
|
|
|
#include <string>
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2019-07-20 09:13:28 +00:00
|
|
|
extern "C"
|
|
|
|
{
|
2018-03-03 01:03:39 +00:00
|
|
|
#include "cnav_msg.h"
|
2017-03-23 14:45:41 +00:00
|
|
|
}
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Telemetry_Decoder
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Telemetry_Decoder_gnuradio_blocks
|
|
|
|
* \{ */
|
2015-05-05 16:18:16 +00:00
|
|
|
|
2020-11-03 19:51:57 +00:00
|
|
|
|
2019-03-02 01:21:03 +00:00
|
|
|
class gps_l2c_telemetry_decoder_gs;
|
2015-05-05 16:18:16 +00:00
|
|
|
|
2020-11-03 19:51:57 +00:00
|
|
|
using gps_l2c_telemetry_decoder_gs_sptr = gnss_shared_ptr<gps_l2c_telemetry_decoder_gs>;
|
2015-05-05 16:18:16 +00:00
|
|
|
|
2019-07-20 09:13:28 +00:00
|
|
|
gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
|
|
|
|
const Gnss_Satellite &satellite,
|
2020-11-21 19:26:43 +00:00
|
|
|
const Tlm_Conf &conf);
|
2015-05-05 16:18:16 +00:00
|
|
|
|
|
|
|
/*!
|
2021-07-24 11:47:52 +00:00
|
|
|
* \brief This class implements a block that decodes CNAV data defined in IS-GPS-200M
|
2015-05-05 16:18:16 +00:00
|
|
|
*/
|
2019-03-02 01:21:03 +00:00
|
|
|
class gps_l2c_telemetry_decoder_gs : public gr::block
|
2015-05-05 16:18:16 +00:00
|
|
|
{
|
|
|
|
public:
|
2021-10-10 16:56:14 +00:00
|
|
|
~gps_l2c_telemetry_decoder_gs() override;
|
2018-03-03 01:03:39 +00:00
|
|
|
void set_satellite(const Gnss_Satellite &satellite); //!< Set satellite PRN
|
2018-08-13 11:03:01 +00:00
|
|
|
void set_channel(int32_t channel); //!< Set receiver's channel
|
2019-03-18 15:28:49 +00:00
|
|
|
void reset();
|
2019-07-20 09:13:28 +00:00
|
|
|
|
2015-05-05 16:18:16 +00:00
|
|
|
/*!
|
|
|
|
* \brief This is where all signal processing takes place
|
|
|
|
*/
|
2018-03-03 01:03:39 +00:00
|
|
|
int general_work(int noutput_items, gr_vector_int &ninput_items,
|
2021-10-10 16:56:14 +00:00
|
|
|
gr_vector_const_void_star &input_items, gr_vector_void_star &output_items) override;
|
2015-05-05 16:18:16 +00:00
|
|
|
|
|
|
|
private:
|
2019-07-20 09:13:28 +00:00
|
|
|
friend gps_l2c_telemetry_decoder_gs_sptr gps_l2c_make_telemetry_decoder_gs(
|
|
|
|
const Gnss_Satellite &satellite,
|
2020-11-21 19:26:43 +00:00
|
|
|
const Tlm_Conf &conf);
|
2019-07-20 09:13:28 +00:00
|
|
|
|
2020-11-21 19:26:43 +00:00
|
|
|
gps_l2c_telemetry_decoder_gs(const Gnss_Satellite &satellite, const Tlm_Conf &conf);
|
2015-05-05 16:18:16 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
Gnss_Satellite d_satellite;
|
2017-03-23 14:45:41 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
cnav_msg_decoder_t d_cnav_decoder{};
|
2020-06-19 00:15:56 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
Gps_CNAV_Navigation_Message d_CNAV_Message;
|
2020-06-19 00:15:56 +00:00
|
|
|
|
2021-09-05 22:05:29 +00:00
|
|
|
Nav_Message_Packet d_nav_msg_packet;
|
2021-09-13 21:19:37 +00:00
|
|
|
std::unique_ptr<Tlm_CRC_Stats> d_Tlm_CRC_Stats;
|
2021-09-05 22:05:29 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
std::string d_dump_filename;
|
|
|
|
std::ofstream d_dump_file;
|
2017-03-23 14:45:41 +00:00
|
|
|
|
2015-06-05 16:46:00 +00:00
|
|
|
double d_TOW_at_current_symbol;
|
|
|
|
double d_TOW_at_Preamble;
|
2020-06-19 00:15:56 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
uint64_t d_sample_counter;
|
|
|
|
uint64_t d_last_valid_preamble;
|
2020-06-19 00:15:56 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
int32_t d_channel;
|
2020-06-19 00:15:56 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
uint32_t d_max_symbols_without_valid_frame;
|
2015-06-05 16:46:00 +00:00
|
|
|
|
2020-06-23 07:47:58 +00:00
|
|
|
bool d_dump;
|
|
|
|
bool d_sent_tlm_failed_msg;
|
|
|
|
bool d_flag_PLL_180_deg_phase_locked;
|
|
|
|
bool d_flag_valid_word;
|
2020-11-21 18:37:22 +00:00
|
|
|
bool d_dump_mat;
|
2020-11-23 15:09:27 +00:00
|
|
|
bool d_remove_dat;
|
2021-09-05 22:05:29 +00:00
|
|
|
bool d_enable_navdata_monitor;
|
2021-09-13 21:19:37 +00:00
|
|
|
bool d_dump_crc_stats;
|
2015-05-05 16:18:16 +00:00
|
|
|
};
|
|
|
|
|
2015-05-14 16:53:12 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_GPS_L2C_TELEMETRY_DECODER_GS_H
|