GNSS-SDR  0.0.21
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  * \author Carles Fernandez Prades, 2015-2026. cfernandez(at)cttc.es
6  *
7  * -----------------------------------------------------------------------------
8  *
9  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
10  * This file is part of GNSS-SDR.
11  *
12  * Copyright (C) 2010-2026 (see AUTHORS file for a list of contributors)
13  * SPDX-License-Identifier: GPL-3.0-or-later
14  *
15  * -----------------------------------------------------------------------------
16  */
17 
18 
19 #ifndef GNSS_SDR_GPS_CNAV_NAVIGATION_MESSAGE_H
20 #define GNSS_SDR_GPS_CNAV_NAVIGATION_MESSAGE_H
21 
22 
23 #include "GPS_CNAV.h"
24 #include "gps_cnav_ephemeris.h"
25 #include "gps_cnav_iono.h"
26 #include "gps_cnav_utc_model.h"
27 #include <bitset>
28 #include <cstdint>
29 #include <map>
30 #include <string>
31 #include <utility>
32 #include <vector>
33 
34 /** \addtogroup Core
35  * \{ */
36 /** \addtogroup System_Parameters
37  * \{ */
38 
39 enum class CnavSystem
40 {
41  GPS,
42  QZSS
43 };
44 
45 /*!
46  * \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200M
47  *
48  * See https://www.gps.gov/sites/default/files/2025-07/IS-GPS-200M.pdf Appendix III
49  */
51 {
52 public:
53  /*!
54  * Default constructor
55  */
56  explicit Gps_CNAV_Navigation_Message(CnavSystem system = CnavSystem::GPS);
57 
58  void decode_page(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& data_bits);
59 
60  /*!
61  * \brief Obtain a GPS SV Ephemeris class filled with current SV data
62  */
64 
65  /*!
66  * \brief Check if we have a new iono record stored in the GPS ephemeris class
67  */
68  bool have_new_iono();
69 
70  /*!
71  * \brief Obtain a GPS ionospheric correction parameters class filled with current SV data
72  */
73  Gps_CNAV_Iono get_iono() const;
74 
75  /*!
76  * \brief Obtain a GPS UTC model parameters class filled with current SV data
77  */
79 
80  /*!
81  * \briefCheck if we have a new GPS UTC model record stored in the GPS ephemeris class
82  */
83  bool have_new_utc_model();
84 
85  /*!
86  * \brief Check if we have a new ephemeris stored in the GPS ephemeris class
87  */
88  bool have_new_ephemeris();
89 
90 private:
91  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;
92  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;
93  bool read_navigation_bool(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& bits, const std::vector<std::pair<int32_t, int32_t>>& parameter) const;
94 
95  Gps_CNAV_Ephemeris ephemeris_record{};
96  Gps_CNAV_Iono iono_record{};
97  Gps_CNAV_Utc_Model utc_model_record{};
98 
99  std::map<int32_t, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus
100 
101  CnavSystem d_system;
102  int32_t d_TOW{};
103 
104  bool b_flag_ephemeris_1{};
105  bool b_flag_ephemeris_2{};
106  bool b_flag_iono_valid{}; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono
107  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
108 };
109 
110 
111 /** \} */
112 /** \} */
113 #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.
Gps_CNAV_Navigation_Message(CnavSystem system=CnavSystem::GPS)
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.