Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_high_latency2.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE HIGH_LATENCY2 PACKING
3
4#define MAVLINK_MSG_ID_HIGH_LATENCY2 235
5
6
8 uint32_t timestamp; /*< [ms] Timestamp (milliseconds since boot or Unix epoch)*/
9 int32_t latitude; /*< [degE7] Latitude*/
10 int32_t longitude; /*< [degE7] Longitude*/
11 uint16_t custom_mode; /*< A bitfield for use for autopilot-specific flags (2 byte version).*/
12 int16_t altitude; /*< [m] Altitude above mean sea level*/
13 int16_t target_altitude; /*< [m] Altitude setpoint*/
14 uint16_t target_distance; /*< [dam] Distance to target waypoint or position*/
15 uint16_t wp_num; /*< Current waypoint number*/
16 uint16_t failure_flags; /*< Bitmap of failure flags.*/
17 uint8_t type; /*< Type of the MAV (quadrotor, helicopter, etc.)*/
18 uint8_t autopilot; /*< Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.*/
19 uint8_t heading; /*< [deg/2] Heading*/
20 uint8_t target_heading; /*< [deg/2] Heading setpoint*/
21 uint8_t throttle; /*< [%] Throttle*/
22 uint8_t airspeed; /*< [m/s*5] Airspeed*/
23 uint8_t airspeed_sp; /*< [m/s*5] Airspeed setpoint*/
24 uint8_t groundspeed; /*< [m/s*5] Groundspeed*/
25 uint8_t windspeed; /*< [m/s*5] Windspeed*/
26 uint8_t wind_heading; /*< [deg/2] Wind heading*/
27 uint8_t eph; /*< [dm] Maximum error horizontal position since last message*/
28 uint8_t epv; /*< [dm] Maximum error vertical position since last message*/
29 int8_t temperature_air; /*< [degC] Air temperature*/
30 int8_t climb_rate; /*< [dm/s] Maximum climb rate magnitude since last message*/
31 int8_t battery; /*< [%] Battery level (-1 if field not provided).*/
32 int8_t custom0; /*< Field for custom payload.*/
33 int8_t custom1; /*< Field for custom payload.*/
34 int8_t custom2; /*< Field for custom payload.*/
35} mavlink_high_latency2_t;
36
37#define MAVLINK_MSG_ID_HIGH_LATENCY2_LEN 42
38#define MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN 42
39#define MAVLINK_MSG_ID_235_LEN 42
40#define MAVLINK_MSG_ID_235_MIN_LEN 42
41
42#define MAVLINK_MSG_ID_HIGH_LATENCY2_CRC 179
43#define MAVLINK_MSG_ID_235_CRC 179
44
45
46
47#if MAVLINK_COMMAND_24BIT
48#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY2 {
49 235,
50 "HIGH_LATENCY2",
51 27,
52 { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency2_t, timestamp) },
53 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_high_latency2_t, type) },
54 { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_high_latency2_t, autopilot) },
55 { "custom_mode", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_high_latency2_t, custom_mode) },
56 { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency2_t, latitude) },
57 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency2_t, longitude) },
58 { "altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency2_t, altitude) },
59 { "target_altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_high_latency2_t, target_altitude) },
60 { "heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency2_t, heading) },
61 { "target_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency2_t, target_heading) },
62 { "target_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_high_latency2_t, target_distance) },
63 { "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_high_latency2_t, throttle) },
64 { "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency2_t, airspeed) },
65 { "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency2_t, airspeed_sp) },
66 { "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency2_t, groundspeed) },
67 { "windspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_high_latency2_t, windspeed) },
68 { "wind_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency2_t, wind_heading) },
69 { "eph", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency2_t, eph) },
70 { "epv", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency2_t, epv) },
71 { "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency2_t, temperature_air) },
72 { "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency2_t, climb_rate) },
73 { "battery", NULL, MAVLINK_TYPE_INT8_T, 0, 38, offsetof(mavlink_high_latency2_t, battery) },
74 { "wp_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_high_latency2_t, wp_num) },
75 { "failure_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_high_latency2_t, failure_flags) },
76 { "custom0", NULL, MAVLINK_TYPE_INT8_T, 0, 39, offsetof(mavlink_high_latency2_t, custom0) },
77 { "custom1", NULL, MAVLINK_TYPE_INT8_T, 0, 40, offsetof(mavlink_high_latency2_t, custom1) },
78 { "custom2", NULL, MAVLINK_TYPE_INT8_T, 0, 41, offsetof(mavlink_high_latency2_t, custom2) },
79 } \
80}
81#else
82#define MAVLINK_MESSAGE_INFO_HIGH_LATENCY2 {
83 "HIGH_LATENCY2",
84 27,
85 { { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_high_latency2_t, timestamp) },
86 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_high_latency2_t, type) },
87 { "autopilot", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_high_latency2_t, autopilot) },
88 { "custom_mode", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_high_latency2_t, custom_mode) },
89 { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_high_latency2_t, latitude) },
90 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_high_latency2_t, longitude) },
91 { "altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 14, offsetof(mavlink_high_latency2_t, altitude) },
92 { "target_altitude", NULL, MAVLINK_TYPE_INT16_T, 0, 16, offsetof(mavlink_high_latency2_t, target_altitude) },
93 { "heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_high_latency2_t, heading) },
94 { "target_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_high_latency2_t, target_heading) },
95 { "target_distance", NULL, MAVLINK_TYPE_UINT16_T, 0, 18, offsetof(mavlink_high_latency2_t, target_distance) },
96 { "throttle", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_high_latency2_t, throttle) },
97 { "airspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_high_latency2_t, airspeed) },
98 { "airspeed_sp", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_high_latency2_t, airspeed_sp) },
99 { "groundspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_high_latency2_t, groundspeed) },
100 { "windspeed", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_high_latency2_t, windspeed) },
101 { "wind_heading", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_high_latency2_t, wind_heading) },
102 { "eph", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_high_latency2_t, eph) },
103 { "epv", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_high_latency2_t, epv) },
104 { "temperature_air", NULL, MAVLINK_TYPE_INT8_T, 0, 36, offsetof(mavlink_high_latency2_t, temperature_air) },
105 { "climb_rate", NULL, MAVLINK_TYPE_INT8_T, 0, 37, offsetof(mavlink_high_latency2_t, climb_rate) },
106 { "battery", NULL, MAVLINK_TYPE_INT8_T, 0, 38, offsetof(mavlink_high_latency2_t, battery) },
107 { "wp_num", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_high_latency2_t, wp_num) },
108 { "failure_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_high_latency2_t, failure_flags) },
109 { "custom0", NULL, MAVLINK_TYPE_INT8_T, 0, 39, offsetof(mavlink_high_latency2_t, custom0) },
110 { "custom1", NULL, MAVLINK_TYPE_INT8_T, 0, 40, offsetof(mavlink_high_latency2_t, custom1) },
111 { "custom2", NULL, MAVLINK_TYPE_INT8_T, 0, 41, offsetof(mavlink_high_latency2_t, custom2) },
112 } \
113}
114#endif
115
116/**
117 * @brief Pack a high_latency2 message
118 * @param system_id ID of this system
119 * @param component_id ID of this component (e.g. 200 for IMU)
120 * @param msg The MAVLink message to compress the data into
121 *
122 * @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch)
123 * @param type Type of the MAV (quadrotor, helicopter, etc.)
124 * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
125 * @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version).
126 * @param latitude [degE7] Latitude
127 * @param longitude [degE7] Longitude
128 * @param altitude [m] Altitude above mean sea level
129 * @param target_altitude [m] Altitude setpoint
130 * @param heading [deg/2] Heading
131 * @param target_heading [deg/2] Heading setpoint
132 * @param target_distance [dam] Distance to target waypoint or position
133 * @param throttle [%] Throttle
134 * @param airspeed [m/s*5] Airspeed
135 * @param airspeed_sp [m/s*5] Airspeed setpoint
136 * @param groundspeed [m/s*5] Groundspeed
137 * @param windspeed [m/s*5] Windspeed
138 * @param wind_heading [deg/2] Wind heading
139 * @param eph [dm] Maximum error horizontal position since last message
140 * @param epv [dm] Maximum error vertical position since last message
141 * @param temperature_air [degC] Air temperature
142 * @param climb_rate [dm/s] Maximum climb rate magnitude since last message
143 * @param battery [%] Battery level (-1 if field not provided).
144 * @param wp_num Current waypoint number
145 * @param failure_flags Bitmap of failure flags.
146 * @param custom0 Field for custom payload.
147 * @param custom1 Field for custom payload.
148 * @param custom2 Field for custom payload.
149 * @return length of the message in bytes (excluding serial stream start sign)
150 */
151static inline uint16_t mavlink_msg_high_latency2_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
152 uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2)
153{
154#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
156 _mav_put_uint32_t(buf, 0, timestamp);
157 _mav_put_int32_t(buf, 4, latitude);
158 _mav_put_int32_t(buf, 8, longitude);
159 _mav_put_uint16_t(buf, 12, custom_mode);
160 _mav_put_int16_t(buf, 14, altitude);
161 _mav_put_int16_t(buf, 16, target_altitude);
162 _mav_put_uint16_t(buf, 18, target_distance);
163 _mav_put_uint16_t(buf, 20, wp_num);
164 _mav_put_uint16_t(buf, 22, failure_flags);
165 _mav_put_uint8_t(buf, 24, type);
166 _mav_put_uint8_t(buf, 25, autopilot);
167 _mav_put_uint8_t(buf, 26, heading);
168 _mav_put_uint8_t(buf, 27, target_heading);
169 _mav_put_uint8_t(buf, 28, throttle);
170 _mav_put_uint8_t(buf, 29, airspeed);
171 _mav_put_uint8_t(buf, 30, airspeed_sp);
172 _mav_put_uint8_t(buf, 31, groundspeed);
173 _mav_put_uint8_t(buf, 32, windspeed);
174 _mav_put_uint8_t(buf, 33, wind_heading);
175 _mav_put_uint8_t(buf, 34, eph);
176 _mav_put_uint8_t(buf, 35, epv);
177 _mav_put_int8_t(buf, 36, temperature_air);
178 _mav_put_int8_t(buf, 37, climb_rate);
179 _mav_put_int8_t(buf, 38, battery);
180 _mav_put_int8_t(buf, 39, custom0);
181 _mav_put_int8_t(buf, 40, custom1);
182 _mav_put_int8_t(buf, 41, custom2);
183
184 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
185#else
186 mavlink_high_latency2_t packet;
187 packet.timestamp = timestamp;
188 packet.latitude = latitude;
189 packet.longitude = longitude;
190 packet.custom_mode = custom_mode;
191 packet.altitude = altitude;
192 packet.target_altitude = target_altitude;
193 packet.target_distance = target_distance;
194 packet.wp_num = wp_num;
195 packet.failure_flags = failure_flags;
196 packet.type = type;
197 packet.autopilot = autopilot;
198 packet.heading = heading;
199 packet.target_heading = target_heading;
200 packet.throttle = throttle;
201 packet.airspeed = airspeed;
202 packet.airspeed_sp = airspeed_sp;
203 packet.groundspeed = groundspeed;
204 packet.windspeed = windspeed;
205 packet.wind_heading = wind_heading;
206 packet.eph = eph;
207 packet.epv = epv;
208 packet.temperature_air = temperature_air;
209 packet.climb_rate = climb_rate;
210 packet.battery = battery;
211 packet.custom0 = custom0;
212 packet.custom1 = custom1;
213 packet.custom2 = custom2;
214
215 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
216#endif
217
218 msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY2;
219 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
220}
221
222/**
223 * @brief Pack a high_latency2 message
224 * @param system_id ID of this system
225 * @param component_id ID of this component (e.g. 200 for IMU)
226 * @param status MAVLink status structure
227 * @param msg The MAVLink message to compress the data into
228 *
229 * @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch)
230 * @param type Type of the MAV (quadrotor, helicopter, etc.)
231 * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
232 * @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version).
233 * @param latitude [degE7] Latitude
234 * @param longitude [degE7] Longitude
235 * @param altitude [m] Altitude above mean sea level
236 * @param target_altitude [m] Altitude setpoint
237 * @param heading [deg/2] Heading
238 * @param target_heading [deg/2] Heading setpoint
239 * @param target_distance [dam] Distance to target waypoint or position
240 * @param throttle [%] Throttle
241 * @param airspeed [m/s*5] Airspeed
242 * @param airspeed_sp [m/s*5] Airspeed setpoint
243 * @param groundspeed [m/s*5] Groundspeed
244 * @param windspeed [m/s*5] Windspeed
245 * @param wind_heading [deg/2] Wind heading
246 * @param eph [dm] Maximum error horizontal position since last message
247 * @param epv [dm] Maximum error vertical position since last message
248 * @param temperature_air [degC] Air temperature
249 * @param climb_rate [dm/s] Maximum climb rate magnitude since last message
250 * @param battery [%] Battery level (-1 if field not provided).
251 * @param wp_num Current waypoint number
252 * @param failure_flags Bitmap of failure flags.
253 * @param custom0 Field for custom payload.
254 * @param custom1 Field for custom payload.
255 * @param custom2 Field for custom payload.
256 * @return length of the message in bytes (excluding serial stream start sign)
257 */
258static inline uint16_t mavlink_msg_high_latency2_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
259 uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2)
260{
261#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
263 _mav_put_uint32_t(buf, 0, timestamp);
264 _mav_put_int32_t(buf, 4, latitude);
265 _mav_put_int32_t(buf, 8, longitude);
266 _mav_put_uint16_t(buf, 12, custom_mode);
267 _mav_put_int16_t(buf, 14, altitude);
268 _mav_put_int16_t(buf, 16, target_altitude);
269 _mav_put_uint16_t(buf, 18, target_distance);
270 _mav_put_uint16_t(buf, 20, wp_num);
271 _mav_put_uint16_t(buf, 22, failure_flags);
272 _mav_put_uint8_t(buf, 24, type);
273 _mav_put_uint8_t(buf, 25, autopilot);
274 _mav_put_uint8_t(buf, 26, heading);
275 _mav_put_uint8_t(buf, 27, target_heading);
276 _mav_put_uint8_t(buf, 28, throttle);
277 _mav_put_uint8_t(buf, 29, airspeed);
278 _mav_put_uint8_t(buf, 30, airspeed_sp);
279 _mav_put_uint8_t(buf, 31, groundspeed);
280 _mav_put_uint8_t(buf, 32, windspeed);
281 _mav_put_uint8_t(buf, 33, wind_heading);
282 _mav_put_uint8_t(buf, 34, eph);
283 _mav_put_uint8_t(buf, 35, epv);
284 _mav_put_int8_t(buf, 36, temperature_air);
285 _mav_put_int8_t(buf, 37, climb_rate);
286 _mav_put_int8_t(buf, 38, battery);
287 _mav_put_int8_t(buf, 39, custom0);
288 _mav_put_int8_t(buf, 40, custom1);
289 _mav_put_int8_t(buf, 41, custom2);
290
291 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
292#else
293 mavlink_high_latency2_t packet;
294 packet.timestamp = timestamp;
295 packet.latitude = latitude;
296 packet.longitude = longitude;
297 packet.custom_mode = custom_mode;
298 packet.altitude = altitude;
299 packet.target_altitude = target_altitude;
300 packet.target_distance = target_distance;
301 packet.wp_num = wp_num;
302 packet.failure_flags = failure_flags;
303 packet.type = type;
304 packet.autopilot = autopilot;
305 packet.heading = heading;
306 packet.target_heading = target_heading;
307 packet.throttle = throttle;
308 packet.airspeed = airspeed;
309 packet.airspeed_sp = airspeed_sp;
310 packet.groundspeed = groundspeed;
311 packet.windspeed = windspeed;
312 packet.wind_heading = wind_heading;
313 packet.eph = eph;
314 packet.epv = epv;
315 packet.temperature_air = temperature_air;
316 packet.climb_rate = climb_rate;
317 packet.battery = battery;
318 packet.custom0 = custom0;
319 packet.custom1 = custom1;
320 packet.custom2 = custom2;
321
322 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
323#endif
324
325 msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY2;
326#if MAVLINK_CRC_EXTRA
327 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
328#else
329 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
330#endif
331}
332
333/**
334 * @brief Pack a high_latency2 message on a channel
335 * @param system_id ID of this system
336 * @param component_id ID of this component (e.g. 200 for IMU)
337 * @param chan The MAVLink channel this message will be sent over
338 * @param msg The MAVLink message to compress the data into
339 * @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch)
340 * @param type Type of the MAV (quadrotor, helicopter, etc.)
341 * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
342 * @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version).
343 * @param latitude [degE7] Latitude
344 * @param longitude [degE7] Longitude
345 * @param altitude [m] Altitude above mean sea level
346 * @param target_altitude [m] Altitude setpoint
347 * @param heading [deg/2] Heading
348 * @param target_heading [deg/2] Heading setpoint
349 * @param target_distance [dam] Distance to target waypoint or position
350 * @param throttle [%] Throttle
351 * @param airspeed [m/s*5] Airspeed
352 * @param airspeed_sp [m/s*5] Airspeed setpoint
353 * @param groundspeed [m/s*5] Groundspeed
354 * @param windspeed [m/s*5] Windspeed
355 * @param wind_heading [deg/2] Wind heading
356 * @param eph [dm] Maximum error horizontal position since last message
357 * @param epv [dm] Maximum error vertical position since last message
358 * @param temperature_air [degC] Air temperature
359 * @param climb_rate [dm/s] Maximum climb rate magnitude since last message
360 * @param battery [%] Battery level (-1 if field not provided).
361 * @param wp_num Current waypoint number
362 * @param failure_flags Bitmap of failure flags.
363 * @param custom0 Field for custom payload.
364 * @param custom1 Field for custom payload.
365 * @param custom2 Field for custom payload.
366 * @return length of the message in bytes (excluding serial stream start sign)
367 */
368static inline uint16_t mavlink_msg_high_latency2_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
369 mavlink_message_t* msg,
370 uint32_t timestamp,uint8_t type,uint8_t autopilot,uint16_t custom_mode,int32_t latitude,int32_t longitude,int16_t altitude,int16_t target_altitude,uint8_t heading,uint8_t target_heading,uint16_t target_distance,uint8_t throttle,uint8_t airspeed,uint8_t airspeed_sp,uint8_t groundspeed,uint8_t windspeed,uint8_t wind_heading,uint8_t eph,uint8_t epv,int8_t temperature_air,int8_t climb_rate,int8_t battery,uint16_t wp_num,uint16_t failure_flags,int8_t custom0,int8_t custom1,int8_t custom2)
371{
372#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
374 _mav_put_uint32_t(buf, 0, timestamp);
375 _mav_put_int32_t(buf, 4, latitude);
376 _mav_put_int32_t(buf, 8, longitude);
377 _mav_put_uint16_t(buf, 12, custom_mode);
378 _mav_put_int16_t(buf, 14, altitude);
379 _mav_put_int16_t(buf, 16, target_altitude);
380 _mav_put_uint16_t(buf, 18, target_distance);
381 _mav_put_uint16_t(buf, 20, wp_num);
382 _mav_put_uint16_t(buf, 22, failure_flags);
383 _mav_put_uint8_t(buf, 24, type);
384 _mav_put_uint8_t(buf, 25, autopilot);
385 _mav_put_uint8_t(buf, 26, heading);
386 _mav_put_uint8_t(buf, 27, target_heading);
387 _mav_put_uint8_t(buf, 28, throttle);
388 _mav_put_uint8_t(buf, 29, airspeed);
389 _mav_put_uint8_t(buf, 30, airspeed_sp);
390 _mav_put_uint8_t(buf, 31, groundspeed);
391 _mav_put_uint8_t(buf, 32, windspeed);
392 _mav_put_uint8_t(buf, 33, wind_heading);
393 _mav_put_uint8_t(buf, 34, eph);
394 _mav_put_uint8_t(buf, 35, epv);
395 _mav_put_int8_t(buf, 36, temperature_air);
396 _mav_put_int8_t(buf, 37, climb_rate);
397 _mav_put_int8_t(buf, 38, battery);
398 _mav_put_int8_t(buf, 39, custom0);
399 _mav_put_int8_t(buf, 40, custom1);
400 _mav_put_int8_t(buf, 41, custom2);
401
402 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
403#else
404 mavlink_high_latency2_t packet;
405 packet.timestamp = timestamp;
406 packet.latitude = latitude;
407 packet.longitude = longitude;
408 packet.custom_mode = custom_mode;
409 packet.altitude = altitude;
410 packet.target_altitude = target_altitude;
411 packet.target_distance = target_distance;
412 packet.wp_num = wp_num;
413 packet.failure_flags = failure_flags;
414 packet.type = type;
415 packet.autopilot = autopilot;
416 packet.heading = heading;
417 packet.target_heading = target_heading;
418 packet.throttle = throttle;
419 packet.airspeed = airspeed;
420 packet.airspeed_sp = airspeed_sp;
421 packet.groundspeed = groundspeed;
422 packet.windspeed = windspeed;
423 packet.wind_heading = wind_heading;
424 packet.eph = eph;
425 packet.epv = epv;
426 packet.temperature_air = temperature_air;
427 packet.climb_rate = climb_rate;
428 packet.battery = battery;
429 packet.custom0 = custom0;
430 packet.custom1 = custom1;
431 packet.custom2 = custom2;
432
433 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
434#endif
435
436 msg->msgid = MAVLINK_MSG_ID_HIGH_LATENCY2;
437 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
438}
439
440/**
441 * @brief Encode a high_latency2 struct
442 *
443 * @param system_id ID of this system
444 * @param component_id ID of this component (e.g. 200 for IMU)
445 * @param msg The MAVLink message to compress the data into
446 * @param high_latency2 C-struct to read the message contents from
447 */
448static inline uint16_t mavlink_msg_high_latency2_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_high_latency2_t* high_latency2)
449{
450 return mavlink_msg_high_latency2_pack(system_id, component_id, msg, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2);
451}
452
453/**
454 * @brief Encode a high_latency2 struct on a channel
455 *
456 * @param system_id ID of this system
457 * @param component_id ID of this component (e.g. 200 for IMU)
458 * @param chan The MAVLink channel this message will be sent over
459 * @param msg The MAVLink message to compress the data into
460 * @param high_latency2 C-struct to read the message contents from
461 */
462static inline uint16_t mavlink_msg_high_latency2_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_high_latency2_t* high_latency2)
463{
464 return mavlink_msg_high_latency2_pack_chan(system_id, component_id, chan, msg, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2);
465}
466
467/**
468 * @brief Encode a high_latency2 struct with provided status structure
469 *
470 * @param system_id ID of this system
471 * @param component_id ID of this component (e.g. 200 for IMU)
472 * @param status MAVLink status structure
473 * @param msg The MAVLink message to compress the data into
474 * @param high_latency2 C-struct to read the message contents from
475 */
476static inline uint16_t mavlink_msg_high_latency2_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_high_latency2_t* high_latency2)
477{
478 return mavlink_msg_high_latency2_pack_status(system_id, component_id, _status, msg, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2);
479}
480
481/**
482 * @brief Send a high_latency2 message
483 * @param chan MAVLink channel to send the message
484 *
485 * @param timestamp [ms] Timestamp (milliseconds since boot or Unix epoch)
486 * @param type Type of the MAV (quadrotor, helicopter, etc.)
487 * @param autopilot Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
488 * @param custom_mode A bitfield for use for autopilot-specific flags (2 byte version).
489 * @param latitude [degE7] Latitude
490 * @param longitude [degE7] Longitude
491 * @param altitude [m] Altitude above mean sea level
492 * @param target_altitude [m] Altitude setpoint
493 * @param heading [deg/2] Heading
494 * @param target_heading [deg/2] Heading setpoint
495 * @param target_distance [dam] Distance to target waypoint or position
496 * @param throttle [%] Throttle
497 * @param airspeed [m/s*5] Airspeed
498 * @param airspeed_sp [m/s*5] Airspeed setpoint
499 * @param groundspeed [m/s*5] Groundspeed
500 * @param windspeed [m/s*5] Windspeed
501 * @param wind_heading [deg/2] Wind heading
502 * @param eph [dm] Maximum error horizontal position since last message
503 * @param epv [dm] Maximum error vertical position since last message
504 * @param temperature_air [degC] Air temperature
505 * @param climb_rate [dm/s] Maximum climb rate magnitude since last message
506 * @param battery [%] Battery level (-1 if field not provided).
507 * @param wp_num Current waypoint number
508 * @param failure_flags Bitmap of failure flags.
509 * @param custom0 Field for custom payload.
510 * @param custom1 Field for custom payload.
511 * @param custom2 Field for custom payload.
512 */
513#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
514
515static inline void mavlink_msg_high_latency2_send(mavlink_channel_t chan, uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2)
516{
517#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
518 char buf[MAVLINK_MSG_ID_HIGH_LATENCY2_LEN];
519 _mav_put_uint32_t(buf, 0, timestamp);
520 _mav_put_int32_t(buf, 4, latitude);
521 _mav_put_int32_t(buf, 8, longitude);
522 _mav_put_uint16_t(buf, 12, custom_mode);
523 _mav_put_int16_t(buf, 14, altitude);
524 _mav_put_int16_t(buf, 16, target_altitude);
525 _mav_put_uint16_t(buf, 18, target_distance);
526 _mav_put_uint16_t(buf, 20, wp_num);
527 _mav_put_uint16_t(buf, 22, failure_flags);
528 _mav_put_uint8_t(buf, 24, type);
529 _mav_put_uint8_t(buf, 25, autopilot);
530 _mav_put_uint8_t(buf, 26, heading);
531 _mav_put_uint8_t(buf, 27, target_heading);
532 _mav_put_uint8_t(buf, 28, throttle);
533 _mav_put_uint8_t(buf, 29, airspeed);
534 _mav_put_uint8_t(buf, 30, airspeed_sp);
535 _mav_put_uint8_t(buf, 31, groundspeed);
536 _mav_put_uint8_t(buf, 32, windspeed);
537 _mav_put_uint8_t(buf, 33, wind_heading);
538 _mav_put_uint8_t(buf, 34, eph);
539 _mav_put_uint8_t(buf, 35, epv);
540 _mav_put_int8_t(buf, 36, temperature_air);
541 _mav_put_int8_t(buf, 37, climb_rate);
542 _mav_put_int8_t(buf, 38, battery);
543 _mav_put_int8_t(buf, 39, custom0);
544 _mav_put_int8_t(buf, 40, custom1);
545 _mav_put_int8_t(buf, 41, custom2);
546
547 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, buf, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
548#else
549 mavlink_high_latency2_t packet;
550 packet.timestamp = timestamp;
551 packet.latitude = latitude;
552 packet.longitude = longitude;
553 packet.custom_mode = custom_mode;
554 packet.altitude = altitude;
555 packet.target_altitude = target_altitude;
556 packet.target_distance = target_distance;
557 packet.wp_num = wp_num;
558 packet.failure_flags = failure_flags;
559 packet.type = type;
560 packet.autopilot = autopilot;
561 packet.heading = heading;
562 packet.target_heading = target_heading;
563 packet.throttle = throttle;
564 packet.airspeed = airspeed;
565 packet.airspeed_sp = airspeed_sp;
566 packet.groundspeed = groundspeed;
567 packet.windspeed = windspeed;
568 packet.wind_heading = wind_heading;
569 packet.eph = eph;
570 packet.epv = epv;
571 packet.temperature_air = temperature_air;
572 packet.climb_rate = climb_rate;
573 packet.battery = battery;
574 packet.custom0 = custom0;
575 packet.custom1 = custom1;
576 packet.custom2 = custom2;
577
578 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)&packet, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
579#endif
580}
581
582/**
583 * @brief Send a high_latency2 message
584 * @param chan MAVLink channel to send the message
585 * @param struct The MAVLink struct to serialize
586 */
587static inline void mavlink_msg_high_latency2_send_struct(mavlink_channel_t chan, const mavlink_high_latency2_t* high_latency2)
588{
589#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
590 mavlink_msg_high_latency2_send(chan, high_latency2->timestamp, high_latency2->type, high_latency2->autopilot, high_latency2->custom_mode, high_latency2->latitude, high_latency2->longitude, high_latency2->altitude, high_latency2->target_altitude, high_latency2->heading, high_latency2->target_heading, high_latency2->target_distance, high_latency2->throttle, high_latency2->airspeed, high_latency2->airspeed_sp, high_latency2->groundspeed, high_latency2->windspeed, high_latency2->wind_heading, high_latency2->eph, high_latency2->epv, high_latency2->temperature_air, high_latency2->climb_rate, high_latency2->battery, high_latency2->wp_num, high_latency2->failure_flags, high_latency2->custom0, high_latency2->custom1, high_latency2->custom2);
591#else
592 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)high_latency2, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
593#endif
594}
595
596#if MAVLINK_MSG_ID_HIGH_LATENCY2_LEN <= MAVLINK_MAX_PAYLOAD_LEN
597/*
598 This variant of _send() can be used to save stack space by reusing
599 memory from the receive buffer. The caller provides a
600 mavlink_message_t which is the size of a full mavlink message. This
601 is usually the receive buffer for the channel, and allows a reply to an
602 incoming message with minimum stack space usage.
603 */
604static inline void mavlink_msg_high_latency2_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t timestamp, uint8_t type, uint8_t autopilot, uint16_t custom_mode, int32_t latitude, int32_t longitude, int16_t altitude, int16_t target_altitude, uint8_t heading, uint8_t target_heading, uint16_t target_distance, uint8_t throttle, uint8_t airspeed, uint8_t airspeed_sp, uint8_t groundspeed, uint8_t windspeed, uint8_t wind_heading, uint8_t eph, uint8_t epv, int8_t temperature_air, int8_t climb_rate, int8_t battery, uint16_t wp_num, uint16_t failure_flags, int8_t custom0, int8_t custom1, int8_t custom2)
605{
606#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
607 char *buf = (char *)msgbuf;
608 _mav_put_uint32_t(buf, 0, timestamp);
609 _mav_put_int32_t(buf, 4, latitude);
610 _mav_put_int32_t(buf, 8, longitude);
611 _mav_put_uint16_t(buf, 12, custom_mode);
612 _mav_put_int16_t(buf, 14, altitude);
613 _mav_put_int16_t(buf, 16, target_altitude);
614 _mav_put_uint16_t(buf, 18, target_distance);
615 _mav_put_uint16_t(buf, 20, wp_num);
616 _mav_put_uint16_t(buf, 22, failure_flags);
617 _mav_put_uint8_t(buf, 24, type);
618 _mav_put_uint8_t(buf, 25, autopilot);
619 _mav_put_uint8_t(buf, 26, heading);
620 _mav_put_uint8_t(buf, 27, target_heading);
621 _mav_put_uint8_t(buf, 28, throttle);
622 _mav_put_uint8_t(buf, 29, airspeed);
623 _mav_put_uint8_t(buf, 30, airspeed_sp);
624 _mav_put_uint8_t(buf, 31, groundspeed);
625 _mav_put_uint8_t(buf, 32, windspeed);
626 _mav_put_uint8_t(buf, 33, wind_heading);
627 _mav_put_uint8_t(buf, 34, eph);
628 _mav_put_uint8_t(buf, 35, epv);
629 _mav_put_int8_t(buf, 36, temperature_air);
630 _mav_put_int8_t(buf, 37, climb_rate);
631 _mav_put_int8_t(buf, 38, battery);
632 _mav_put_int8_t(buf, 39, custom0);
633 _mav_put_int8_t(buf, 40, custom1);
634 _mav_put_int8_t(buf, 41, custom2);
635
636 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, buf, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
637#else
638 mavlink_high_latency2_t *packet = (mavlink_high_latency2_t *)msgbuf;
639 packet->timestamp = timestamp;
640 packet->latitude = latitude;
641 packet->longitude = longitude;
642 packet->custom_mode = custom_mode;
643 packet->altitude = altitude;
644 packet->target_altitude = target_altitude;
645 packet->target_distance = target_distance;
646 packet->wp_num = wp_num;
647 packet->failure_flags = failure_flags;
648 packet->type = type;
649 packet->autopilot = autopilot;
650 packet->heading = heading;
651 packet->target_heading = target_heading;
652 packet->throttle = throttle;
653 packet->airspeed = airspeed;
654 packet->airspeed_sp = airspeed_sp;
655 packet->groundspeed = groundspeed;
656 packet->windspeed = windspeed;
657 packet->wind_heading = wind_heading;
658 packet->eph = eph;
659 packet->epv = epv;
660 packet->temperature_air = temperature_air;
661 packet->climb_rate = climb_rate;
662 packet->battery = battery;
663 packet->custom0 = custom0;
664 packet->custom1 = custom1;
665 packet->custom2 = custom2;
666
667 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIGH_LATENCY2, (const char *)packet, MAVLINK_MSG_ID_HIGH_LATENCY2_MIN_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN, MAVLINK_MSG_ID_HIGH_LATENCY2_CRC);
668#endif
669}
670#endif
671
672#endif
673
674// MESSAGE HIGH_LATENCY2 UNPACKING
675
676
677/**
678 * @brief Get field timestamp from high_latency2 message
679 *
680 * @return [ms] Timestamp (milliseconds since boot or Unix epoch)
681 */
682static inline uint32_t mavlink_msg_high_latency2_get_timestamp(const mavlink_message_t* msg)
683{
684 return _MAV_RETURN_uint32_t(msg, 0);
685}
686
687/**
688 * @brief Get field type from high_latency2 message
689 *
690 * @return Type of the MAV (quadrotor, helicopter, etc.)
691 */
692static inline uint8_t mavlink_msg_high_latency2_get_type(const mavlink_message_t* msg)
693{
694 return _MAV_RETURN_uint8_t(msg, 24);
695}
696
697/**
698 * @brief Get field autopilot from high_latency2 message
699 *
700 * @return Autopilot type / class. Use MAV_AUTOPILOT_INVALID for components that are not flight controllers.
701 */
702static inline uint8_t mavlink_msg_high_latency2_get_autopilot(const mavlink_message_t* msg)
703{
704 return _MAV_RETURN_uint8_t(msg, 25);
705}
706
707/**
708 * @brief Get field custom_mode from high_latency2 message
709 *
710 * @return A bitfield for use for autopilot-specific flags (2 byte version).
711 */
712static inline uint16_t mavlink_msg_high_latency2_get_custom_mode(const mavlink_message_t* msg)
713{
714 return _MAV_RETURN_uint16_t(msg, 12);
715}
716
717/**
718 * @brief Get field latitude from high_latency2 message
719 *
720 * @return [degE7] Latitude
721 */
722static inline int32_t mavlink_msg_high_latency2_get_latitude(const mavlink_message_t* msg)
723{
724 return _MAV_RETURN_int32_t(msg, 4);
725}
726
727/**
728 * @brief Get field longitude from high_latency2 message
729 *
730 * @return [degE7] Longitude
731 */
732static inline int32_t mavlink_msg_high_latency2_get_longitude(const mavlink_message_t* msg)
733{
734 return _MAV_RETURN_int32_t(msg, 8);
735}
736
737/**
738 * @brief Get field altitude from high_latency2 message
739 *
740 * @return [m] Altitude above mean sea level
741 */
742static inline int16_t mavlink_msg_high_latency2_get_altitude(const mavlink_message_t* msg)
743{
744 return _MAV_RETURN_int16_t(msg, 14);
745}
746
747/**
748 * @brief Get field target_altitude from high_latency2 message
749 *
750 * @return [m] Altitude setpoint
751 */
752static inline int16_t mavlink_msg_high_latency2_get_target_altitude(const mavlink_message_t* msg)
753{
754 return _MAV_RETURN_int16_t(msg, 16);
755}
756
757/**
758 * @brief Get field heading from high_latency2 message
759 *
760 * @return [deg/2] Heading
761 */
762static inline uint8_t mavlink_msg_high_latency2_get_heading(const mavlink_message_t* msg)
763{
764 return _MAV_RETURN_uint8_t(msg, 26);
765}
766
767/**
768 * @brief Get field target_heading from high_latency2 message
769 *
770 * @return [deg/2] Heading setpoint
771 */
772static inline uint8_t mavlink_msg_high_latency2_get_target_heading(const mavlink_message_t* msg)
773{
774 return _MAV_RETURN_uint8_t(msg, 27);
775}
776
777/**
778 * @brief Get field target_distance from high_latency2 message
779 *
780 * @return [dam] Distance to target waypoint or position
781 */
782static inline uint16_t mavlink_msg_high_latency2_get_target_distance(const mavlink_message_t* msg)
783{
784 return _MAV_RETURN_uint16_t(msg, 18);
785}
786
787/**
788 * @brief Get field throttle from high_latency2 message
789 *
790 * @return [%] Throttle
791 */
792static inline uint8_t mavlink_msg_high_latency2_get_throttle(const mavlink_message_t* msg)
793{
794 return _MAV_RETURN_uint8_t(msg, 28);
795}
796
797/**
798 * @brief Get field airspeed from high_latency2 message
799 *
800 * @return [m/s*5] Airspeed
801 */
802static inline uint8_t mavlink_msg_high_latency2_get_airspeed(const mavlink_message_t* msg)
803{
804 return _MAV_RETURN_uint8_t(msg, 29);
805}
806
807/**
808 * @brief Get field airspeed_sp from high_latency2 message
809 *
810 * @return [m/s*5] Airspeed setpoint
811 */
812static inline uint8_t mavlink_msg_high_latency2_get_airspeed_sp(const mavlink_message_t* msg)
813{
814 return _MAV_RETURN_uint8_t(msg, 30);
815}
816
817/**
818 * @brief Get field groundspeed from high_latency2 message
819 *
820 * @return [m/s*5] Groundspeed
821 */
822static inline uint8_t mavlink_msg_high_latency2_get_groundspeed(const mavlink_message_t* msg)
823{
824 return _MAV_RETURN_uint8_t(msg, 31);
825}
826
827/**
828 * @brief Get field windspeed from high_latency2 message
829 *
830 * @return [m/s*5] Windspeed
831 */
832static inline uint8_t mavlink_msg_high_latency2_get_windspeed(const mavlink_message_t* msg)
833{
834 return _MAV_RETURN_uint8_t(msg, 32);
835}
836
837/**
838 * @brief Get field wind_heading from high_latency2 message
839 *
840 * @return [deg/2] Wind heading
841 */
842static inline uint8_t mavlink_msg_high_latency2_get_wind_heading(const mavlink_message_t* msg)
843{
844 return _MAV_RETURN_uint8_t(msg, 33);
845}
846
847/**
848 * @brief Get field eph from high_latency2 message
849 *
850 * @return [dm] Maximum error horizontal position since last message
851 */
852static inline uint8_t mavlink_msg_high_latency2_get_eph(const mavlink_message_t* msg)
853{
854 return _MAV_RETURN_uint8_t(msg, 34);
855}
856
857/**
858 * @brief Get field epv from high_latency2 message
859 *
860 * @return [dm] Maximum error vertical position since last message
861 */
862static inline uint8_t mavlink_msg_high_latency2_get_epv(const mavlink_message_t* msg)
863{
864 return _MAV_RETURN_uint8_t(msg, 35);
865}
866
867/**
868 * @brief Get field temperature_air from high_latency2 message
869 *
870 * @return [degC] Air temperature
871 */
872static inline int8_t mavlink_msg_high_latency2_get_temperature_air(const mavlink_message_t* msg)
873{
874 return _MAV_RETURN_int8_t(msg, 36);
875}
876
877/**
878 * @brief Get field climb_rate from high_latency2 message
879 *
880 * @return [dm/s] Maximum climb rate magnitude since last message
881 */
882static inline int8_t mavlink_msg_high_latency2_get_climb_rate(const mavlink_message_t* msg)
883{
884 return _MAV_RETURN_int8_t(msg, 37);
885}
886
887/**
888 * @brief Get field battery from high_latency2 message
889 *
890 * @return [%] Battery level (-1 if field not provided).
891 */
892static inline int8_t mavlink_msg_high_latency2_get_battery(const mavlink_message_t* msg)
893{
894 return _MAV_RETURN_int8_t(msg, 38);
895}
896
897/**
898 * @brief Get field wp_num from high_latency2 message
899 *
900 * @return Current waypoint number
901 */
902static inline uint16_t mavlink_msg_high_latency2_get_wp_num(const mavlink_message_t* msg)
903{
904 return _MAV_RETURN_uint16_t(msg, 20);
905}
906
907/**
908 * @brief Get field failure_flags from high_latency2 message
909 *
910 * @return Bitmap of failure flags.
911 */
912static inline uint16_t mavlink_msg_high_latency2_get_failure_flags(const mavlink_message_t* msg)
913{
914 return _MAV_RETURN_uint16_t(msg, 22);
915}
916
917/**
918 * @brief Get field custom0 from high_latency2 message
919 *
920 * @return Field for custom payload.
921 */
922static inline int8_t mavlink_msg_high_latency2_get_custom0(const mavlink_message_t* msg)
923{
924 return _MAV_RETURN_int8_t(msg, 39);
925}
926
927/**
928 * @brief Get field custom1 from high_latency2 message
929 *
930 * @return Field for custom payload.
931 */
932static inline int8_t mavlink_msg_high_latency2_get_custom1(const mavlink_message_t* msg)
933{
934 return _MAV_RETURN_int8_t(msg, 40);
935}
936
937/**
938 * @brief Get field custom2 from high_latency2 message
939 *
940 * @return Field for custom payload.
941 */
942static inline int8_t mavlink_msg_high_latency2_get_custom2(const mavlink_message_t* msg)
943{
944 return _MAV_RETURN_int8_t(msg, 41);
945}
946
947/**
948 * @brief Decode a high_latency2 message into a struct
949 *
950 * @param msg The message to decode
951 * @param high_latency2 C-struct to decode the message contents into
952 */
953static inline void mavlink_msg_high_latency2_decode(const mavlink_message_t* msg, mavlink_high_latency2_t* high_latency2)
954{
955#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
956 high_latency2->timestamp = mavlink_msg_high_latency2_get_timestamp(msg);
957 high_latency2->latitude = mavlink_msg_high_latency2_get_latitude(msg);
958 high_latency2->longitude = mavlink_msg_high_latency2_get_longitude(msg);
959 high_latency2->custom_mode = mavlink_msg_high_latency2_get_custom_mode(msg);
960 high_latency2->altitude = mavlink_msg_high_latency2_get_altitude(msg);
961 high_latency2->target_altitude = mavlink_msg_high_latency2_get_target_altitude(msg);
962 high_latency2->target_distance = mavlink_msg_high_latency2_get_target_distance(msg);
963 high_latency2->wp_num = mavlink_msg_high_latency2_get_wp_num(msg);
964 high_latency2->failure_flags = mavlink_msg_high_latency2_get_failure_flags(msg);
965 high_latency2->type = mavlink_msg_high_latency2_get_type(msg);
966 high_latency2->autopilot = mavlink_msg_high_latency2_get_autopilot(msg);
967 high_latency2->heading = mavlink_msg_high_latency2_get_heading(msg);
968 high_latency2->target_heading = mavlink_msg_high_latency2_get_target_heading(msg);
969 high_latency2->throttle = mavlink_msg_high_latency2_get_throttle(msg);
970 high_latency2->airspeed = mavlink_msg_high_latency2_get_airspeed(msg);
971 high_latency2->airspeed_sp = mavlink_msg_high_latency2_get_airspeed_sp(msg);
972 high_latency2->groundspeed = mavlink_msg_high_latency2_get_groundspeed(msg);
973 high_latency2->windspeed = mavlink_msg_high_latency2_get_windspeed(msg);
974 high_latency2->wind_heading = mavlink_msg_high_latency2_get_wind_heading(msg);
975 high_latency2->eph = mavlink_msg_high_latency2_get_eph(msg);
976 high_latency2->epv = mavlink_msg_high_latency2_get_epv(msg);
977 high_latency2->temperature_air = mavlink_msg_high_latency2_get_temperature_air(msg);
978 high_latency2->climb_rate = mavlink_msg_high_latency2_get_climb_rate(msg);
979 high_latency2->battery = mavlink_msg_high_latency2_get_battery(msg);
980 high_latency2->custom0 = mavlink_msg_high_latency2_get_custom0(msg);
981 high_latency2->custom1 = mavlink_msg_high_latency2_get_custom1(msg);
982 high_latency2->custom2 = mavlink_msg_high_latency2_get_custom2(msg);
983#else
984 uint8_t len = msg->len < MAVLINK_MSG_ID_HIGH_LATENCY2_LEN? msg->len : MAVLINK_MSG_ID_HIGH_LATENCY2_LEN;
985 memset(high_latency2, 0, MAVLINK_MSG_ID_HIGH_LATENCY2_LEN);
986 memcpy(high_latency2, _MAV_PAYLOAD(msg), len);
987#endif
988}