GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
channel.h
Go to the documentation of this file.
1/*!
2 * \file channel.h
3 * \brief Interface of a GNSS channel.
4 * \author Carlos Aviles, 2010. carlos.avilesr(at)googlemail.com
5 * Luis Esteve, 2011. luis(at)epsilon-formacion.com
6 *
7 * It holds blocks for acquisition, tracking,
8 * navigation data extraction and pseudorange calculation.
9 *
10 * -----------------------------------------------------------------------------
11 *
12 * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
13 * This file is part of GNSS-SDR.
14 *
15 * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
16 * SPDX-License-Identifier: GPL-3.0-or-later
17 *
18 * -----------------------------------------------------------------------------
19 */
20
21#ifndef GNSS_SDR_CHANNEL_H
22#define GNSS_SDR_CHANNEL_H
23
24#include "channel_fsm.h"
25#include "channel_interface.h"
27#include "concurrent_queue.h"
28#include "gnss_signal.h"
29#include "gnss_synchro.h"
30#include <gnuradio/block.h>
31#include <pmt/pmt.h>
32#include <cstddef>
33#include <cstdint>
34#include <memory>
35#include <mutex>
36#include <string>
37
38/** \addtogroup Channel
39 * Classes containing a GNSS channel.
40 * \{ */
41/** \addtogroup Channel_adapters channel_adapters
42 * Classes that wrap an AcquisitionInterface,
43 * a TrackingInterface and a TelemetryDecoderInterface, and handles
44 * their interaction.
45 * \{ */
46
47
52
53
54/*!
55 * \brief This class represents a GNSS channel. It wraps an AcquisitionInterface,
56 * a TrackingInterface and a TelemetryDecoderInterface, and handles
57 * their interaction through a Finite State Machine
58 *
59 */
61{
62public:
63 //! Constructor
64 Channel(const ConfigurationInterface* configuration,
65 uint32_t channel,
66 std::shared_ptr<AcquisitionInterface> acq,
67 std::shared_ptr<TrackingInterface> trk,
68 std::shared_ptr<TelemetryDecoderInterface> nav,
69 const std::string& role,
70 const std::string& signal_str,
72
73 ~Channel() = default; //!< Destructor
74
75 void connect(gr::top_block_sptr top_block) override; //!< Connects the tracking block to the top_block and to the telemetry
76 void disconnect(gr::top_block_sptr top_block) override;
77 gr::basic_block_sptr get_left_block() override;
78 gr::basic_block_sptr get_left_block_trk() override; //!< Gets the GNU Radio tracking block input pointer
79 gr::basic_block_sptr get_right_block_trk() override; //!< Gets the GNU Radio tracking block output pointer
80 gr::basic_block_sptr get_left_block_acq() override; //!< Gets the GNU Radio acquisition block input pointer
81 gr::basic_block_sptr get_right_block_acq() override; //!< Gets the GNU Radio acquisition block output pointer
82 gr::basic_block_sptr get_right_block() override; //!< Gets the GNU Radio channel block output pointer
83
84 inline std::string role() override { return role_; }
85 inline std::string implementation() override { return std::string("Channel"); } //!< Returns "Channel"
86 inline size_t item_size() override { return 2 * sizeof(float); }
87 Gnss_Signal get_signal() override;
88 void start_acquisition() override; //!< Start the State Machine
89 void stop_channel() override; //!< Stop the State Machine
90 void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal
91
92 void assist_acquisition_doppler(double Carrier_Doppler_hz) override;
93
94 inline std::shared_ptr<AcquisitionInterface> acquisition() const { return acq_; }
95 inline std::shared_ptr<TrackingInterface> tracking() const { return trk_; }
96 inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; }
97
98private:
99 std::shared_ptr<ChannelFsm> channel_fsm_;
100 std::shared_ptr<AcquisitionInterface> acq_;
101 std::shared_ptr<TrackingInterface> trk_;
102 std::shared_ptr<TelemetryDecoderInterface> nav_;
103 channel_msg_receiver_cc_sptr channel_msg_rx_;
104 Gnss_Synchro gnss_synchro_{};
105 Gnss_Signal gnss_signal_;
106 std::string role_;
107 std::mutex mx_;
108 uint32_t channel_;
109 int glonass_extend_correlation_ms_;
110 bool connected_;
111 bool repeat_;
112 bool flag_enable_fpga_;
113};
114
115
116/** \} */
117/** \} */
118#endif // GNSS_SDR_CHANNEL_H
Interface of the State Machine for channel.
This class represents an interface to a channel GNSS block.
GNU Radio block that receives asynchronous channel messages from acquisition and tracking blocks.
This abstract class represents an interface to an acquisition GNSS block.
This abstract class represents an interface to a channel GNSS block.
gr::basic_block_sptr get_left_block_acq() override
Gets the GNU Radio acquisition block input pointer.
std::string implementation() override
Returns "Channel".
Definition channel.h:85
gr::basic_block_sptr get_left_block_trk() override
Gets the GNU Radio tracking block input pointer.
gr::basic_block_sptr get_right_block_trk() override
Gets the GNU Radio tracking block output pointer.
void set_signal(const Gnss_Signal &gnss_signal_) override
Sets the channel GNSS signal.
void start_acquisition() override
Start the State Machine.
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)
Constructor.
void stop_channel() override
Stop the State Machine.
~Channel()=default
Destructor.
gr::basic_block_sptr get_right_block() override
Gets the GNU Radio channel block output pointer.
gr::basic_block_sptr get_right_block_acq() override
Gets the GNU Radio acquisition block output pointer.
void connect(gr::top_block_sptr top_block) override
Connects the tracking block to the top_block and to the telemetry.
This class implements a thread-safe std::queue.
This abstract class represents an interface to configuration parameters.
This class represents a GNSS signal.
Definition gnss_signal.h:39
This abstract class represents an interface to a navigation GNSS block.
This abstract class represents an interface to a tracking block.
Interface of a thread-safe std::queue.
Implementation of the Gnss_Signal class.
Interface of the Gnss_Synchro class.