2017-07-10 06:00:49 +00:00
|
|
|
/*!
|
|
|
|
* \file glonass_l1_ca_telemetry_decoder.cc
|
|
|
|
* \brief Implementation of an adapter of a GLONASS L1 C/A NAV data decoder block
|
|
|
|
* to a TelemetryDecoderInterface
|
2017-08-21 04:23:57 +00:00
|
|
|
* \note Code added as part of GSoC 2017 program
|
2017-07-10 06:00:49 +00:00
|
|
|
* \author Damian Miralles, 2017. dmiralles2009(at)gmail.com
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2017-07-10 06:00:49 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2017-07-10 06:00:49 +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
|
2017-07-10 06:00:49 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2017-07-10 06:00:49 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
#include "glonass_l1_ca_telemetry_decoder.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include "configuration_interface.h"
|
|
|
|
#include <glog/logging.h>
|
|
|
|
|
2017-07-10 06:00:49 +00:00
|
|
|
|
2020-06-29 07:07:41 +00:00
|
|
|
GlonassL1CaTelemetryDecoder::GlonassL1CaTelemetryDecoder(
|
|
|
|
const ConfigurationInterface* configuration,
|
2018-12-03 18:01:47 +00:00
|
|
|
const std::string& role,
|
2018-03-03 01:03:39 +00:00
|
|
|
unsigned int in_streams,
|
|
|
|
unsigned int out_streams) : role_(role),
|
|
|
|
in_streams_(in_streams),
|
|
|
|
out_streams_(out_streams)
|
2017-07-10 06:00:49 +00:00
|
|
|
{
|
|
|
|
DLOG(INFO) << "role " << role;
|
2020-11-21 18:37:22 +00:00
|
|
|
tlm_parameters_.SetFromConfiguration(configuration, role);
|
2017-07-10 06:00:49 +00:00
|
|
|
// make telemetry decoder object
|
2020-11-21 18:37:22 +00:00
|
|
|
telemetry_decoder_ = glonass_l1_ca_make_telemetry_decoder_gs(satellite_, tlm_parameters_);
|
2017-07-10 06:00:49 +00:00
|
|
|
DLOG(INFO) << "telemetry_decoder(" << telemetry_decoder_->unique_id() << ")";
|
|
|
|
channel_ = 0;
|
2018-06-03 17:11:16 +00:00
|
|
|
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";
|
|
|
|
}
|
2017-07-10 06:00:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-03-03 01:03:39 +00:00
|
|
|
void GlonassL1CaTelemetryDecoder::set_satellite(const Gnss_Satellite& satellite)
|
2017-07-10 06:00:49 +00:00
|
|
|
{
|
|
|
|
satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
|
|
|
telemetry_decoder_->set_satellite(satellite_);
|
|
|
|
DLOG(INFO) << "TELEMETRY DECODER: satellite set to " << satellite_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GlonassL1CaTelemetryDecoder::connect(gr::top_block_sptr top_block)
|
|
|
|
{
|
2018-03-03 01:03:39 +00:00
|
|
|
if (top_block)
|
|
|
|
{ /* top_block is not null */
|
|
|
|
};
|
2017-07-10 06:00:49 +00:00
|
|
|
// Nothing to connect internally
|
|
|
|
DLOG(INFO) << "nothing to connect internally";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void GlonassL1CaTelemetryDecoder::disconnect(gr::top_block_sptr top_block)
|
|
|
|
{
|
2018-03-03 01:03:39 +00:00
|
|
|
if (top_block)
|
|
|
|
{ /* top_block is not null */
|
|
|
|
};
|
2017-07-10 06:00:49 +00:00
|
|
|
// Nothing to disconnect
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gr::basic_block_sptr GlonassL1CaTelemetryDecoder::get_left_block()
|
|
|
|
{
|
|
|
|
return telemetry_decoder_;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
gr::basic_block_sptr GlonassL1CaTelemetryDecoder::get_right_block()
|
|
|
|
{
|
|
|
|
return telemetry_decoder_;
|
|
|
|
}
|