GNSS-SDR 0.0.21
An Open Source GNSS Software Defined Receiver
Loading...
Searching...
No Matches
galileo_ism.h
Go to the documentation of this file.
1/*!
2 * \file galileo_ism.h
3 * \brief Interface of a Galileo Integrity Support Message
4 * \author Carles Fernandez, 2024. cfernandez(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-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_GALILEO_ISM_H
19#define GNSS_SDR_GALILEO_ISM_H
20
21#include "Galileo_INAV.h"
22#include <boost/crc.hpp>
23#include <bitset>
24#include <cstdint>
25#include <unordered_map>
26#include <vector>
27
28/** \addtogroup Core
29 * \{ */
30/** \addtogroup System_Parameters
31 * \{ */
32
33
34/*!
35 * \brief This class is a storage for the GALILEO Integrity Support Message as described
36 * in Galileo ICD paragraph 5.2
37 *
38 * See https://www.gsc-europa.eu/sites/default/files/sites/all/files/Galileo_OS_SIS_ICD_v2.1.pdf
39 */
41{
42public:
43 /*!
44 * Default constructor
45 */
46 Galileo_ISM() = default;
47
48 void set_ism_constellation_id(uint8_t const_id);
49 void set_ism_service_level_id(uint8_t sl_id);
50 void set_ism_wn(uint16_t wn_ism);
51 void set_ism_t0(uint16_t t0);
52 void set_ism_mask_msb(bool mask_msb);
53 void set_ism_mask(uint32_t mask);
54 void set_ism_pconst(uint8_t pconst);
55 void set_ism_psat(uint8_t psat);
56 void set_ism_ura(uint8_t ura);
57 void set_ism_ure(uint8_t ure);
58 void set_ism_bnom(uint8_t bnom);
59 void set_ism_Tvalidity(uint8_t tvalidity);
60
61 bool check_ism_crc(const std::bitset<GALILEO_DATA_JK_BITS>& bits);
62
63 double get_pconst_value() const;
64 double get_psat_value() const;
65 float get_ura_m() const;
66 float get_ure_m() const;
67 float get_bnom_m() const;
68 uint32_t get_mask_ISM() const;
69 uint16_t get_WN_ISM() const;
70 uint16_t get_t0_ISM() const;
71 uint16_t get_Tvalidity_hours() const;
72 bool get_ism_mask_msb() const;
73 bool ism_parameters_apply(uint32_t prn) const;
74
75private:
76 uint32_t compute_crc(const std::vector<uint8_t>& data);
77 boost::crc_optimal<32, 0x814141AB, 0, 0, false, false> d_crc32_ism;
78
79 // ICD 2.1 Table 97
80 std::unordered_map<uint8_t, double> d_ISM_PCONST_MAP = {
81 {0, 1.0e-8},
82 {1, 1.0e-7},
83 {2, 1.0e-6},
84 {3, 3.0e-6},
85 {4, 6.0e-6},
86 {5, 8.0e-6},
87 {6, 1.0e-5},
88 {7, 2.0e-5},
89 {8, 4.0e-5},
90 {9, 6.0e-5},
91 {10, 8.0e-5},
92 {11, 1.0e-4},
93 {12, 1.25e-4},
94 {13, 1.5e-4},
95 {14, 1.75e-4},
96 {15, 2.0e-4}};
97
98 // ICD 2.1 Table 98
99 std::unordered_map<uint8_t, double> d_ISM_PSAT_MAP = {
100 {0, 1.0e-7},
101 {1, 3.0e-7},
102 {2, 6.0e-7},
103 {3, 1.0e-6},
104 {4, 2.0e-6},
105 {5, 3.0e-6},
106 {6, 5.0e-6},
107 {7, 7.0e-6},
108 {8, 1.0e-5},
109 {9, 1.2e-5},
110 {10, 1.4e-5},
111 {11, 1.7e-5},
112 {12, 2.05e-5},
113 {13, 2.4e-5},
114 {14, 2.8e-5},
115 {15, 3.0e-5}};
116
117 // ICD 2.1 Table 99
118 std::unordered_map<uint8_t, float> d_ISM_URA_MAP = {
119 {0, 0.75},
120 {1, 1.0},
121 {2, 1.5},
122 {3, 2.0},
123 {4, 2.25},
124 {5, 2.50},
125 {6, 2.75},
126 {7, 3.0},
127 {8, 3.25},
128 {9, 3.50},
129 {10, 3.75},
130 {11, 4.0},
131 {12, 4.50},
132 {13, 5.0},
133 {14, 5.50},
134 {15, 6.0}};
135
136 // ICD 2.1 Table 100
137 std::unordered_map<uint8_t, float> d_ISM_URE_MAP = {
138 {0, 0.25},
139 {1, 0.50},
140 {2, 0.75},
141 {3, 1.00},
142 {4, 1.25},
143 {5, 1.50},
144 {6, 1.75},
145 {7, 2.0},
146 {8, 2.25},
147 {9, 2.50},
148 {10, 2.75},
149 {11, 3.0},
150 {12, 3.25},
151 {13, 3.50},
152 {14, 3.75},
153 {15, 4.00}};
154
155 // ICD 2.1 Table 101
156 std::unordered_map<uint8_t, float> d_ISM_BNOM_MAP = {
157 {0, 0.0},
158 {1, 0.10},
159 {2, 0.20},
160 {3, 0.30},
161 {4, 0.40},
162 {5, 0.50},
163 {6, 0.60},
164 {7, 0.75},
165 {8, 0.85},
166 {9, 1.0},
167 {10, 1.20},
168 {11, 1.40},
169 {12, 1.60},
170 {13, 1.80},
171 {14, 2.0},
172 {15, 2.4}};
173
174 // ICD 2.1 Table 102
175 std::unordered_map<uint8_t, uint16_t> d_ISM_TVALIDITY_MAP = {
176 {0, 1},
177 {1, 2},
178 {2, 3},
179 {3, 4},
180 {4, 6},
181 {5, 8},
182 {6, 12},
183 {7, 18},
184 {8, 24},
185 {9, 36},
186 {10, 48},
187 {11, 72},
188 {12, 120},
189 {13, 168},
190 {14, 720},
191 {15, 1440}};
192
193 uint32_t d_ism_crc{};
194 uint32_t d_ism_mask{};
195 uint16_t d_ism_wn{};
196 uint16_t d_ism_t0{};
197 uint8_t d_ism_constellation_id{};
198 uint8_t d_ism_service_level_id{};
199 uint8_t d_ism_pconst{};
200 uint8_t d_ism_psat{};
201 uint8_t d_ism_ura{};
202 uint8_t d_ism_ure{};
203 uint8_t d_ism_bnom{};
204 uint8_t d_ism_Tvalidity{};
205 bool d_ism_mask_msb{};
206};
207
208/** \} */
209/** \} */
210#endif // GNSS_SDR_GALILEO_ISM_H
Galileo INAV message constants.
Galileo_ISM()=default