2019-01-25 21:43:00 +00:00
|
|
|
/*!
|
|
|
|
* \file beidou_b3i_telemetry_decoder.cc
|
2019-03-17 23:57:45 +00:00
|
|
|
* \brief Implementation of an adapter of a Beidou B3I NAV data decoder block
|
2019-01-25 21:43:00 +00:00
|
|
|
* to a TelemetryDecoderInterface
|
|
|
|
* \author Damian Miralles, 2019. dmiralles2009@gmail.com
|
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*
|
2019-03-01 19:28:21 +00:00
|
|
|
* Copyright (C) 2010-2019 (see AUTHORS file for a list of contributors)
|
2019-01-25 21:43:00 +00:00
|
|
|
*
|
|
|
|
* GNSS-SDR is a software defined Global Navigation
|
|
|
|
* Satellite Systems receiver
|
|
|
|
*
|
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2019-01-25 21:43:00 +00:00
|
|
|
*
|
|
|
|
* -------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "beidou_b3i_telemetry_decoder.h"
|
|
|
|
#include "configuration_interface.h"
|
|
|
|
#include <glog/logging.h>
|
|
|
|
|
2019-03-17 23:57:45 +00:00
|
|
|
BeidouB3iTelemetryDecoder::BeidouB3iTelemetryDecoder(
|
2019-07-21 17:32:52 +00:00
|
|
|
ConfigurationInterface *configuration, const std::string &role,
|
2019-03-17 23:57:45 +00:00
|
|
|
unsigned int in_streams, unsigned int out_streams)
|
2019-03-18 07:43:38 +00:00
|
|
|
: role_(role), in_streams_(in_streams), out_streams_(out_streams)
|
|
|
|
{
|
|
|
|
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_ = beidou_b3i_make_telemetry_decoder_gs(satellite_, dump_);
|
|
|
|
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";
|
|
|
|
}
|
2019-01-25 21:43:00 +00:00
|
|
|
}
|
|
|
|
|
2019-03-18 07:43:38 +00:00
|
|
|
|
|
|
|
void BeidouB3iTelemetryDecoder::set_satellite(const Gnss_Satellite &satellite)
|
|
|
|
{
|
|
|
|
satellite_ = Gnss_Satellite(satellite.get_system(), satellite.get_PRN());
|
|
|
|
telemetry_decoder_->set_satellite(satellite_);
|
|
|
|
DLOG(INFO) << "TELEMETRY DECODER: satellite set to " << satellite_;
|
2019-01-25 21:43:00 +00:00
|
|
|
}
|
|
|
|
|
2019-03-18 07:43:38 +00:00
|
|
|
|
|
|
|
void BeidouB3iTelemetryDecoder::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";
|
2019-01-25 21:43:00 +00:00
|
|
|
}
|
|
|
|
|
2019-03-18 07:43:38 +00:00
|
|
|
|
|
|
|
void BeidouB3iTelemetryDecoder::disconnect(gr::top_block_sptr top_block)
|
|
|
|
{
|
|
|
|
if (top_block)
|
|
|
|
{ /* top_block is not null */
|
|
|
|
};
|
|
|
|
// Nothing to disconnect
|
2019-01-25 21:43:00 +00:00
|
|
|
}
|
|
|
|
|
2019-03-18 07:43:38 +00:00
|
|
|
|
|
|
|
gr::basic_block_sptr BeidouB3iTelemetryDecoder::get_left_block()
|
|
|
|
{
|
|
|
|
return telemetry_decoder_;
|
2019-01-25 21:43:00 +00:00
|
|
|
}
|
|
|
|
|
2019-03-18 07:43:38 +00:00
|
|
|
|
|
|
|
gr::basic_block_sptr BeidouB3iTelemetryDecoder::get_right_block()
|
|
|
|
{
|
|
|
|
return telemetry_decoder_;
|
2019-01-25 21:43:00 +00:00
|
|
|
}
|