2015-05-25 15:55:10 +00:00
|
|
|
/*!
|
2015-06-05 23:21:00 +00:00
|
|
|
* \file gps_cnav_navigation_message.h
|
|
|
|
* \brief Interface of a GPS CNAV Data message decoder
|
2015-05-25 15:55:10 +00:00
|
|
|
* \author Javier Arribas, 2015. jarribas(at)cttc.es
|
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-05-25 15:55:10 +00:00
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
2015-05-25 15:55:10 +00:00
|
|
|
* This file is part of GNSS-SDR.
|
|
|
|
*
|
2020-12-30 12:35:06 +00:00
|
|
|
* Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
|
2020-02-08 00:20:02 +00:00
|
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
2015-05-25 15:55:10 +00:00
|
|
|
*
|
2020-07-28 14:57:15 +00:00
|
|
|
* -----------------------------------------------------------------------------
|
2015-05-25 15:55:10 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
2020-02-08 09:10:46 +00:00
|
|
|
#ifndef GNSS_SDR_GPS_CNAV_NAVIGATION_MESSAGE_H
|
|
|
|
#define GNSS_SDR_GPS_CNAV_NAVIGATION_MESSAGE_H
|
2016-01-10 13:30:04 +00:00
|
|
|
|
2015-05-25 15:55:10 +00:00
|
|
|
|
2018-02-26 02:15:53 +00:00
|
|
|
#include "GPS_CNAV.h"
|
|
|
|
#include "gps_cnav_ephemeris.h"
|
|
|
|
#include "gps_cnav_iono.h"
|
|
|
|
#include "gps_cnav_utc_model.h"
|
2015-05-25 15:55:10 +00:00
|
|
|
#include <bitset>
|
2018-08-10 18:34:03 +00:00
|
|
|
#include <cstdint>
|
2015-05-25 15:55:10 +00:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <utility>
|
2018-12-09 21:00:09 +00:00
|
|
|
#include <vector>
|
2018-02-26 02:15:53 +00:00
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
/** \addtogroup Core
|
|
|
|
* \{ */
|
|
|
|
/** \addtogroup System_Parameters
|
|
|
|
* \{ */
|
|
|
|
|
2015-05-25 15:55:10 +00:00
|
|
|
|
|
|
|
/*!
|
2021-07-24 11:47:52 +00:00
|
|
|
* \brief This class decodes a GPS CNAV Data message as described in IS-GPS-200M
|
2015-05-25 15:55:10 +00:00
|
|
|
*
|
2021-07-24 11:47:52 +00:00
|
|
|
* See https://www.gps.gov/technical/icwg/IS-GPS-200M.pdf Appendix III
|
2015-05-25 15:55:10 +00:00
|
|
|
*/
|
|
|
|
class Gps_CNAV_Navigation_Message
|
|
|
|
{
|
|
|
|
public:
|
2019-07-01 21:44:42 +00:00
|
|
|
/*!
|
|
|
|
* Default constructor
|
|
|
|
*/
|
|
|
|
Gps_CNAV_Navigation_Message();
|
|
|
|
|
2021-04-11 12:47:36 +00:00
|
|
|
void decode_page(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& data_bits);
|
2018-08-13 23:13:07 +00:00
|
|
|
|
2015-05-25 15:55:10 +00:00
|
|
|
/*!
|
|
|
|
* \brief Obtain a GPS SV Ephemeris class filled with current SV data
|
|
|
|
*/
|
2020-06-23 07:47:58 +00:00
|
|
|
Gps_CNAV_Ephemeris get_ephemeris() const;
|
2018-08-13 23:13:07 +00:00
|
|
|
|
2015-06-05 16:46:00 +00:00
|
|
|
/*!
|
2017-03-23 14:45:41 +00:00
|
|
|
* \brief Check if we have a new iono record stored in the GPS ephemeris class
|
2015-06-05 16:46:00 +00:00
|
|
|
*/
|
|
|
|
bool have_new_iono();
|
2018-08-13 23:13:07 +00:00
|
|
|
|
2015-05-25 15:55:10 +00:00
|
|
|
/*!
|
|
|
|
* \brief Obtain a GPS ionospheric correction parameters class filled with current SV data
|
|
|
|
*/
|
2020-06-23 07:47:58 +00:00
|
|
|
Gps_CNAV_Iono get_iono() const;
|
2015-05-25 15:55:10 +00:00
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Obtain a GPS UTC model parameters class filled with current SV data
|
|
|
|
*/
|
|
|
|
Gps_CNAV_Utc_Model get_utc_model();
|
|
|
|
|
2015-06-05 16:46:00 +00:00
|
|
|
/*!
|
2017-03-23 14:45:41 +00:00
|
|
|
* \briefCheck if we have a new GPS UTC model record stored in the GPS ephemeris class
|
|
|
|
*/
|
|
|
|
bool have_new_utc_model();
|
|
|
|
|
|
|
|
/*!
|
|
|
|
* \brief Check if we have a new ephemeris stored in the GPS ephemeris class
|
2015-06-05 16:46:00 +00:00
|
|
|
*/
|
|
|
|
bool have_new_ephemeris();
|
2015-05-25 15:55:10 +00:00
|
|
|
|
2019-07-01 21:44:42 +00:00
|
|
|
private:
|
2021-04-11 12:47:36 +00:00
|
|
|
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;
|
|
|
|
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;
|
|
|
|
bool read_navigation_bool(const std::bitset<GPS_CNAV_DATA_PAGE_BITS>& bits, const std::vector<std::pair<int32_t, int32_t>>& parameter) const;
|
2019-07-01 21:44:42 +00:00
|
|
|
|
2020-06-10 08:15:59 +00:00
|
|
|
Gps_CNAV_Ephemeris ephemeris_record{};
|
|
|
|
Gps_CNAV_Iono iono_record{};
|
|
|
|
Gps_CNAV_Utc_Model utc_model_record{};
|
2020-06-23 07:47:58 +00:00
|
|
|
|
|
|
|
std::map<int32_t, std::string> satelliteBlock; //!< Map that stores to which block the PRN belongs https://www.navcen.uscg.gov/?Do=constellationStatus
|
|
|
|
|
|
|
|
int32_t d_TOW{};
|
|
|
|
|
|
|
|
bool b_flag_ephemeris_1{};
|
|
|
|
bool b_flag_ephemeris_2{};
|
|
|
|
bool b_flag_iono_valid{}; //!< If set, it indicates that the ionospheric parameters are filled and are not yet read by the get_iono
|
|
|
|
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
|
2015-05-25 15:55:10 +00:00
|
|
|
};
|
|
|
|
|
2020-11-01 12:37:19 +00:00
|
|
|
|
|
|
|
/** \} */
|
|
|
|
/** \} */
|
|
|
|
#endif // GNSS_SDR_GPS_CNAV_NAVIGATION_MESSAGE_H
|