Added Telemetry Decoder Block

This commit is contained in:
piyush0411 2020-07-26 02:24:53 +05:30
parent ea664c9fd2
commit bf9c9d547b
3 changed files with 204 additions and 0 deletions

View File

@ -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

View File

@ -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 <glog/logging.h>
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_;
}

View File

@ -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 <gnuradio/runtime_types.h> // for basic_block_sptr, top_block_sptr
#include <cstddef> // for size_t
#include <string>
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