GNSS-SDR  0.0.14
An Open Source GNSS Software Defined Receiver
galileo_cnav_message.h
Go to the documentation of this file.
1 /*!
2  * \file galileo_cnav_message.h
3  * \brief Implementation of a Galileo CNAV Data message as described in
4  * Galileo High Accuracy Service E6-B Signal-In-Space Message Specification v1.2
5  * (April 2020)
6  * \author Carles Fernandez-Prades, 2020 cfernandez(at)cttc.es
7  *
8  * -----------------------------------------------------------------------------
9  *
10  * GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
11  * This file is part of GNSS-SDR.
12  *
13  * Copyright (C) 2010-2020 (see AUTHORS file for a list of contributors)
14  * SPDX-License-Identifier: GPL-3.0-or-later
15  *
16  * -----------------------------------------------------------------------------
17  */
18 
19 #ifndef GNSS_SDR_GALILEO_CNAV_MESSAGE_H
20 #define GNSS_SDR_GALILEO_CNAV_MESSAGE_H
21 
22 #include "Galileo_CNAV.h"
23 #include "galileo_has_data.h"
24 #include <bitset>
25 #include <cstdint>
26 #include <list>
27 #include <string>
28 
29 /** \addtogroup Core
30  * \{ */
31 /** \addtogroup System_Parameters
32  * \{ */
33 
34 
35 /*!
36  * \brief This class handles the Galileo CNAV Data message, as described in the
37  * Galileo High Accuracy Service E6-B Signal-In-Space Message Specification v1.2
38  * (April 2020)
39  */
41 {
42 public:
43  Galileo_Cnav_Message() = default;
44 
45  void read_HAS_page(const std::string& page_string);
46 
47  inline bool have_new_HAS_message()
48  {
49  return d_new_message;
50  }
51 
52  inline bool is_HAS_in_test_mode() const
53  {
54  return d_test_mode;
55  }
56 
57  inline bool is_HAS_message_dummy() const
58  {
59  return d_page_dummy;
60  }
61 
62  inline Galileo_HAS_data get_HAS_data() const
63  {
64  return d_HAS_data;
65  }
66 
67 private:
68  bool CRC_test(std::bitset<GALILEO_CNAV_BITS_FOR_CRC> bits, uint32_t checksum) const;
69  void read_HAS_page_header(const std::string& page_string);
70  void process_HAS_page(const std::string& page_string);
71  void decode_message_type1();
72  void read_HAS_message_type1(const std::string& message_string);
73  void read_MT1_header(const std::string& message_string);
74  void read_MT1_body(const std::string& message_string);
75 
76  uint8_t read_has_page_header_parameter(std::bitset<GALILEO_CNAV_PAGE_HEADER_BITS> bits, const std::pair<int32_t, int32_t>& parameter) const;
77  uint8_t read_has_message_header_parameter_uint8(std::bitset<GALILEO_CNAV_MT1_HEADER_BITS> bits, const std::pair<int32_t, int32_t>& parameter) const;
78  uint16_t read_has_message_header_parameter_uint16(std::bitset<GALILEO_CNAV_MT1_HEADER_BITS> bits, const std::pair<int32_t, int32_t>& parameter) const;
79  bool read_has_message_header_parameter_bool(std::bitset<GALILEO_CNAV_MT1_HEADER_BITS> bits, const std::pair<int32_t, int32_t>& parameter) const;
80  uint8_t read_has_message_body_uint8(const std::string& bits) const;
81  uint16_t read_has_message_body_uint16(const std::string& bits) const;
82  uint64_t read_has_message_body_uint64(const std::string& bits) const;
83  int16_t read_has_message_body_int16(const std::string& bits) const;
84 
85  Galileo_HAS_data d_HAS_data{};
86 
87  std::string d_encoded_message_type_1;
88  std::list<uint8_t> d_list_pid;
89 
90  uint8_t d_has_page_status{};
91  uint8_t d_current_message_id{};
92  uint8_t d_current_message_size{};
93 
94  uint8_t d_received_message_page_id{};
95  uint8_t d_received_message_type{};
96  uint8_t d_received_message_id{};
97  uint8_t d_received_encoded_messages{};
98  uint8_t d_received_message_size{};
99 
100  bool d_test_mode{};
101  bool d_new_message{};
102  bool d_flag_CRC_test{};
103  bool d_page_dummy{};
104 };
105 
106 
107 /** \} */
108 /** \} */
109 #endif // GNSS_SDR_GALILEO_CNAV_MESSAGE_H
This class is a storage for Galileo HAS message type 1, as defined in Galileo High Accuracy Service E...
This class handles the Galileo CNAV Data message, as described in the Galileo High Accuracy Service E...
Galileo CNAV mesage constants. Data from: Galileo High Accuracy Service E6-B Signal-In-Space Message ...
Class for Galileo HAS message type 1 data storage.