From bf9c9d547ba5fad5dda5c16122611ad6a20f4238 Mon Sep 17 00:00:00 2001 From: piyush0411 Date: Sun, 26 Jul 2020 02:24:53 +0530 Subject: [PATCH] Added Telemetry Decoder Block --- .../telemetry_decoder/adapters/CMakeLists.txt | 2 + .../adapters/galileo_e5b_telemetry_decoder.cc | 93 +++++++++++++++ .../adapters/galileo_e5b_telemetry_decoder.h | 109 ++++++++++++++++++ 3 files changed, 204 insertions(+) create mode 100644 src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.cc create mode 100644 src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.h diff --git a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt index b3361d57c..a471dbd5f 100644 --- a/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt +++ b/src/algorithms/telemetry_decoder/adapters/CMakeLists.txt @@ -15,6 +15,7 @@ set(TELEMETRY_DECODER_ADAPTER_SOURCES galileo_e1b_telemetry_decoder.cc sbas_l1_telemetry_decoder.cc galileo_e5a_telemetry_decoder.cc + galileo_e5b_telemetry_decoder.cc glonass_l1_ca_telemetry_decoder.cc glonass_l2_ca_telemetry_decoder.cc beidou_b1i_telemetry_decoder.cc @@ -28,6 +29,7 @@ set(TELEMETRY_DECODER_ADAPTER_HEADERS galileo_e1b_telemetry_decoder.h sbas_l1_telemetry_decoder.h galileo_e5a_telemetry_decoder.h + galileo_e5b_telemetry_decoder.h glonass_l1_ca_telemetry_decoder.h glonass_l2_ca_telemetry_decoder.h beidou_b1i_telemetry_decoder.h diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.cc b/src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.cc new file mode 100644 index 000000000..693bea08d --- /dev/null +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.cc @@ -0,0 +1,93 @@ +/*! + * \file galileo_e5b_telemetry_decoder.cc + * \brief Interface of an adapter of a GALILEO E5B NAV data decoder block + * to a TelemetryDecoderInterface + * \author Piyush Gupta 2020 piyush04111999@gmail.com. + * \note Code added as part of GSoC 2020 Program. + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ------------------------------------------------------------------------- + */ + + +#include "galileo_e5b_telemetry_decoder.h" +#include "configuration_interface.h" +#include + + +GalileoE5bTelemetryDecoder::GalileoE5bTelemetryDecoder( + const ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams) : role_(role), + in_streams_(in_streams), + out_streams_(out_streams) +{ + const std::string default_dump_filename("./navigation.dat"); + DLOG(INFO) << "role " << role; + dump_ = configuration->property(role + ".dump", false); + dump_filename_ = configuration->property(role + ".dump_filename", default_dump_filename); + // make telemetry decoder object + telemetry_decoder_ = galileo_make_telemetry_decoder_gs(satellite_, 1, dump_); // unified galileo decoder set to INAV (frame_type=1) + DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")"; + channel_ = 0; + if (in_streams_ > 1) + { + LOG(ERROR) << "This implementation only supports one input stream"; + } + if (out_streams_ > 1) + { + LOG(ERROR) << "This implementation only supports one output stream"; + } +} + + +void GalileoE5bTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite) +{ + satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN()); + telemetry_decoder_->set_satellite(satellite_); + DLOG(INFO) << "GALILEO TELEMETRY DECODER: satellite set to " << satellite_; +} + + +void GalileoE5bTelemetryDecoder::connect(gr::top_block_sptr top_block) +{ + if (top_block) + { + /* top_block is not null */ + }; + // Nothing to connect internally + DLOG(INFO) << "nothing to connect internally"; +} + + +void GalileoE5bTelemetryDecoder::disconnect(gr::top_block_sptr top_block) +{ + if (top_block) + { + /* top_block is not null */ + }; + // Nothing to disconnect +} + + +gr::basic_block_sptr GalileoE5bTelemetryDecoder::get_left_block() +{ + return telemetry_decoder_; +} + + +gr::basic_block_sptr GalileoE5bTelemetryDecoder::get_right_block() +{ + return telemetry_decoder_; +} \ No newline at end of file diff --git a/src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.h b/src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.h new file mode 100644 index 000000000..cb16fb976 --- /dev/null +++ b/src/algorithms/telemetry_decoder/adapters/galileo_e5b_telemetry_decoder.h @@ -0,0 +1,109 @@ +/*! + * \file galileo_e5b_telemetry_decoder.h + * \brief Interface of an adapter of a GALILEO E5B NAV data decoder block + * to a TelemetryDecoderInterface + * \author Piyush Gupta 2020 piyush04111999@gmail.com. + * \note Code added as part of GSoC 2020 Program. + * + * ------------------------------------------------------------------------- + * + * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors) + * + * GNSS-SDR is a software defined Global Navigation + * Satellite Systems receiver + * + * This file is part of GNSS-SDR. + * + * SPDX-License-Identifier: GPL-3.0-or-later + * + * ------------------------------------------------------------------------- + */ + + +#ifndef GNSS_SDR_GALILEO_E5B_TELEMETRY_DECODER_H +#define GNSS_SDR_GALILEO_E5B_TELEMETRY_DECODER_H + +#include "galileo_telemetry_decoder_gs.h" +#include "gnss_satellite.h" +#include "gnss_synchro.h" +#include "telemetry_decoder_interface.h" +#include // for basic_block_sptr, top_block_sptr +#include // for size_t +#include + + +class ConfigurationInterface; + +/*! + * \brief This class implements a NAV data decoder for Galileo INAV frames in E5b radio link + */ +class GalileoE5bTelemetryDecoder : public TelemetryDecoderInterface +{ +public: + GalileoE5bTelemetryDecoder( + const ConfigurationInterface* configuration, + const std::string& role, + unsigned int in_streams, + unsigned int out_streams); + + ~GalileoE5bTelemetryDecoder() = default; + + /*! + * \brief Returns "Galileo_E5b_Telemetry_Decoder" + */ + inline std::string implementation() override + { + return "Galileo_E5b_Telemetry_Decoder"; + } + + /*! + * \brief Connect + */ + void connect(gr::top_block_sptr top_block) override; + + /*! + * \brief Disconnect + */ + void disconnect(gr::top_block_sptr top_block) override; + + /*! + * \brief Get left block + */ + gr::basic_block_sptr get_left_block() override; + + /*! + * \brief Get right block + */ + gr::basic_block_sptr get_right_block() override; + + void set_satellite(const Gnss_Satellite& satellite) override; + + inline std::string role() override + { + return role_; + } + + inline void set_channel(int channel) override { telemetry_decoder_->set_channel(channel); } + + inline void reset() override + { + telemetry_decoder_->reset(); + } + + inline size_t item_size() override + { + return sizeof(Gnss_Synchro); + } + +private: + galileo_telemetry_decoder_gs_sptr telemetry_decoder_; + Gnss_Satellite satellite_; + std::string dump_filename_; + std::string role_; + int channel_; + unsigned int in_streams_; + unsigned int out_streams_; + bool dump_; +}; + +#endif // GNSS_SDR_GALELIO_E5B_TELEMETRY_DECODER_H \ No newline at end of file