GNSS-SDR  0.0.13
An Open Source GNSS Software Defined Receiver
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  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
13  *
14  * GNSS-SDR is a software defined Global Navigation
15  * Satellite Systems receiver
16  *
17  * This file is part of GNSS-SDR.
18  *
19  * SPDX-License-Identifier: GPL-3.0-or-later
20  *
21  * -----------------------------------------------------------------------------
22  */
23 
24 #ifndef GNSS_SDR_CHANNEL_H
25 #define GNSS_SDR_CHANNEL_H
26 
27 #include "channel_fsm.h"
28 #include "channel_interface.h"
30 #include "concurrent_queue.h"
31 #include "gnss_signal.h"
32 #include "gnss_synchro.h"
33 #include <gnuradio/block.h>
34 #include <pmt/pmt.h>
35 #include <cstddef>
36 #include <cstdint>
37 #include <memory>
38 #include <mutex>
39 #include <string>
40 
43 class TrackingInterface;
45 
46 
47 /*!
48  * \brief This class represents a GNSS channel. It wraps an AcquisitionInterface,
49  * a Tracking Interface and a TelemetryDecoderInterface, and handles
50  * their interaction through a Finite State Machine
51  *
52  */
53 class Channel : public ChannelInterface
54 {
55 public:
56  //! Constructor
57  Channel(const ConfigurationInterface* configuration, uint32_t channel, std::shared_ptr<AcquisitionInterface> acq,
58  std::shared_ptr<TrackingInterface> trk, std::shared_ptr<TelemetryDecoderInterface> nav,
59  const std::string& role, const std::string& signal_str, Concurrent_Queue<pmt::pmt_t>* queue);
60 
61  ~Channel() = default; //!< Destructor
62 
63  void connect(gr::top_block_sptr top_block) override; //!< connects the tracking block to the top_block and to the telemetry
64  void disconnect(gr::top_block_sptr top_block) override;
65  gr::basic_block_sptr get_left_block() override; //!< gets the gnuradio tracking block pointer
66  gr::basic_block_sptr get_left_block_trk() override; //!< gets the gnuradio tracking block pointer
67  gr::basic_block_sptr get_left_block_acq() override; //!< gets the gnuradio tracking block pointer
68  gr::basic_block_sptr get_right_block() override;
69 
70  inline std::string role() override { return role_; }
71  //! Returns "Channel"
72  inline std::string implementation() override { return std::string("Channel"); }
73  inline size_t item_size() override { return 0; }
74  inline Gnss_Signal get_signal() const override { return gnss_signal_; }
75  void start_acquisition() override; //!< Start the State Machine
76  void stop_channel() override; //!< Stop the State Machine
77  void set_signal(const Gnss_Signal& gnss_signal_) override; //!< Sets the channel GNSS signal
78 
79  void assist_acquisition_doppler(double Carrier_Doppler_hz) override;
80 
81  inline std::shared_ptr<AcquisitionInterface> acquisition() const { return acq_; }
82  inline std::shared_ptr<TrackingInterface> tracking() const { return trk_; }
83  inline std::shared_ptr<TelemetryDecoderInterface> telemetry() const { return nav_; }
84  void msg_handler_events(pmt::pmt_t msg);
85 
86 private:
87  std::shared_ptr<ChannelFsm> channel_fsm_;
88  std::shared_ptr<AcquisitionInterface> acq_;
89  std::shared_ptr<TrackingInterface> trk_;
90  std::shared_ptr<TelemetryDecoderInterface> nav_;
91  channel_msg_receiver_cc_sptr channel_msg_rx_;
92  Gnss_Synchro gnss_synchro_{};
93  Gnss_Signal gnss_signal_;
94  std::string role_;
95  std::mutex mx_;
96  uint32_t channel_;
97  bool connected_;
98  bool repeat_;
99  bool flag_enable_fpga_;
100 };
101 
102 #endif // GNSS_SDR_CHANNEL_H
gr::basic_block_sptr get_left_block_trk() override
gets the gnuradio tracking block pointer
Interface of a thread-safe std::queue.
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 set_signal(const Gnss_Signal &gnss_signal_) override
Sets the channel GNSS signal.
gr::basic_block_sptr get_left_block_acq() override
gets the gnuradio tracking block pointer
void connect(gr::top_block_sptr top_block) override
connects the tracking block to the top_block and to the telemetry
This class represents an interface to a channel GNSS block.
Interface of the State Machine for channel.
This class represents a GNSS channel. It wraps an AcquisitionInterface, a Tracking Interface and a Te...
Definition: channel.h:53
This abstract class represents an interface to an acquisition GNSS block.
This is the class that contains the information that is shared by the processing blocks.
Definition: gnss_synchro.h:33
Implementation of the Gnss_Signal class.
GNU Radio block that receives asynchronous channel messages from acquisition and tracking blocks...
This abstract class represents an interface to configuration parameters.
This abstract class represents an interface to a channel GNSS block.
This abstract class represents an interface to a navigation GNSS block.
This class represents a GNSS signal.
Definition: gnss_signal.h:33
std::string implementation() override
Returns "Channel".
Definition: channel.h:72
void start_acquisition() override
Start the State Machine.
This abstract class represents an interface to a tracking block.
gr::basic_block_sptr get_left_block() override
gets the gnuradio tracking block pointer
~Channel()=default
Destructor.
void stop_channel() override
Stop the State Machine.
Interface of the Gnss_Synchro class.