GNSS-SDR  0.0.19
An Open Source GNSS Software Defined Receiver
gps_cnav_navigation_message.h
Go to the documentation of this file.
1 /*!
2  * \file gps_cnav_navigation_message.h
3  * \brief Interface of a GPS CNAV Data message decoder
4  * \author Javier Arribas, 2015. jarribas(at)cttc.es
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-2020 (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_GPS_CNAV_NAVIGATION_MESSAGE_H
19 #define GNSS_SDR_GPS_CNAV_NAVIGATION_MESSAGE_H
20 
21 
22 #include "GPS_CNAV.h"
23 #include "gps_cnav_ephemeris.h"
24 #include "gps_cnav_iono.h"
25 #include "gps_cnav_utc_model.h"
26 #include <bitset>
27 #include <cstdint>
28 #include <map>
29 #include <string>
30 #include <utility>
31 #include <vector>
32 
33 /** \addtogroup Core
34  * \{ */
35 /** \addtogroup System_Parameters
36  * \{ */
37 
38 
39 /*!
40  * \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200M
41  *
42  * See https://www.gps.gov/technical/icwg/IS-GPS-200M.pdf Appendix III
43  */
45 {
46 public:
47  /*!
48  * Default constructor
49  */
51 
52  void decode_page(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& data_bits);
53 
54  /*!
55  * \brief Obtain a GPS SV Ephemeris class filled with current SV data
56  */
58 
59  /*!
60  * \brief Check if we have a new iono record stored in the GPS ephemeris class
61  */
62  bool have_new_iono();
63 
64  /*!
65  * \brief Obtain a GPS ionospheric correction parameters class filled with current SV data
66  */
67  Gps_CNAV_Iono get_iono() const;
68 
69  /*!
70  * \brief Obtain a GPS UTC model parameters class filled with current SV data
71  */
73 
74  /*!
75  * \briefCheck if we have a new GPS UTC model record stored in the GPS ephemeris class
76  */
77  bool have_new_utc_model();
78 
79  /*!
80  * \brief Check if we have a new ephemeris stored in the GPS ephemeris class
81  */
82  bool have_new_ephemeris();
83 
84 private:
85  uint64_t read_navigation_unsigned(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& bits, const std::vector<std::pair<int32_t, int32_t>>& parameter) const;
86  int64_t read_navigation_signed(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& bits, const std::vector<std::pair<int32_t, int32_t>>& parameter) const;
87  bool read_navigation_bool(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& bits, const std::vector<std::pair<int32_t, int32_t>>& parameter) const;
88 
89  Gps_CNAV_Ephemeris ephemeris_record{};
90  Gps_CNAV_Iono iono_record{};
91  Gps_CNAV_Utc_Model utc_model_record{};
92 
93  std::map<int32_t, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus
94 
95  int32_t d_TOW{};
96 
97  bool b_flag_ephemeris_1{};
98  bool b_flag_ephemeris_2{};
99  bool b_flag_iono_valid{}; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono
100  bool b_flag_utc_valid{}; //!< If set, it indicates that the utc parameters are filled and are not yet read by the get_utc_model
101 };
102 
103 
104 /** \} */
105 /** \} */
106 #endif // GNSS_SDR_GPS_CNAV_NAVIGATION_MESSAGE_H
bool have_new_ephemeris()
Check if we have a new ephemeris stored in the GPS ephemeris class.
This is a storage class for the GPS CNAV ephemeris data as described in IS-GPS-200M.
Interface of a GPS CNAV UTC MODEL storage.
Defines parameters for GPS CNAV.
Gps_CNAV_Iono get_iono() const
Obtain a GPS ionospheric correction parameters class filled with current SV data. ...
bool have_new_iono()
Check if we have a new iono record stored in the GPS ephemeris class.
This class is a storage for the GPS UTC MODEL data as described in in IS-GPS-200M.
Gps_CNAV_Utc_Model get_utc_model()
Obtain a GPS UTC model parameters class filled with current SV data.
This class decodes a GPS CNAV Data message as described in IS-GPS-200M.
Interface of a GPS CNAV IONOSPHERIC MODEL storage.
Interface of a GPS CNAV EPHEMERIS storage.
This class is a storage for the GPS IONOSPHERIC data as described in IS-GPS-200M. ...
Definition: gps_cnav_iono.h:34
Gps_CNAV_Ephemeris get_ephemeris() const
Obtain a GPS SV Ephemeris class filled with current SV data.