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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
/* Generated by cbindgen from crates/rtcm3-ffi/src/lib.rs. Do not edit by hand: run `cbindgen --config crates/rtcm3-ffi/cbindgen.toml --crate rtcm3-ffi --output crates/rtcm3-ffi/include/rtcm3.h` and commit the result. */
/**
* Largest number of satellites a single MSM message can describe (the
* satellite mask is 64 bits wide, per the RTCM3 wire format itself).
*/
/**
* Largest number of satellite/signal cells a single MSM message can
* describe (the cell mask is 64 bits wide, per the RTCM3 wire format
* itself).
*/
/**
* Error codes returned by [`rtcm3_decode`].
*/
if __STDC_VERSION__ >= 202311L
: uint8_t
// __STDC_VERSION__ >= 202311L
;
typedef enum Rtcm3FfiError Rtcm3FfiError;
typedef uint8_t Rtcm3FfiError;
// __STDC_VERSION__ >= 202311L
/**
* Opaque handle to a decoded RTCM3 message, owned by the caller until
* freed with [`rtcm3_message_free`].
*/
typedef struct Rtcm3FfiMessage Rtcm3FfiMessage;
/**
* Stationary RTK Reference Station ARP (type 1005): the base station's
* antenna reference point position.
*/
typedef struct Rtcm3StationArp Rtcm3StationArp;
/**
* GLONASS Code-Phase Biases (type 1230). Each bias field is only
* meaningful when its `_present` flag is `true` - the underlying signal
* wasn't present in the station's stream otherwise, and `_raw` reads `0`.
*/
typedef struct Rtcm3GlonassBias Rtcm3GlonassBias;
/**
* One satellite's data block within a [`Rtcm3GpsMsm7`] message.
*/
typedef struct Rtcm3SatelliteData Rtcm3SatelliteData;
/**
* One satellite/signal cell's data block within a [`Rtcm3GpsMsm7`]
* message.
*/
typedef struct Rtcm3CellData Rtcm3CellData;
/**
* GPS Full Pseudoranges and `PhaseRanges` plus CNR, high resolution
* (type 1077). `num_satellites`/`num_signals`/`num_cells` say how many
* entries of `satellites`/`cells` are meaningful; the rest are unused
* padding, matching the core crate's own mask-derived counts.
*/
typedef struct Rtcm3GpsMsm7 Rtcm3GpsMsm7;
/**
* Decodes a single RTCM3 frame from the start of `buf` (`len` bytes
* long). `buf` may contain trailing bytes after the frame (e.g. the
* start of the next frame in a stream); only the leading frame is
* parsed.
*
* On success, returns a non-NULL handle (free it with
* [`rtcm3_message_free`] when done) and, if `out_error` is non-NULL,
* writes [`Rtcm3FfiError::Ok`] through it. On failure, returns NULL and,
* if `out_error` is non-NULL, writes the reason through it.
*
* # Safety
* `buf` must be NULL or valid for reads of `len` bytes. `out_error` must
* be NULL or a pointer valid for a single write.
*/
struct Rtcm3FfiMessage *;
/**
* Frees a message handle returned by [`rtcm3_decode`]. Passing NULL is a
* no-op.
*
* # Safety
* `msg` must be NULL or a pointer previously returned by [`rtcm3_decode`]
* that has not already been freed.
*/
void ;
/**
* The message's RTCM3 message type (DF002, e.g. `1005` for a Stationary
* RTK Reference Station ARP), or `0xFFFF` for a NULL handle or a variant
* this header doesn't know about yet.
*
* # Safety
* `msg` must be NULL or a valid, non-freed handle from [`rtcm3_decode`].
*/
uint16_t ;
/**
* Reads `msg`'s message as a Stationary RTK Reference Station ARP
* (type 1005) into `out`, returning `true` on a match. Returns `false`
* without writing to `out` if `msg` is NULL or holds a different message
* type.
*
* # Safety
* `msg` must be NULL or a valid, non-freed handle from [`rtcm3_decode`].
* `out` must be a valid write target.
*/
bool ;
/**
* Reads `msg`'s message as a GLONASS Code-Phase Biases message
* (type 1230) into `out`, returning `true` on a match. Returns `false`
* without writing to `out` if `msg` is NULL or holds a different message
* type.
*
* # Safety
* `msg` must be NULL or a valid, non-freed handle from [`rtcm3_decode`].
* `out` must be a valid write target.
*/
bool ;
/**
* Reads `msg`'s message as a GPS MSM7 message (type 1077) into `out`,
* returning `true` on a match. Returns `false` without writing to `out`
* if `msg` is NULL or holds a different message type.
*
* # Safety
* `msg` must be NULL or a valid, non-freed handle from [`rtcm3_decode`].
* `out` must be a valid write target.
*/
bool ;
/**
* This crate's version string, as a NUL-terminated C string with static
* lifetime.
*/
const char *;
/* RTCM3_H */