ACwing FC firmware
STM32WB55: attitude IEKF, altitude Kalman filter, flight core, protocol v2
Loading...
Searching...
No Matches
proto_v2.h
Go to the documentation of this file.
1
16#ifndef PROTO_V2_H
17#define PROTO_V2_H
18
19#include <stdint.h>
20#include <stddef.h>
21
22#define PV2_PROTO_VERSION 2u
23#define PV2_CMD_MAX_LEN 20u
24
25/* ---------------- frame types, drone -> app ---------------- */
26#define PV2_FT_STATE 0x01u
27#define PV2_FT_INIT 0x02u
28#define PV2_FT_STATUS 0x03u
29#define PV2_FT_REPLAY 0x04u
30#define PV2_FT_CAPS 0x05u
31#define PV2_FT_FLIGHT 0x06u
32#define PV2_FT_POWER 0x07u
33#define PV2_FT_NAV 0x08u
34#define PV2_FT_MOTORS 0x09u
35#define PV2_FT_SYSTEM 0x0Au
36#define PV2_FT_EVENT 0x0Bu
37#define PV2_FT_PARAM 0x0Cu
38#define PV2_FT_CALIB 0x0Du
39#define PV2_FT_ACK 0x0Eu
40#define PV2_FT_CHECKS 0x0Fu
41/* USB link only (firmware extension, not used by the app over BLE) */
42#define PV2_FT_LOG_ENTRY 0x10u
43#define PV2_FT_LOG_DATA 0x11u
44#define PV2_FT_CMD 0x20u
46/* ---------------- command opcodes, app -> drone ---------------- */
47#define PV2_OP_SEND_INIT 0x01u
48#define PV2_OP_STATE_DECIM 0x02u
49#define PV2_OP_HEARTBEAT 0x10u
50#define PV2_OP_RC 0x11u
51#define PV2_OP_ARM 0x12u
52#define PV2_OP_DISARM 0x13u
53#define PV2_OP_TAKEOFF 0x14u
54#define PV2_OP_LAND 0x15u
55#define PV2_OP_RTH 0x16u
56#define PV2_OP_HOLD 0x17u
57#define PV2_OP_KILL 0x18u
58#define PV2_OP_SET_MODE 0x19u
59#define PV2_OP_PARAM_GET 0x20u
60#define PV2_OP_PARAM_SET 0x21u
61#define PV2_OP_PARAM_SAVE 0x22u
62#define PV2_OP_PARAM_DEFAULTS 0x23u
63#define PV2_OP_PARAM_LIST 0x24u
64#define PV2_OP_CAL_START 0x30u
65#define PV2_OP_CAL_CAPTURE 0x31u
66#define PV2_OP_CAL_ABORT 0x32u
67#define PV2_OP_CAL_SAVE 0x33u
68#define PV2_OP_CAL_RESTORE 0x34u
69#define PV2_OP_CAL_SET_REF 0x35u
70#define PV2_OP_MOTOR_TEST 0x36u
71#define PV2_OP_MOTOR_REVERSE 0x37u
72#define PV2_OP_MOTOR_REMAP 0x38u
73#define PV2_OP_STREAM_RATES 0x40u
74#define PV2_OP_REQUEST 0x41u
75#define PV2_OP_SET_NAME 0x42u
76#define PV2_OP_SET_TIME 0x43u
77#define PV2_OP_LOG_LIST 0x50u
78#define PV2_OP_LOG_READ 0x51u
79#define PV2_OP_LOG_ERASE 0x52u
81#define PV2_ARM_MAGIC0 0xA5u
82#define PV2_ARM_MAGIC1 0x5Au
83#define PV2_PROPS_OFF_MAGIC 0x50u
84/* KILL magic: "KILL" = 4B 49 4C 4C */
85
86/* ---------------- ACK ---------------- */
89
90enum {
99};
100
101/* ---------------- enums and bit masks ---------------- */
106
107#define PV2_FS_APP_LINK (1u << 0)
108#define PV2_FS_RADIO (1u << 1)
109#define PV2_FS_BATTERY (1u << 2)
110#define PV2_FS_GEOFENCE (1u << 3)
111#define PV2_FS_GPS (1u << 4)
112#define PV2_FS_FLOW (1u << 5)
113
114#define PV2_FF_IN_AIR (1u << 0)
115#define PV2_FF_LANDED (1u << 1)
116#define PV2_FF_HOME_SET (1u << 2)
117#define PV2_FF_GEOFENCE_ON (1u << 3)
118#define PV2_FF_BEGINNER (1u << 4)
119#define PV2_FF_ARM_BLOCKED (1u << 5)
120
121#define PV2_S_IMU (1u << 0)
122#define PV2_S_BARO (1u << 1)
123#define PV2_S_MAG_FC (1u << 2)
124#define PV2_S_MAG_GPS (1u << 3)
125#define PV2_S_GNSS (1u << 4)
126#define PV2_S_FLOW (1u << 5)
127#define PV2_S_TOF (1u << 6)
128#define PV2_S_ESC_TLM (1u << 7)
129#define PV2_S_CURRENT (1u << 8)
130#define PV2_S_ELRS (1u << 9)
131#define PV2_S_LEDS (1u << 10)
132#define PV2_S_FLASH_LOG (1u << 11)
133
138
139enum {
151
156
161enum { PV2_CK_OK = 0, PV2_CK_WARN = 1, PV2_CK_FAIL = 2, PV2_CK_NA = 3 };
162
163/* ---------------- payload layouts (little-endian, packed) ----------------
164 * As in telemetry.h: fill float fields through memcpy from aligned locals. */
165#pragma pack(push, 1)
166typedef struct {
167 uint8_t proto;
168 uint8_t fw[3];
169 uint8_t hw_rev;
170 uint8_t model;
171 uint16_t sensors;
172 uint8_t n_motors;
173 uint8_t frame;
174 uint8_t cells;
175 char name[16];
176 char serial[12];
177} pv2_caps_t;
179typedef struct {
180 uint8_t arm, mode, autom, failsafe;
181 uint16_t flags;
182 uint8_t input;
184 int32_t alt_rel_cm;
185 int16_t vz_cms;
187 uint16_t heading_cdeg;
188 uint16_t home_dist_m;
190 uint16_t rth_eta_s;
191} pv2_flight_t;
193typedef struct {
194 uint16_t vbat_mv;
195 int16_t current_ca;
196 uint16_t used_mah;
197 uint8_t cells;
198 uint16_t cell_mv;
199 uint8_t pct;
200 uint16_t remain_s;
201 uint8_t warn;
202} pv2_power_t;
204typedef struct {
205 uint8_t fix;
206 uint8_t sats;
207 uint16_t hdop_x100;
208 int32_t lat_e7, lon_e7;
209 int32_t alt_msl_cm;
210 int16_t vel_ned_cms[3];
211 uint16_t tof_mm;
212 uint8_t flow_q;
213 uint32_t baro_pa;
214 uint16_t wind_cms;
215} pv2_nav_t;
217typedef struct {
218 uint16_t rpm;
219 int8_t temp_c;
220 uint8_t out_pct;
221} pv2_motor_t;
223typedef struct {
224 uint8_t lq;
225 int8_t rssi, snr;
226 uint16_t pkt_rate_hz, tx_power_mw;
227 uint8_t cpu_pct;
228 uint16_t loop_hz, jitter_us;
229 uint8_t log_pct;
230 int16_t imu_temp_cc;
231 uint16_t vibration_mg;
232 uint16_t acc_clip;
233 uint16_t att_unc_cdeg;
234 uint8_t est_flags;
236} pv2_system_t;
238typedef struct {
239 uint8_t level;
240 uint16_t code;
241 int32_t arg;
242 uint8_t len;
245typedef struct {
246 uint16_t id;
247 float value;
248 uint8_t flags;
249 uint16_t index, count;
250} pv2_param_t;
252typedef struct {
253 uint16_t id;
254 uint8_t index, count;
255 uint8_t flags;
256 uint16_t sectors;
257 uint32_t t0_ms;
258 uint32_t bytes;
261typedef struct {
262 uint16_t id;
263 uint32_t offset;
265#define PV2_LOG_DATA_MAX 240u
266
267typedef struct {
268 uint8_t type, state, step, progress, quality, reason;
271typedef struct { uint8_t done_mask, current, still_pct; int16_t offset_mg[3]; uint16_t scale_e4[3]; uint16_t fit_err_x100; } pv2_cal_accel_t;
272typedef struct { int16_t roll_cdeg, pitch_cdeg; uint16_t remaining_ms; int16_t trim_roll_cdeg, trim_pitch_cdeg; } pv2_cal_level_t;
273typedef struct { uint16_t remaining_ms; int16_t bias_mdps[3]; uint16_t noise_mdps; int16_t temp_cc; } pv2_cal_gyro_t;
274typedef struct { uint8_t coverage[5]; uint8_t interf_fc, interf_gps, quality_fc, quality_gps; } pv2_cal_compass_t;
275typedef struct { uint16_t tof_mm, height_mm; uint8_t flow_q, match_pct, axes_done; uint16_t scale_x_e4, scale_y_e4; int16_t tof_offset_mm; } pv2_cal_flow_t;
276typedef struct { uint16_t vbat_mv, scale_v_x10, scale_i_e4, used_mah; } pv2_cal_battery_t;
277typedef struct { uint8_t motor, spinning, rev_mask, ok_mask; } pv2_cal_motors_t;
278typedef struct { uint16_t centre[4], min[4], max[4]; uint8_t aux_pos[4]; } pv2_cal_sticks_t;
280typedef struct {
281 uint8_t op, seq, result, reason;
282} pv2_ack_t;
284typedef struct {
285 uint8_t id, state;
286 int16_t value;
287} pv2_check_t;
288#pragma pack(pop)
289
290#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L)
291_Static_assert(sizeof(pv2_caps_t) == 39, "CAPS layout");
292_Static_assert(sizeof(pv2_flight_t) == 25, "FLIGHT layout");
293_Static_assert(sizeof(pv2_power_t) == 13, "POWER layout");
294_Static_assert(sizeof(pv2_nav_t) == 31, "NAV layout");
295_Static_assert(sizeof(pv2_motor_t) == 4, "MOTORS entry layout");
296_Static_assert(sizeof(pv2_system_t) == 23, "SYSTEM layout");
297_Static_assert(sizeof(pv2_event_hdr_t) == 8, "EVENT header layout");
298_Static_assert(sizeof(pv2_param_t) == 11, "PARAM layout");
299_Static_assert(sizeof(pv2_calib_hdr_t) == 6, "CALIB header layout");
300_Static_assert(sizeof(pv2_cal_accel_t) == 17, "CALIB accel layout");
301_Static_assert(sizeof(pv2_cal_level_t) == 10, "CALIB level layout");
302_Static_assert(sizeof(pv2_cal_gyro_t) == 12, "CALIB gyro layout");
303_Static_assert(sizeof(pv2_cal_compass_t) == 9, "CALIB compass layout");
304_Static_assert(sizeof(pv2_cal_flow_t) == 13, "CALIB flow layout");
305_Static_assert(sizeof(pv2_cal_battery_t) == 8, "CALIB battery layout");
306_Static_assert(sizeof(pv2_cal_motors_t) == 4, "CALIB motors layout");
307_Static_assert(sizeof(pv2_cal_sticks_t) == 28, "CALIB sticks layout");
308_Static_assert(sizeof(pv2_ack_t) == 4, "ACK layout");
309_Static_assert(sizeof(pv2_check_t) == 4, "CHECKS item layout");
310_Static_assert(sizeof(pv2_log_entry_t) == 15, "LOG_ENTRY layout");
311_Static_assert(sizeof(pv2_log_data_hdr_t) == 6, "LOG_DATA layout");
312#endif
313
314#define PV2_EVENT_TEXT_MAX 40u
315#define PV2_CHECKS_MAX 12u
316#define PV2_MOTORS_MAX 8u
317#define PV2_PAYLOAD_MAX (2u + 4u * PV2_CHECKS_MAX)
318/* ---------------- encoders: payload -> complete frame (A5 5A ... CRC) ----------------
319 * Each returns the frame length, 0 if cap is too small. */
320size_t pv2_frame(uint8_t type, const void *payload, uint8_t len, uint8_t *out, size_t cap);
321size_t pv2_event(uint8_t level, uint16_t code, int32_t arg, const char *text, uint8_t *out, size_t cap);
322size_t pv2_ack(uint8_t op, uint8_t seq, uint8_t result, uint8_t reason, uint8_t *out, size_t cap);
323size_t pv2_param(uint16_t id, float value, uint8_t flags, uint16_t index, uint16_t count, uint8_t *out, size_t cap);
324size_t pv2_checks(uint8_t ready, const pv2_check_t *items, uint8_t n, uint8_t *out, size_t cap);
325size_t pv2_motors(const pv2_motor_t *m, uint8_t n, uint8_t *out, size_t cap);
326size_t pv2_calib(const pv2_calib_hdr_t *h, const void *data, uint8_t data_len, uint8_t *out, size_t cap);
327
329static inline uint16_t pv2_rd_u16(const uint8_t *p) { return (uint16_t)(p[0] | ((uint16_t)p[1] << 8)); }
330static inline int16_t pv2_rd_i16(const uint8_t *p) { return (int16_t)pv2_rd_u16(p); }
331float pv2_rd_f32(const uint8_t *p);
332
333#endif /* PROTO_V2_H */
uint32_t n
Definition calib_mgr.c:35
float cap[6][3]
Definition calib_mgr.c:36
uint8_t still_pct
Definition calib_mgr.c:34
uint8_t done_mask
Definition calib_mgr.c:34
static void result(const fc_cmd_t *c, uint8_t res, uint8_t why)
Definition fc_core.c:224
uint8_t seq
Definition log_task.c:48
@ PV2_ACK_UNSUPPORTED
Definition proto_v2.h:88
@ PV2_ACK_BUSY
Definition proto_v2.h:87
@ PV2_ACK_OK
Definition proto_v2.h:87
@ PV2_ACK_IN_PROGRESS
Definition proto_v2.h:88
@ PV2_ACK_INVALID
Definition proto_v2.h:87
@ PV2_ACK_REJECTED
Definition proto_v2.h:87
static uint16_t pv2_rd_u16(const uint8_t *p)
little-endian readers for command payloads (unaligned-safe)
Definition proto_v2.h:329
size_t pv2_calib(const pv2_calib_hdr_t *h, const void *data, uint8_t data_len, uint8_t *out, size_t cap)
Definition proto_v2.c:60
size_t pv2_event(uint8_t level, uint16_t code, int32_t arg, const char *text, uint8_t *out, size_t cap)
Definition proto_v2.c:14
@ PV2_R_NONE
Definition proto_v2.h:91
@ PV2_R_NOT_OVER_USB
flight command received over the USB link: ground link only
Definition proto_v2.h:97
@ PV2_R_CHECKS_FAILING
Definition proto_v2.h:91
@ PV2_R_SENSOR_MISSING
Definition proto_v2.h:95
@ PV2_R_NOT_LANDED
Definition proto_v2.h:91
@ PV2_R_UNKNOWN_PARAM
Definition proto_v2.h:95
@ PV2_R_ARMED
Definition proto_v2.h:93
@ PV2_R_USB_CONNECTED
ARM / TAKEOFF / MOTOR_TEST while a USB host is connected (ADR 0009)
Definition proto_v2.h:96
@ PV2_R_CALIBRATING
Definition proto_v2.h:93
@ PV2_R_NO_GPS
Definition proto_v2.h:92
@ PV2_R_NOT_CALIBRATING
Definition proto_v2.h:94
@ PV2_R_OTHER_LINK
configuration change from the link that does not have control
Definition proto_v2.h:98
@ PV2_R_OUT_OF_RANGE
Definition proto_v2.h:94
@ PV2_R_NO_HOME
Definition proto_v2.h:92
@ PV2_R_NOT_ARMED
Definition proto_v2.h:93
@ PV2_R_NOT_STILL
Definition proto_v2.h:94
@ PV2_R_BATTERY_LOW
Definition proto_v2.h:92
@ PV2_R_THROTTLE_NOT_LOW
Definition proto_v2.h:91
@ PV2_R_PROPS_CONFIRM_MISSING
Definition proto_v2.h:93
@ PV2_R_RADIO_OVERRIDE
Definition proto_v2.h:92
size_t pv2_ack(uint8_t op, uint8_t seq, uint8_t result, uint8_t reason, uint8_t *out, size_t cap)
Definition proto_v2.c:26
@ PV2_E_MODE_CHANGED
Definition proto_v2.h:141
@ PV2_E_MOTOR_HOT
Definition proto_v2.h:147
@ PV2_E_DISARMED
Definition proto_v2.h:140
@ PV2_E_CALIB_DONE
Definition proto_v2.h:148
@ PV2_E_TAKEOFF_STARTED
Definition proto_v2.h:140
@ PV2_E_PARAMS_SAVED
Definition proto_v2.h:149
@ PV2_E_FAILSAFE_RADIO
Definition proto_v2.h:143
@ PV2_E_RTH_STARTED
Definition proto_v2.h:141
@ PV2_E_RADIO_OVERRIDE
Definition proto_v2.h:148
@ PV2_E_BATTERY_EMERGENCY
Definition proto_v2.h:145
@ PV2_E_FAILSAFE_BATTERY
Definition proto_v2.h:143
@ PV2_E_TAKEOFF_ABORTED
firmware extension (WARN): no lift-off; the app shows the text
Definition proto_v2.h:142
@ PV2_E_BATTERY_LOW
Definition proto_v2.h:145
@ PV2_E_HOME_SET
Definition proto_v2.h:141
@ PV2_E_HIGH_VIBRATION
Definition proto_v2.h:147
@ PV2_E_MAG_INTERFERENCE
Definition proto_v2.h:147
@ PV2_E_FAILSAFE_APP_LINK
Definition proto_v2.h:143
@ PV2_E_LANDED
Definition proto_v2.h:140
@ PV2_E_BATTERY_MONITOR_LOST
firmware extension (ERROR): BattTask silent, battery unknown
Definition proto_v2.h:146
@ PV2_E_BATTERY_CRITICAL
Definition proto_v2.h:145
@ PV2_E_ARMED
Definition proto_v2.h:140
@ PV2_E_FLOW_LOST
Definition proto_v2.h:144
@ PV2_E_MOTOR_KILLED
Definition proto_v2.h:149
@ PV2_E_CALIB_FAILED
Definition proto_v2.h:148
@ PV2_E_GPS_LOST
Definition proto_v2.h:144
@ PV2_E_GEOFENCE_BREACH
Definition proto_v2.h:144
float pv2_rd_f32(const uint8_t *p)
Definition proto_v2.c:69
@ PV2_MODEL_OUTDOOR
Definition proto_v2.h:134
@ PV2_MODEL_INDOOR
Definition proto_v2.h:134
@ PV2_CK_FAIL
Definition proto_v2.h:161
@ PV2_CK_WARN
Definition proto_v2.h:161
@ PV2_CK_OK
Definition proto_v2.h:161
@ PV2_CK_NA
Definition proto_v2.h:161
@ PV2_INPUT_ELRS
Definition proto_v2.h:105
@ PV2_INPUT_NONE
Definition proto_v2.h:105
@ PV2_INPUT_APP
Definition proto_v2.h:105
@ PV2_CS_WAITING_USER
Definition proto_v2.h:154
@ PV2_CS_RUNNING
Definition proto_v2.h:154
@ PV2_CS_IDLE
Definition proto_v2.h:154
@ PV2_CS_DONE
Definition proto_v2.h:154
@ PV2_CS_SAVED
Definition proto_v2.h:155
@ PV2_CS_FAILED
Definition proto_v2.h:155
size_t pv2_param(uint16_t id, float value, uint8_t flags, uint16_t index, uint16_t count, uint8_t *out, size_t cap)
Definition proto_v2.c:32
size_t pv2_motors(const pv2_motor_t *m, uint8_t n, uint8_t *out, size_t cap)
Definition proto_v2.c:51
static int16_t pv2_rd_i16(const uint8_t *p)
Definition proto_v2.h:330
@ PV2_EV_INFO
Definition proto_v2.h:137
@ PV2_EV_WARN
Definition proto_v2.h:137
@ PV2_EV_ERROR
Definition proto_v2.h:137
@ PV2_EV_CRITICAL
Definition proto_v2.h:137
@ PV2_AUTO_NONE
Definition proto_v2.h:103
@ PV2_AUTO_TAKEOFF
Definition proto_v2.h:103
@ PV2_AUTO_LAND
Definition proto_v2.h:103
@ PV2_AUTO_RTH
Definition proto_v2.h:103
@ PV2_AUTO_FAILSAFE
Definition proto_v2.h:104
@ PV2_AUTO_HOLD
Definition proto_v2.h:104
size_t pv2_frame(uint8_t type, const void *payload, uint8_t len, uint8_t *out, size_t cap)
Definition proto_v2.c:9
@ PV2_CAL_COMPASS
Definition proto_v2.h:152
@ PV2_CAL_STICKS
Definition proto_v2.h:153
@ PV2_CAL_BATTERY
Definition proto_v2.h:153
@ PV2_CAL_FLOW_TOF
Definition proto_v2.h:153
@ PV2_CAL_MOTORS
Definition proto_v2.h:153
@ PV2_CAL_ACCEL
Definition proto_v2.h:152
@ PV2_CAL_GYRO
Definition proto_v2.h:152
@ PV2_CAL_LEVEL
Definition proto_v2.h:152
@ PV2_MODE_POS_HOLD
Definition proto_v2.h:102
@ PV2_MODE_ACRO
Definition proto_v2.h:102
@ PV2_MODE_ANGLE
Definition proto_v2.h:102
@ PV2_MODE_ALT_HOLD
Definition proto_v2.h:102
size_t pv2_checks(uint8_t ready, const pv2_check_t *items, uint8_t n, uint8_t *out, size_t cap)
Definition proto_v2.c:41
@ PV2_BATT_OK
Definition proto_v2.h:136
@ PV2_BATT_LOW
Definition proto_v2.h:136
@ PV2_BATT_EMERGENCY
Definition proto_v2.h:136
@ PV2_BATT_CRITICAL
Definition proto_v2.h:136
@ PV2_CHK_CALIBRATION
Definition proto_v2.h:159
@ PV2_CHK_BATTERY
Definition proto_v2.h:157
@ PV2_CHK_HOME
Definition proto_v2.h:158
@ PV2_CHK_FLOW
Definition proto_v2.h:159
@ PV2_CHK_THROTTLE
Definition proto_v2.h:159
@ PV2_CHK_COMPASS
Definition proto_v2.h:157
@ PV2_CHK_EKF
Definition proto_v2.h:158
@ PV2_CHK_FAILSAFE
Definition proto_v2.h:158
@ PV2_CHK_IMU
Definition proto_v2.h:157
@ PV2_CHK_GNSS
Definition proto_v2.h:157
@ PV2_CHK_RADIO
Definition proto_v2.h:158
@ PV2_CHK_USB
FAIL while a USB host is connected: no ARM.
Definition proto_v2.h:160
@ PV2_FRAME_QUAD_X
Definition proto_v2.h:135
@ PV2_FRAME_HEXA_X
Definition proto_v2.h:135
@ PV2_FRAME_OCTO_X
Definition proto_v2.h:135
uint8_t op
< 0x0E ACK
Definition proto_v2.h:281
uint8_t current
Definition proto_v2.h:271
uint16_t scale_i_e4
Definition proto_v2.h:276
uint8_t axes_done
Definition proto_v2.h:275
int16_t pitch_cdeg
Definition proto_v2.h:272
uint8_t progress
Definition proto_v2.h:268
uint8_t hw_rev
ASCII letter.
Definition proto_v2.h:169
uint8_t cells
Definition proto_v2.h:174
uint8_t frame
Definition proto_v2.h:173
uint8_t n_motors
Definition proto_v2.h:172
uint8_t proto
< 0x05 CAPS
Definition proto_v2.h:167
uint8_t model
Definition proto_v2.h:170
uint16_t sensors
Definition proto_v2.h:171
uint8_t id
< 0x0F CHECKS item (after ready u8, n u8)
Definition proto_v2.h:285
int16_t value
Definition proto_v2.h:286
uint16_t code
Definition proto_v2.h:240
uint8_t level
< 0x0B EVENT header, then text[len]
Definition proto_v2.h:239
uint16_t flags
Definition proto_v2.h:181
uint16_t flight_time_s
Definition proto_v2.h:183
uint16_t heading_cdeg
Definition proto_v2.h:187
int32_t alt_rel_cm
Definition proto_v2.h:184
int16_t vz_cms
Definition proto_v2.h:185
uint16_t ground_speed_cms
Definition proto_v2.h:186
uint8_t input
Definition proto_v2.h:182
uint8_t arm
< 0x06 FLIGHT
Definition proto_v2.h:180
uint16_t home_bearing_cdeg
Definition proto_v2.h:189
uint16_t home_dist_m
0xFFFF n/a
Definition proto_v2.h:188
uint16_t rth_eta_s
0xFFFF n/a
Definition proto_v2.h:190
uint16_t id
< 0x11 LOG_DATA header (USB), then data
Definition proto_v2.h:262
Definition proto_v2.h:252
uint32_t bytes
sectors × 4096
Definition proto_v2.h:258
uint8_t flags
bit0 truncated (oldest, beginning overwritten), bit1 being written
Definition proto_v2.h:255
uint16_t sectors
Definition proto_v2.h:256
uint32_t t0_ms
uptime when the log started
Definition proto_v2.h:257
uint16_t id
< 0x10 LOG_ENTRY (USB)
Definition proto_v2.h:253
uint8_t count
position in the list, list size
Definition proto_v2.h:254
int8_t temp_c
-128 n/a
Definition proto_v2.h:219
uint8_t out_pct
Definition proto_v2.h:220
uint16_t rpm
< 0x09 MOTORS, one entry (after n u8)
Definition proto_v2.h:218
int32_t lat_e7
Definition proto_v2.h:208
uint8_t sats
Definition proto_v2.h:206
int32_t alt_msl_cm
Definition proto_v2.h:209
uint8_t flow_q
0xFF n/a
Definition proto_v2.h:212
uint16_t wind_cms
0xFFFF n/a
Definition proto_v2.h:214
uint16_t tof_mm
0xFFFF n/a
Definition proto_v2.h:211
uint16_t hdop_x100
Definition proto_v2.h:207
uint32_t baro_pa
Definition proto_v2.h:213
uint8_t fix
< 0x08 NAV
Definition proto_v2.h:205
uint8_t flags
bit0 dirty (RAM != flash), bit1 read-only
Definition proto_v2.h:248
float value
Definition proto_v2.h:247
uint16_t count
Definition proto_v2.h:249
uint16_t id
< 0x0C PARAM
Definition proto_v2.h:246
uint16_t vbat_mv
< 0x07 POWER
Definition proto_v2.h:194
uint16_t remain_s
0xFFFF n/a
Definition proto_v2.h:200
uint16_t cell_mv
Definition proto_v2.h:198
uint8_t warn
Definition proto_v2.h:201
uint16_t used_mah
Definition proto_v2.h:196
uint8_t cells
Definition proto_v2.h:197
uint8_t pct
Definition proto_v2.h:199
int16_t current_ca
Definition proto_v2.h:195
int16_t imu_temp_cc
Definition proto_v2.h:230
uint16_t acc_clip
Definition proto_v2.h:232
uint8_t mag_interf_pct
Definition proto_v2.h:235
uint16_t jitter_us
Definition proto_v2.h:228
uint16_t pkt_rate_hz
Definition proto_v2.h:226
uint16_t att_unc_cdeg
Definition proto_v2.h:233
uint8_t cpu_pct
Definition proto_v2.h:227
uint16_t vibration_mg
Definition proto_v2.h:231
int8_t rssi
Definition proto_v2.h:225
uint8_t est_flags
bit0 EKF ok, bit1 acc gated, bit2 mag gated, bit3 mag interference
Definition proto_v2.h:234
uint8_t lq
< 0x0A SYSTEM
Definition proto_v2.h:224
uint8_t log_pct
Definition proto_v2.h:229