2011-10-01 18:45:20 +00:00
|
|
|
/*!
|
|
|
|
* \file channel.h
|
2011-12-28 21:36:45 +00:00
|
|
|
* \brief Interface of a GNSS channel.
|
2011-10-01 18:45:20 +00:00
|
|
|
* \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
|
|
|
|
* Luis Esteve, 2011. luis(at)epsilon-formacion.com
|
|
|
|
*
|
|
|
|
* It holds blocks for acquisition, tracking,
|
|
|
|
* navigation data extraction and pseudorange calculation.
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2011-10-01 18:45:20 +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
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2011-10-01 18:45:20 +00:00
|
|
|
*/
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_CHANNEL_H
|
|
|
|
#define GNSS_SDR_CHANNEL_H
|
2019-04-27 11:09:36 +00:00
|
|
|
|
2019-03-20 14:13:17 +00:00
|
|
|
#include "channel_fsm.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "channel_interface.h"
|
2016-04-18 12:17:09 +00:00
|
|
|
#include "channel_msg_receiver_cc.h"
|
2019-07-16 15:41:12 +00:00
|
|
|
#include "concurrent_queue.h"
|
2019-03-04 07:12:50 +00:00
|
|
|
#include "gnss_signal.h"
|
2018-12-09 21:00:09 +00:00
|
|
|
#include "gnss_synchro.h"
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <gnuradio/block.h>
|
2019-07-16 15:41:12 +00:00
|
|
|
#include <pmt/pmt.h>
|
2019-03-04 07:12:50 +00:00
|
|
|
#include <cstddef>
|
|
|
|
#include <cstdint>
|
2018-02-26 02:15:53 +00:00
|
|
|
#include <memory>
|
|
|
|
#include <mutex>
|
2018-12-09 21:00:09 +00:00
|
|
|
#include <string>
|
2012-01-19 07:35:49 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Channel
|
|
|
|
* Classes containing a GNSS channel.
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup Channel_adapters channel_adapters
|
|
|
|
* Classes that wrap an AcquisitionInterface,
|
|
|
|
* a TrackingInterface and a TelemetryDecoderInterface, and handles
|
|
|
|
* their interaction.
|
|
|
|
* \{ */
|
|
|
|
|
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
class ConfigurationInterface;
|
|
|
|
class AcquisitionInterface;
|
|
|
|
class TrackingInterface;
|
|
|
|
class TelemetryDecoderInterface;
|
2019-04-27 11:09:36 +00:00
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
|
|
|
|
/*!
|
2014-01-12 20:07:38 +00:00
|
|
|
* \brief This class represents a GNSS channel. It wraps an AcquisitionInterface,
|
2020-11-01 12:37:19 +00:00
|
|
|
* a TrackingInterface and a TelemetryDecoderInterface, and handles
|
2014-01-12 20:07:38 +00:00
|
|
|
* their interaction through a Finite State Machine
|
2011-10-01 18:45:20 +00:00
|
|
|
*
|
|
|
|
*/
|
2018-03-03 01:03:39 +00:00
|
|
|
class Channel : public ChannelInterface
|
2011-10-01 18:45:20 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
//! Constructor
|
2020-08-03 08:46:07 +00:00
|
|
|
Channel(const ConfigurationInterface* configuration,
|
|
|
|
uint32_t channel,
|
|
|
|
std::shared_ptr<AcquisitionInterface> acq,
|
|
|
|
std::shared_ptr<TrackingInterface> trk,
|
|
|
|
std::shared_ptr<TelemetryDecoderInterface> nav,
|
|
|
|
const std::string& role,
|
|
|
|
const std::string& signal_str,
|
|
|
|
Concurrent_Queue<pmt::pmt_t>* queue);
|
2019-04-27 11:09:36 +00:00
|
|
|
|
2019-07-21 17:32:52 +00:00
|
|
|
~Channel() = default; //!< Destructor
|
2017-08-15 22:58:10 +00:00
|
|
|
|
2020-08-03 08:46:07 +00:00
|
|
|
void connect(gr::top_block_sptr top_block) override; //!< Connects the tracking block to the top_block and to the telemetry
|
2017-08-15 22:58:10 +00:00
|
|
|
void disconnect(gr::top_block_sptr top_block) override;
|
2020-08-03 08:46:07 +00:00
|
|
|
gr::basic_block_sptr get_left_block() override;
|
2020-10-09 20:13:39 +00:00
|
|
|
gr::basic_block_sptr get_left_block_trk() override; //!< Gets the GNU Radio tracking block input pointer
|
2020-10-09 18:55:31 +00:00
|
|
|
gr::basic_block_sptr get_right_block_trk() override; //!< Gets the GNU Radio tracking block output pointer
|
2020-10-09 20:13:39 +00:00
|
|
|
gr::basic_block_sptr get_left_block_acq() override; //!< Gets the GNU Radio acquisition block input pointer
|
2020-10-09 18:55:31 +00:00
|
|
|
gr::basic_block_sptr get_right_block_acq() override; //!< Gets the GNU Radio acquisition block output pointer
|
2020-10-09 20:13:39 +00:00
|
|
|
gr::basic_block_sptr get_right_block() override; //!< Gets the GNU Radio channel block output pointer
|
2017-08-15 22:58:10 +00:00
|
|
|
|
2017-08-21 09:45:12 +00:00
|
|
|
inline std::string role() override { return role_; }
|
2020-08-03 08:46:07 +00:00
|
|
|
inline std::string implementation() override { return std::string("Channel"); } //!< Returns "Channel"
|
|
|
|
inline size_t item_size() override { return 2 * sizeof(float); }
|
2023-12-02 11:54:28 +00:00
|
|
|
Gnss_Signal get_signal() override;
|
2018-03-03 01:03:39 +00:00
|
|
|
void start_acquisition() override; //!< Start the State Machine
|
2018-10-28 10:07:53 +00:00
|
|
|
void stop_channel() override; //!< Stop the State Machine
|
2017-08-15 22:58:10 +00:00
|
|
|
void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal
|
|
|
|
|
2019-07-23 15:56:02 +00:00
|
|
|
void assist_acquisition_doppler(double Carrier_Doppler_hz) override;
|
|
|
|
|
2020-07-09 22:37:55 +00:00
|
|
|
inline std::shared_ptr<AcquisitionInterface> acquisition() const { return acq_; }
|
|
|
|
inline std::shared_ptr<TrackingInterface> tracking() const { return trk_; }
|
|
|
|
inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; }
|
2016-04-15 14:33:41 +00:00
|
|
|
|
2011-10-01 18:45:20 +00:00
|
|
|
private:
|
2022-12-06 11:54:21 +00:00
|
|
|
bool glonass_dll_pll_c_aid_tracking_check() const;
|
2020-06-27 07:52:59 +00:00
|
|
|
std::shared_ptr<ChannelFsm> channel_fsm_;
|
2016-05-02 15:26:32 +00:00
|
|
|
std::shared_ptr<AcquisitionInterface> acq_;
|
|
|
|
std::shared_ptr<TrackingInterface> trk_;
|
|
|
|
std::shared_ptr<TelemetryDecoderInterface> nav_;
|
2020-06-19 10:39:28 +00:00
|
|
|
channel_msg_receiver_cc_sptr channel_msg_rx_;
|
2020-06-25 00:50:07 +00:00
|
|
|
Gnss_Synchro gnss_synchro_{};
|
|
|
|
Gnss_Signal gnss_signal_;
|
2011-10-01 18:45:20 +00:00
|
|
|
std::string role_;
|
2020-06-19 10:39:28 +00:00
|
|
|
std::mutex mx_;
|
2020-06-24 09:34:14 +00:00
|
|
|
uint32_t channel_;
|
2022-08-25 08:16:40 +00:00
|
|
|
int glonass_extend_correlation_ms_;
|
2020-06-19 10:39:28 +00:00
|
|
|
bool connected_;
|
|
|
|
bool repeat_;
|
2020-07-17 09:39:26 +00:00
|
|
|
bool flag_enable_fpga_;
|
2011-10-01 18:45:20 +00:00
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
2020-02-08 09:10:46 +00:00
|
|
|
#endif // GNSS_SDR_CHANNEL_H
|