RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_sys_status.h
1#pragma once
2// MESSAGE SYS_STATUS PACKING
3
4#define MAVLINK_MSG_ID_SYS_STATUS 1
5
6MAVPACKED(
7typedef struct __mavlink_sys_status_t {
8 uint32_t onboard_control_sensors_present; /*< Bitmask showing which onboard controllers and sensors are present. Value of 0: not present. Value of 1: present. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/
9 uint32_t onboard_control_sensors_enabled; /*< Bitmask showing which onboard controllers and sensors are enabled: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/
10 uint32_t onboard_control_sensors_health; /*< Bitmask showing which onboard controllers and sensors are operational or have an error: Value of 0: not enabled. Value of 1: enabled. Indices defined by ENUM MAV_SYS_STATUS_SENSOR*/
11 uint16_t load; /*< Maximum usage in percent of the mainloop time, (0%: 0, 100%: 1000) should be always below 1000*/
12 uint16_t voltage_battery; /*< Battery voltage, in millivolts (1 = 1 millivolt)*/
13 int16_t current_battery; /*< Battery current, in 10*milliamperes (1 = 10 milliampere), -1: autopilot does not measure the current*/
14 uint16_t drop_rate_comm; /*< Communication drops in percent, (0%: 0, 100%: 10'000), (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/
15 uint16_t errors_comm; /*< Communication errors (UART, I2C, SPI, CAN), dropped packets on all links (packets that were corrupted on reception on the MAV)*/
16 uint16_t errors_count1; /*< Autopilot-specific errors*/
17 uint16_t errors_count2; /*< Autopilot-specific errors*/
18 uint16_t errors_count3; /*< Autopilot-specific errors*/
19 uint16_t errors_count4; /*< Autopilot-specific errors*/
20 int8_t battery_remaining; /*< Remaining battery energy: (0%: 0, 100%: 100), -1: autopilot estimate the remaining battery*/
21}) mavlink_sys_status_t;
22
23#define MAVLINK_MSG_ID_SYS_STATUS_LEN 31
24#define MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN 31
25#define MAVLINK_MSG_ID_1_LEN 31
26#define MAVLINK_MSG_ID_1_MIN_LEN 31
27
28#define MAVLINK_MSG_ID_SYS_STATUS_CRC 124
29#define MAVLINK_MSG_ID_1_CRC 124
30
31
32
33#if MAVLINK_COMMAND_24BIT
34#define MAVLINK_MESSAGE_INFO_SYS_STATUS { \
35 1, \
36 "SYS_STATUS", \
37 13, \
38 { { "onboard_control_sensors_present", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_sys_status_t, onboard_control_sensors_present) }, \
39 { "onboard_control_sensors_enabled", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_sys_status_t, onboard_control_sensors_enabled) }, \
40 { "onboard_control_sensors_health", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_sys_status_t, onboard_control_sensors_health) }, \
41 { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \
42 { "voltage_battery", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sys_status_t, voltage_battery) }, \
43 { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_sys_status_t, current_battery) }, \
44 { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \
45 { "drop_rate_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sys_status_t, drop_rate_comm) }, \
46 { "errors_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sys_status_t, errors_comm) }, \
47 { "errors_count1", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sys_status_t, errors_count1) }, \
48 { "errors_count2", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sys_status_t, errors_count2) }, \
49 { "errors_count3", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sys_status_t, errors_count3) }, \
50 { "errors_count4", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sys_status_t, errors_count4) }, \
51 } \
52}
53#else
54#define MAVLINK_MESSAGE_INFO_SYS_STATUS { \
55 "SYS_STATUS", \
56 13, \
57 { { "onboard_control_sensors_present", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_sys_status_t, onboard_control_sensors_present) }, \
58 { "onboard_control_sensors_enabled", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_sys_status_t, onboard_control_sensors_enabled) }, \
59 { "onboard_control_sensors_health", "0x%04x", MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_sys_status_t, onboard_control_sensors_health) }, \
60 { "load", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_sys_status_t, load) }, \
61 { "voltage_battery", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_sys_status_t, voltage_battery) }, \
62 { "current_battery", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_sys_status_t, current_battery) }, \
63 { "battery_remaining", NULL, MAVLINK_TYPE_INT8_T, 0, 30, offsetof(mavlink_sys_status_t, battery_remaining) }, \
64 { "drop_rate_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_sys_status_t, drop_rate_comm) }, \
65 { "errors_comm", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_sys_status_t, errors_comm) }, \
66 { "errors_count1", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_sys_status_t, errors_count1) }, \
67 { "errors_count2", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_sys_status_t, errors_count2) }, \
68 { "errors_count3", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_sys_status_t, errors_count3) }, \
69 { "errors_count4", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_sys_status_t, errors_count4) }, \
70 } \
71}
72#endif
73
95static inline uint16_t mavlink_msg_sys_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
96 uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4)
97{
98#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
99 char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN];
100 _mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
101 _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
102 _mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
103 _mav_put_uint16_t(buf, 12, load);
104 _mav_put_uint16_t(buf, 14, voltage_battery);
105 _mav_put_int16_t(buf, 16, current_battery);
106 _mav_put_uint16_t(buf, 18, drop_rate_comm);
107 _mav_put_uint16_t(buf, 20, errors_comm);
108 _mav_put_uint16_t(buf, 22, errors_count1);
109 _mav_put_uint16_t(buf, 24, errors_count2);
110 _mav_put_uint16_t(buf, 26, errors_count3);
111 _mav_put_uint16_t(buf, 28, errors_count4);
112 _mav_put_int8_t(buf, 30, battery_remaining);
113
114 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN);
115#else
116 mavlink_sys_status_t packet;
117 packet.onboard_control_sensors_present = onboard_control_sensors_present;
118 packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled;
119 packet.onboard_control_sensors_health = onboard_control_sensors_health;
120 packet.load = load;
121 packet.voltage_battery = voltage_battery;
122 packet.current_battery = current_battery;
123 packet.drop_rate_comm = drop_rate_comm;
124 packet.errors_comm = errors_comm;
125 packet.errors_count1 = errors_count1;
126 packet.errors_count2 = errors_count2;
127 packet.errors_count3 = errors_count3;
128 packet.errors_count4 = errors_count4;
129 packet.battery_remaining = battery_remaining;
130
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN);
132#endif
133
134 msg->msgid = MAVLINK_MSG_ID_SYS_STATUS;
135 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
136}
137
159static inline uint16_t mavlink_msg_sys_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
160 mavlink_message_t* msg,
161 uint32_t onboard_control_sensors_present,uint32_t onboard_control_sensors_enabled,uint32_t onboard_control_sensors_health,uint16_t load,uint16_t voltage_battery,int16_t current_battery,int8_t battery_remaining,uint16_t drop_rate_comm,uint16_t errors_comm,uint16_t errors_count1,uint16_t errors_count2,uint16_t errors_count3,uint16_t errors_count4)
162{
163#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
164 char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN];
165 _mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
166 _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
167 _mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
168 _mav_put_uint16_t(buf, 12, load);
169 _mav_put_uint16_t(buf, 14, voltage_battery);
170 _mav_put_int16_t(buf, 16, current_battery);
171 _mav_put_uint16_t(buf, 18, drop_rate_comm);
172 _mav_put_uint16_t(buf, 20, errors_comm);
173 _mav_put_uint16_t(buf, 22, errors_count1);
174 _mav_put_uint16_t(buf, 24, errors_count2);
175 _mav_put_uint16_t(buf, 26, errors_count3);
176 _mav_put_uint16_t(buf, 28, errors_count4);
177 _mav_put_int8_t(buf, 30, battery_remaining);
178
179 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SYS_STATUS_LEN);
180#else
181 mavlink_sys_status_t packet;
182 packet.onboard_control_sensors_present = onboard_control_sensors_present;
183 packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled;
184 packet.onboard_control_sensors_health = onboard_control_sensors_health;
185 packet.load = load;
186 packet.voltage_battery = voltage_battery;
187 packet.current_battery = current_battery;
188 packet.drop_rate_comm = drop_rate_comm;
189 packet.errors_comm = errors_comm;
190 packet.errors_count1 = errors_count1;
191 packet.errors_count2 = errors_count2;
192 packet.errors_count3 = errors_count3;
193 packet.errors_count4 = errors_count4;
194 packet.battery_remaining = battery_remaining;
195
196 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SYS_STATUS_LEN);
197#endif
198
199 msg->msgid = MAVLINK_MSG_ID_SYS_STATUS;
200 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
201}
202
211static inline uint16_t mavlink_msg_sys_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_sys_status_t* sys_status)
212{
213 return mavlink_msg_sys_status_pack(system_id, component_id, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4);
214}
215
225static inline uint16_t mavlink_msg_sys_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_sys_status_t* sys_status)
226{
227 return mavlink_msg_sys_status_pack_chan(system_id, component_id, chan, msg, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4);
228}
229
248#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
249
250static inline void mavlink_msg_sys_status_send(mavlink_channel_t chan, uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4)
251{
252#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
253 char buf[MAVLINK_MSG_ID_SYS_STATUS_LEN];
254 _mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
255 _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
256 _mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
257 _mav_put_uint16_t(buf, 12, load);
258 _mav_put_uint16_t(buf, 14, voltage_battery);
259 _mav_put_int16_t(buf, 16, current_battery);
260 _mav_put_uint16_t(buf, 18, drop_rate_comm);
261 _mav_put_uint16_t(buf, 20, errors_comm);
262 _mav_put_uint16_t(buf, 22, errors_count1);
263 _mav_put_uint16_t(buf, 24, errors_count2);
264 _mav_put_uint16_t(buf, 26, errors_count3);
265 _mav_put_uint16_t(buf, 28, errors_count4);
266 _mav_put_int8_t(buf, 30, battery_remaining);
267
268 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
269#else
270 mavlink_sys_status_t packet;
271 packet.onboard_control_sensors_present = onboard_control_sensors_present;
272 packet.onboard_control_sensors_enabled = onboard_control_sensors_enabled;
273 packet.onboard_control_sensors_health = onboard_control_sensors_health;
274 packet.load = load;
275 packet.voltage_battery = voltage_battery;
276 packet.current_battery = current_battery;
277 packet.drop_rate_comm = drop_rate_comm;
278 packet.errors_comm = errors_comm;
279 packet.errors_count1 = errors_count1;
280 packet.errors_count2 = errors_count2;
281 packet.errors_count3 = errors_count3;
282 packet.errors_count4 = errors_count4;
283 packet.battery_remaining = battery_remaining;
284
285 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
286#endif
287}
288
294static inline void mavlink_msg_sys_status_send_struct(mavlink_channel_t chan, const mavlink_sys_status_t* sys_status)
295{
296#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
297 mavlink_msg_sys_status_send(chan, sys_status->onboard_control_sensors_present, sys_status->onboard_control_sensors_enabled, sys_status->onboard_control_sensors_health, sys_status->load, sys_status->voltage_battery, sys_status->current_battery, sys_status->battery_remaining, sys_status->drop_rate_comm, sys_status->errors_comm, sys_status->errors_count1, sys_status->errors_count2, sys_status->errors_count3, sys_status->errors_count4);
298#else
299 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)sys_status, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
300#endif
301}
302
303#if MAVLINK_MSG_ID_SYS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
304/*
305 This varient of _send() can be used to save stack space by re-using
306 memory from the receive buffer. The caller provides a
307 mavlink_message_t which is the size of a full mavlink message. This
308 is usually the receive buffer for the channel, and allows a reply to an
309 incoming message with minimum stack space usage.
310 */
311static inline void mavlink_msg_sys_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t onboard_control_sensors_present, uint32_t onboard_control_sensors_enabled, uint32_t onboard_control_sensors_health, uint16_t load, uint16_t voltage_battery, int16_t current_battery, int8_t battery_remaining, uint16_t drop_rate_comm, uint16_t errors_comm, uint16_t errors_count1, uint16_t errors_count2, uint16_t errors_count3, uint16_t errors_count4)
312{
313#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
314 char *buf = (char *)msgbuf;
315 _mav_put_uint32_t(buf, 0, onboard_control_sensors_present);
316 _mav_put_uint32_t(buf, 4, onboard_control_sensors_enabled);
317 _mav_put_uint32_t(buf, 8, onboard_control_sensors_health);
318 _mav_put_uint16_t(buf, 12, load);
319 _mav_put_uint16_t(buf, 14, voltage_battery);
320 _mav_put_int16_t(buf, 16, current_battery);
321 _mav_put_uint16_t(buf, 18, drop_rate_comm);
322 _mav_put_uint16_t(buf, 20, errors_comm);
323 _mav_put_uint16_t(buf, 22, errors_count1);
324 _mav_put_uint16_t(buf, 24, errors_count2);
325 _mav_put_uint16_t(buf, 26, errors_count3);
326 _mav_put_uint16_t(buf, 28, errors_count4);
327 _mav_put_int8_t(buf, 30, battery_remaining);
328
329 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, buf, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
330#else
331 mavlink_sys_status_t *packet = (mavlink_sys_status_t *)msgbuf;
332 packet->onboard_control_sensors_present = onboard_control_sensors_present;
333 packet->onboard_control_sensors_enabled = onboard_control_sensors_enabled;
334 packet->onboard_control_sensors_health = onboard_control_sensors_health;
335 packet->load = load;
336 packet->voltage_battery = voltage_battery;
337 packet->current_battery = current_battery;
338 packet->drop_rate_comm = drop_rate_comm;
339 packet->errors_comm = errors_comm;
340 packet->errors_count1 = errors_count1;
341 packet->errors_count2 = errors_count2;
342 packet->errors_count3 = errors_count3;
343 packet->errors_count4 = errors_count4;
344 packet->battery_remaining = battery_remaining;
345
346 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SYS_STATUS, (const char *)packet, MAVLINK_MSG_ID_SYS_STATUS_MIN_LEN, MAVLINK_MSG_ID_SYS_STATUS_LEN, MAVLINK_MSG_ID_SYS_STATUS_CRC);
347#endif
348}
349#endif
350
351#endif
352
353// MESSAGE SYS_STATUS UNPACKING
354
355
361static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_present(const mavlink_message_t* msg)
362{
363 return _MAV_RETURN_uint32_t(msg, 0);
364}
365
371static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_enabled(const mavlink_message_t* msg)
372{
373 return _MAV_RETURN_uint32_t(msg, 4);
374}
375
381static inline uint32_t mavlink_msg_sys_status_get_onboard_control_sensors_health(const mavlink_message_t* msg)
382{
383 return _MAV_RETURN_uint32_t(msg, 8);
384}
385
391static inline uint16_t mavlink_msg_sys_status_get_load(const mavlink_message_t* msg)
392{
393 return _MAV_RETURN_uint16_t(msg, 12);
394}
395
401static inline uint16_t mavlink_msg_sys_status_get_voltage_battery(const mavlink_message_t* msg)
402{
403 return _MAV_RETURN_uint16_t(msg, 14);
404}
405
411static inline int16_t mavlink_msg_sys_status_get_current_battery(const mavlink_message_t* msg)
412{
413 return _MAV_RETURN_int16_t(msg, 16);
414}
415
421static inline int8_t mavlink_msg_sys_status_get_battery_remaining(const mavlink_message_t* msg)
422{
423 return _MAV_RETURN_int8_t(msg, 30);
424}
425
431static inline uint16_t mavlink_msg_sys_status_get_drop_rate_comm(const mavlink_message_t* msg)
432{
433 return _MAV_RETURN_uint16_t(msg, 18);
434}
435
441static inline uint16_t mavlink_msg_sys_status_get_errors_comm(const mavlink_message_t* msg)
442{
443 return _MAV_RETURN_uint16_t(msg, 20);
444}
445
451static inline uint16_t mavlink_msg_sys_status_get_errors_count1(const mavlink_message_t* msg)
452{
453 return _MAV_RETURN_uint16_t(msg, 22);
454}
455
461static inline uint16_t mavlink_msg_sys_status_get_errors_count2(const mavlink_message_t* msg)
462{
463 return _MAV_RETURN_uint16_t(msg, 24);
464}
465
471static inline uint16_t mavlink_msg_sys_status_get_errors_count3(const mavlink_message_t* msg)
472{
473 return _MAV_RETURN_uint16_t(msg, 26);
474}
475
481static inline uint16_t mavlink_msg_sys_status_get_errors_count4(const mavlink_message_t* msg)
482{
483 return _MAV_RETURN_uint16_t(msg, 28);
484}
485
492static inline void mavlink_msg_sys_status_decode(const mavlink_message_t* msg, mavlink_sys_status_t* sys_status)
493{
494#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
495 sys_status->onboard_control_sensors_present = mavlink_msg_sys_status_get_onboard_control_sensors_present(msg);
496 sys_status->onboard_control_sensors_enabled = mavlink_msg_sys_status_get_onboard_control_sensors_enabled(msg);
497 sys_status->onboard_control_sensors_health = mavlink_msg_sys_status_get_onboard_control_sensors_health(msg);
498 sys_status->load = mavlink_msg_sys_status_get_load(msg);
499 sys_status->voltage_battery = mavlink_msg_sys_status_get_voltage_battery(msg);
500 sys_status->current_battery = mavlink_msg_sys_status_get_current_battery(msg);
501 sys_status->drop_rate_comm = mavlink_msg_sys_status_get_drop_rate_comm(msg);
502 sys_status->errors_comm = mavlink_msg_sys_status_get_errors_comm(msg);
503 sys_status->errors_count1 = mavlink_msg_sys_status_get_errors_count1(msg);
504 sys_status->errors_count2 = mavlink_msg_sys_status_get_errors_count2(msg);
505 sys_status->errors_count3 = mavlink_msg_sys_status_get_errors_count3(msg);
506 sys_status->errors_count4 = mavlink_msg_sys_status_get_errors_count4(msg);
507 sys_status->battery_remaining = mavlink_msg_sys_status_get_battery_remaining(msg);
508#else
509 uint8_t len = msg->len < MAVLINK_MSG_ID_SYS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_SYS_STATUS_LEN;
510 memset(sys_status, 0, MAVLINK_MSG_ID_SYS_STATUS_LEN);
511 memcpy(sys_status, _MAV_PAYLOAD(msg), len);
512#endif
513}