GNSS-SDR  0.0.21
An Open Source GNSS Software Defined Receiver
ion_gsms_signal_source.h
Go to the documentation of this file.
1 /*!
2  * \file ion_gsms_signal_source.h
3  * \brief GNSS-SDR Signal Source that reads sample streams following ION's GNSS-SDR metadata standard
4  * \author Víctor Castillo Agüero, 2024. victorcastilloaguero(at)gmail.com
5  *
6  * -----------------------------------------------------------------------------
7  *
8  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
9  * This file is part of GNSS-SDR.
10  *
11  * Copyright (C) 2010-2024 (see AUTHORS file for a list of contributors)
12  * SPDX-License-Identifier: GPL-3.0-or-later
13  *
14  * -----------------------------------------------------------------------------
15  */
16 
17 
18 #ifndef GNSS_SDR_ION_GSMS_SIGNAL_SOURCE_H
19 #define GNSS_SDR_ION_GSMS_SIGNAL_SOURCE_H
20 
22 #include "file_source_base.h"
23 #include "gnss_sdr_timestamp.h"
24 #include "ion_gsms.h"
25 #include <GnssMetadata.h>
26 #include <cstdint>
27 #include <memory>
28 #include <string>
29 #include <vector>
30 
31 /** \addtogroup Signal_Source
32  * \{ */
33 /** \addtogroup Signal_Source_adapters
34  * \{ */
35 
36 /*!
37  * \brief Class that reads signals samples from a file
38  * and adapts it to a SignalSourceInterface
39  */
41 {
42 public:
43  IONGSMSSignalSource(const ConfigurationInterface* configuration, const std::string& role,
44  unsigned int in_streams, unsigned int out_streams,
46 
47  ~IONGSMSSignalSource() override = default;
48 
49 protected:
50  void connect(gr::top_block_sptr top_block) override;
51  void disconnect(gr::top_block_sptr top_block) override;
52 
53  gr::basic_block_sptr get_left_block() override;
54  gr::basic_block_sptr get_right_block() override;
55  gr::basic_block_sptr get_right_block(int RF_channel) override;
56 
57  inline size_t item_size() override
58  {
59  return (*sources_.begin())->output_stream_item_size(0);
60  }
61 
62 private:
63  std::vector<IONGSMSFileSource::sptr> make_stream_sources(const std::vector<std::string>& stream_ids) const;
64 
65  void load_metadata();
66 
67  std::vector<std::string> stream_ids_;
68  std::vector<IONGSMSFileSource::sptr> sources_;
69  std::vector<gnss_shared_ptr<gr::block>> copy_blocks_;
70  std::vector<gnss_shared_ptr<gr::block>> valves_;
71 
72  std::string metadata_filepath_;
73  std::shared_ptr<GnssMetadata::Metadata> metadata_;
74 
75  gnss_shared_ptr<Gnss_Sdr_Timestamp> timestamp_block_;
76  std::string timestamp_file_;
77 
78  uint32_t in_streams_;
79  uint32_t out_streams_;
80 };
81 
82 
83 /** \} */
84 /** \} */
85 #endif // GNSS_SDR_ION_GSMS_SIGNAL_SOURCE_H
GNURadio block that adds to sample stream timestamp metadata information stored on a sepparated file...
This abstract class represents an interface to configuration parameters.
Class that reads signals samples from a file and adapts it to a SignalSourceInterface.
Header file of the base class to file-oriented signal_source GNSS blocks.
This class represents an interface to configuration parameters.
GNU Radio block that reads a Block from a file following ION&#39;s GNSS-SDR metadata standard.