This repository was archived by the owner on Apr 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpiksi.h
More file actions
364 lines (318 loc) · 11.9 KB
/
piksi.h
File metadata and controls
364 lines (318 loc) · 11.9 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
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
/*
* Copyright (C) 2015-2018 Swift Navigation Inc.
* Contact: Swift Navigation <dev@swiftnav.com>
*
* This source is subject to the license found in the file 'LICENSE' which must
* be 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/piksi.yaml
* with generate.py. Please do not hand edit!
*****************************************************************************/
/** \defgroup piksi Piksi
*
* * System health, configuration, and diagnostic messages specific to
* the Piksi L1 receiver, including a variety of legacy messages that
* may no longer be used.
* \{ */
#ifndef LIBSBP_PIKSI_MESSAGES_H
#define LIBSBP_PIKSI_MESSAGES_H
#include "common.h"
#include "gnss.h"
/** Legacy message to load satellite almanac (host => Piksi)
*
* This is a legacy message for sending and loading a satellite
* alamanac onto the Piksi's flash memory from the host.
*/
#define SBP_MSG_ALMANAC 0x0069
/** Send GPS time from host (host => Piksi)
*
* This message sets up timing functionality using a coarse GPS
* time estimate sent by the host.
*/
#define SBP_MSG_SET_TIME 0x0068
/** Reset the device (host => Piksi)
*
* This message from the host resets the Piksi back into the
* bootloader.
*/
#define SBP_MSG_RESET 0x00B6
typedef struct {
u32 flags; /**< Reset flags */
} msg_reset_t;
/** Reset the device (host => Piksi)
*
* This message from the host resets the Piksi back into the
* bootloader.
*/
#define SBP_MSG_RESET_DEP 0x00B2
/** Legacy message for CW interference channel (Piksi => host)
*
* This is an unused legacy message for result reporting from the
* CW interference channel on the SwiftNAP. This message will be
* removed in a future release.
*/
#define SBP_MSG_CW_RESULTS 0x00C0
/** Legacy message for CW interference channel (host => Piksi)
*
* This is an unused legacy message from the host for starting
* the CW interference channel on the SwiftNAP. This message will
* be removed in a future release.
*/
#define SBP_MSG_CW_START 0x00C1
/** Reset IAR filters (host => Piksi)
*
* This message resets either the DGNSS Kalman filters or Integer
* Ambiguity Resolution (IAR) process.
*/
#define SBP_MSG_RESET_FILTERS 0x0022
typedef struct {
u8 filter; /**< Filter flags */
} msg_reset_filters_t;
/** Initialize IAR from known baseline (host => device)
*
* This message initializes the integer ambiguity resolution (IAR)
* process on the Piksi to use an assumed baseline position between
* the base station and rover receivers. Warns via MSG_PRINT if
* there aren't a shared minimum number (4) of satellite
* observations between the two.
*/
#define SBP_MSG_INIT_BASE 0x0023
/** State of an RTOS thread
*
* The thread usage message from the device reports real-time
* operating system (RTOS) thread usage statistics for the named
* thread. The reported percentage values must be normalized.
*/
#define SBP_MSG_THREAD_STATE 0x0017
typedef struct {
char name[20]; /**< Thread name (NULL terminated) */
u16 cpu; /**< Percentage cpu use for this thread. Values range from 0
- 1000 and needs to be renormalized to 100
*/
u32 stack_free; /**< Free stack space for this thread [bytes] */
} msg_thread_state_t;
/** State of the UART channel
*
* Throughput, utilization, and error counts on the RX/TX buffers
* of this UART channel. The reported percentage values must
* be normalized.
*/
typedef struct {
float tx_throughput; /**< UART transmit throughput [kB/s] */
float rx_throughput; /**< UART receive throughput [kB/s] */
u16 crc_error_count; /**< UART CRC error count */
u16 io_error_count; /**< UART IO error count */
u8 tx_buffer_level; /**< UART transmit buffer percentage utilization (ranges from
0 to 255)
*/
u8 rx_buffer_level; /**< UART receive buffer percentage utilization (ranges from
0 to 255)
*/
} uart_channel_t;
/** base station observation message receipt period
*
* Statistics on the period of observations received from the base
* station. As complete observation sets are received, their time
* of reception is compared with the prior set''s time of reception.
* This measurement provides a proxy for link quality as incomplete
* or missing sets will increase the period. Long periods
* can cause momentary RTK solution outages.
*/
typedef struct {
s32 avg; /**< Average period [ms] */
s32 pmin; /**< Minimum period [ms] */
s32 pmax; /**< Maximum period [ms] */
s32 current; /**< Smoothed estimate of the current period [ms] */
} period_t;
/** Receiver-to-base station latency
*
* Statistics on the latency of observations received from the base
* station. As observation packets are received their GPS time is
* compared to the current GPS time calculated locally by the
* receiver to give a precise measurement of the end-to-end
* communication latency in the system.
*/
typedef struct {
s32 avg; /**< Average latency [ms] */
s32 lmin; /**< Minimum latency [ms] */
s32 lmax; /**< Maximum latency [ms] */
s32 current; /**< Smoothed estimate of the current latency [ms] */
} latency_t;
/** State of the UART channels
*
* The UART message reports data latency and throughput of the UART
* channels providing SBP I/O. On the default Piksi configuration,
* UARTs A and B are used for telemetry radios, but can also be
* host access ports for embedded hosts, or other interfaces in
* future. The reported percentage values must be normalized.
* Observations latency and period can be used to assess the
* health of the differential corrections link. Latency provides
* the timeliness of received base observations while the
* period indicates their likelihood of transmission.
*/
#define SBP_MSG_UART_STATE 0x001D
typedef struct {
uart_channel_t uart_a; /**< State of UART A */
uart_channel_t uart_b; /**< State of UART B */
uart_channel_t uart_ftdi; /**< State of UART FTDI (USB logger) */
latency_t latency; /**< UART communication latency */
period_t obs_period; /**< Observation receipt period */
} msg_uart_state_t;
/** Deprecated
*
* Deprecated
*/
#define SBP_MSG_UART_STATE_DEPA 0x0018
typedef struct {
uart_channel_t uart_a; /**< State of UART A */
uart_channel_t uart_b; /**< State of UART B */
uart_channel_t uart_ftdi; /**< State of UART FTDI (USB logger) */
latency_t latency; /**< UART communication latency */
} msg_uart_state_depa_t;
/** State of the Integer Ambiguity Resolution (IAR) process
*
* This message reports the state of the Integer Ambiguity
* Resolution (IAR) process, which resolves unknown integer
* ambiguities from double-differenced carrier-phase measurements
* from satellite observations.
*/
#define SBP_MSG_IAR_STATE 0x0019
typedef struct {
u32 num_hyps; /**< Number of integer ambiguity hypotheses remaining */
} msg_iar_state_t;
/** Mask a satellite from use in Piksi subsystems
*
* This message allows setting a mask to prevent a particular satellite
* from being used in various Piksi subsystems.
*/
#define SBP_MSG_MASK_SATELLITE 0x002B
typedef struct {
u8 mask; /**< Mask of systems that should ignore this satellite. */
sbp_gnss_signal_t sid; /**< GNSS signal for which the mask is applied */
} msg_mask_satellite_t;
/** Deprecated
*
* Deprecated.
*/
#define SBP_MSG_MASK_SATELLITE_DEP 0x001B
typedef struct {
u8 mask; /**< Mask of systems that should ignore this satellite. */
gnss_signal_dep_t sid; /**< GNSS signal for which the mask is applied */
} msg_mask_satellite_dep_t;
/** Device temperature and voltage levels
*
* This message contains temperature and voltage level measurements from the
* processor's monitoring system and the RF frontend die temperature if
* available.
*/
#define SBP_MSG_DEVICE_MONITOR 0x00B5
typedef struct {
s16 dev_vin; /**< Device V_in [V / 1000] */
s16 cpu_vint; /**< Processor V_int [V / 1000] */
s16 cpu_vaux; /**< Processor V_aux [V / 1000] */
s16 cpu_temperature; /**< Processor temperature [degrees C / 100] */
s16 fe_temperature; /**< Frontend temperature (if available) [degrees C / 100] */
} msg_device_monitor_t;
/** Execute a command (host => device)
*
* Request the recipient to execute an command.
* Output will be sent in MSG_LOG messages, and the exit
* code will be returned with MSG_COMMAND_RESP.
*/
#define SBP_MSG_COMMAND_REQ 0x00B8
typedef struct {
u32 sequence; /**< Sequence number */
char command[0]; /**< Command line to execute */
} msg_command_req_t;
/** Exit code from executed command (device => host)
*
* The response to MSG_COMMAND_REQ with the return code of
* the command. A return code of zero indicates success.
*/
#define SBP_MSG_COMMAND_RESP 0x00B9
typedef struct {
u32 sequence; /**< Sequence number */
s32 code; /**< Exit code */
} msg_command_resp_t;
/** Command output
*
* Returns the standard output and standard error of the
* command requested by MSG_COMMAND_REQ.
* The sequence number can be used to filter for filtering
* the correct command.
*/
#define SBP_MSG_COMMAND_OUTPUT 0x00BC
typedef struct {
u32 sequence; /**< Sequence number */
char line[0]; /**< Line of standard output or standard error */
} msg_command_output_t;
/** Request state of Piksi network interfaces
*
* Request state of Piksi network interfaces.
* Output will be sent in MSG_NETWORK_STATE_RESP messages
*/
#define SBP_MSG_NETWORK_STATE_REQ 0x00BA
/** State of network interface
*
* The state of a network interface on the Piksi.
* Data is made to reflect output of ifaddrs struct returned by getifaddrs
* in c.
*/
#define SBP_MSG_NETWORK_STATE_RESP 0x00BB
typedef struct {
u8 ipv4_address[4]; /**< IPv4 address (all zero when unavailable) */
u8 ipv4_mask_size; /**< IPv4 netmask CIDR notation */
u8 ipv6_address[16]; /**< IPv6 address (all zero when unavailable) */
u8 ipv6_mask_size; /**< IPv6 netmask CIDR notation */
u32 rx_bytes; /**< Number of Rx bytes */
u32 tx_bytes; /**< Number of Tx bytes */
char interface_name[16]; /**< Interface Name */
u32 flags; /**< Interface flags from SIOCGIFFLAGS */
} msg_network_state_resp_t;
/** Deprecated
*
* Deprecated.
*/
#define SBP_MSG_SPECAN_DEP 0x0050
typedef struct {
u16 channel_tag; /**< Channel ID */
gps_time_dep_t t; /**< Receiver time of this observation */
float freq_ref; /**< Reference frequency of this packet
[MHz] */
float freq_step; /**< Frequency step of points in this packet
[MHz] */
float amplitude_ref; /**< Reference amplitude of this packet
[dB] */
float amplitude_unit; /**< Amplitude unit value of points in this packet
[dB] */
u8 amplitude_value
[0]; /**< Amplitude values (in the above units) of points in this packet
*/
} msg_specan_dep_t;
/** Spectrum analyzer
*
* Spectrum analyzer packet.
*/
#define SBP_MSG_SPECAN 0x0051
typedef struct {
u16 channel_tag; /**< Channel ID */
sbp_gps_time_t t; /**< Receiver time of this observation */
float freq_ref; /**< Reference frequency of this packet
[MHz] */
float freq_step; /**< Frequency step of points in this packet
[MHz] */
float amplitude_ref; /**< Reference amplitude of this packet
[dB] */
float amplitude_unit; /**< Amplitude unit value of points in this packet
[dB] */
u8 amplitude_value
[0]; /**< Amplitude values (in the above units) of points in this packet
*/
} msg_specan_t;
/** \} */
#endif /* LIBSBP_PIKSI_MESSAGES_H */