-
Notifications
You must be signed in to change notification settings - Fork 97
Expand file tree
/
Copy pathMSG_SSR_FLAG_HIGH_LEVEL.h
More file actions
278 lines (244 loc) · 8.42 KB
/
Copy pathMSG_SSR_FLAG_HIGH_LEVEL.h
File metadata and controls
278 lines (244 loc) · 8.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
/*
* Copyright (C) 2015-2021 Swift Navigation Inc.
* Contact: https://support.swiftnav.com
*
* This source is subject to the license found in the file 'LICENSE' which must
* be distributed together with this source. All other rights reserved.
*
* THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
* EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
*/
/*****************************************************************************
* Automatically generated from yaml/swiftnav/sbp/integrity.yaml
* with generate.py. Please do not hand edit!
*****************************************************************************/
#ifndef LIBSBP_INTEGRITY_MSG_SSR_FLAG_HIGH_LEVEL_H
#define LIBSBP_INTEGRITY_MSG_SSR_FLAG_HIGH_LEVEL_H
#include <math.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stddef.h>
#include <stdint.h>
#include <string.h>
#include <libsbp/common.h>
#include <libsbp/gnss/GPSTimeSec.h>
#include <libsbp/integrity_macros.h>
#include <libsbp/string/sbp_string.h>
#ifdef __cplusplus
extern "C" {
#endif
/******************************************************************************
*
* SBP_MSG_SSR_FLAG_HIGH_LEVEL
*
*****************************************************************************/
/** High level integrity flags
*
* Integrity monitoring flags for multiple aggregated elements. An element could
* be a satellite, SSR grid point, or SSR tile. A group of aggregated elements
* being monitored for integrity could refer to:
*
* - Satellites in a particular {GPS, GAL, BDS, QZSS} constellation.
*
* - Satellites in the line-of-sight of a particular SSR tile.
*
* - Satellites in the line-of-sight of a particular SSR grid point.
*
* The integrity usage for a group of aggregated elements varies according to
* the integrity flag of the satellites comprising that group.
*
* SSR_INTEGRITY_USAGE_NOMINAL: All satellites received passed the integrity
* check and have flag INTEGRITY_FLAG_OK.
*
* SSR_INTEGRITY_USAGE_WARNING: A limited number of elements in the group failed
* the integrity check. Refer to more granular integrity messages for details on
* the specific failing elements.
*
* SSR_INTEGRITY_USAGE_ALERT: Most elements in the group failed the integrity
* check, do not use for positioning.
*
*/
typedef struct {
/**
* GNSS reference time of the observation used to generate the flag.
*/
sbp_gps_time_sec_t obs_time;
/**
* GNSS reference time of the ionospheric correction associated to the flag.
*/
sbp_gps_time_sec_t iono_corr_time;
/**
* GNSS reference time of the satellite correction associated to the flag.
*/
sbp_gps_time_sec_t sat_corr_time;
/**
* SSR Solution ID.
*/
u8 ssr_sol_id;
/**
* Unique identifier of the set this tile belongs to.
*/
u16 tile_set_id;
/**
* Unique identifier of this tile in the tile set.
*/
u16 tile_id;
/**
* Chain and type of flag.
*/
u8 chain_id;
/**
* Use GPS satellites.
*/
u8 use_gps_sat;
/**
* Use GAL satellites.
*/
u8 use_gal_sat;
/**
* Use BDS satellites.
*/
u8 use_bds_sat;
/**
* Use QZSS satellites.
*/
u8 use_qzss_sat;
/**
* Reserved
*/
u8 reserved[SBP_MSG_SSR_FLAG_HIGH_LEVEL_RESERVED_MAX];
/**
* Use tropo grid points.
*/
u8 use_tropo_grid_points;
/**
* Use iono grid points.
*/
u8 use_iono_grid_points;
/**
* Use iono tile satellite LoS.
*/
u8 use_iono_tile_sat_los;
/**
* Use iono grid point satellite LoS.
*/
u8 use_iono_grid_point_sat_los;
} sbp_msg_ssr_flag_high_level_t;
/**
* Get encoded size of an instance of sbp_msg_ssr_flag_high_level_t
*
* @param msg sbp_msg_ssr_flag_high_level_t instance
* @return Length of on-wire representation
*/
static inline size_t sbp_msg_ssr_flag_high_level_encoded_len(
const sbp_msg_ssr_flag_high_level_t *msg) {
(void)msg;
return SBP_MSG_SSR_FLAG_HIGH_LEVEL_ENCODED_LEN;
}
/**
* Encode an instance of sbp_msg_ssr_flag_high_level_t to wire representation
*
* This function encodes the given instance in to the user provided buffer. The
* buffer provided to this function must be large enough to store the encoded
* message otherwise it will return SBP_ENCODE_ERROR without writing anything to
* the buffer.
*
* Specify the length of the destination buffer in the \p len parameter. If
* non-null the number of bytes written to the buffer will be returned in \p
* n_written.
*
* @param buf Destination buffer
* @param len Length of \p buf
* @param n_written If not null, on success will be set to the number of bytes
* written to \p buf
* @param msg Instance of sbp_msg_ssr_flag_high_level_t to encode
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_encode(
uint8_t *buf, uint8_t len, uint8_t *n_written,
const sbp_msg_ssr_flag_high_level_t *msg);
/**
* Decode an instance of sbp_msg_ssr_flag_high_level_t from wire representation
*
* This function decodes the wire representation of a
* sbp_msg_ssr_flag_high_level_t message to the given instance. The caller must
* specify the length of the buffer in the \p len parameter. If non-null the
* number of bytes read from the buffer will be returned in \p n_read.
*
* @param buf Wire representation of the sbp_msg_ssr_flag_high_level_t instance
* @param len Length of \p buf
* @param n_read If not null, on success will be set to the number of bytes read
* from \p buf
* @param msg Destination
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_decode(
const uint8_t *buf, uint8_t len, uint8_t *n_read,
sbp_msg_ssr_flag_high_level_t *msg);
/**
* Send an instance of sbp_msg_ssr_flag_high_level_t with the given write
* function
*
* An equivalent of #sbp_message_send which operates specifically on
* sbp_msg_ssr_flag_high_level_t
*
* The given message will be encoded to wire representation and passed in to the
* given write function callback. The write callback will be called several
* times for each invocation of this function.
*
* @param s SBP state
* @param sender_id SBP sender id
* @param msg Message to send
* @param write Write function
* @return SBP_OK on success, or other libsbp error code
*/
SBP_EXPORT s8 sbp_msg_ssr_flag_high_level_send(
sbp_state_t *s, u16 sender_id, const sbp_msg_ssr_flag_high_level_t *msg,
sbp_write_fn_t write);
/**
* Compare two instances of sbp_msg_ssr_flag_high_level_t
*
* The two instances will be compared and a value returned consistent with the
* return codes of comparison functions from the C standard library
*
* 0 will be returned if \p a and \p b are considered equal
* A value less than 0 will be returned if \p a is considered to be less than \p
* b A value greater than 0 will be returned if \p b is considered to be greater
* than \p b
*
* @param a sbp_msg_ssr_flag_high_level_t instance
* @param b sbp_msg_ssr_flag_high_level_t instance
* @return 0, <0, >0
*/
SBP_EXPORT int sbp_msg_ssr_flag_high_level_cmp(
const sbp_msg_ssr_flag_high_level_t *a,
const sbp_msg_ssr_flag_high_level_t *b);
#ifdef __cplusplus
}
static inline bool operator==(const sbp_msg_ssr_flag_high_level_t &lhs,
const sbp_msg_ssr_flag_high_level_t &rhs) {
return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) == 0;
}
static inline bool operator!=(const sbp_msg_ssr_flag_high_level_t &lhs,
const sbp_msg_ssr_flag_high_level_t &rhs) {
return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) != 0;
}
static inline bool operator<(const sbp_msg_ssr_flag_high_level_t &lhs,
const sbp_msg_ssr_flag_high_level_t &rhs) {
return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) < 0;
}
static inline bool operator<=(const sbp_msg_ssr_flag_high_level_t &lhs,
const sbp_msg_ssr_flag_high_level_t &rhs) {
return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) <= 0;
}
static inline bool operator>(const sbp_msg_ssr_flag_high_level_t &lhs,
const sbp_msg_ssr_flag_high_level_t &rhs) {
return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) > 0;
}
static inline bool operator>=(const sbp_msg_ssr_flag_high_level_t &lhs,
const sbp_msg_ssr_flag_high_level_t &rhs) {
return sbp_msg_ssr_flag_high_level_cmp(&lhs, &rhs) >= 0;
}
#endif // ifdef __cplusplus
#endif /* LIBSBP_INTEGRITY_MSG_SSR_FLAG_HIGH_LEVEL_H */