Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_safety_set_allowed_area.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE SAFETY_SET_ALLOWED_AREA PACKING
3
4#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA 54
5
6
8 float p1x; /*< [m] x position 1 / Latitude 1*/
9 float p1y; /*< [m] y position 1 / Longitude 1*/
10 float p1z; /*< [m] z position 1 / Altitude 1*/
11 float p2x; /*< [m] x position 2 / Latitude 2*/
12 float p2y; /*< [m] y position 2 / Longitude 2*/
13 float p2z; /*< [m] z position 2 / Altitude 2*/
14 uint8_t target_system; /*< System ID*/
15 uint8_t target_component; /*< Component ID*/
16 uint8_t frame; /*< Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.*/
17} mavlink_safety_set_allowed_area_t;
18
19#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN 27
20#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN 27
21#define MAVLINK_MSG_ID_54_LEN 27
22#define MAVLINK_MSG_ID_54_MIN_LEN 27
23
24#define MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC 15
25#define MAVLINK_MSG_ID_54_CRC 15
26
27
28
29#if MAVLINK_COMMAND_24BIT
30#define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA {
31 54,
32 "SAFETY_SET_ALLOWED_AREA",
33 9,
34 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) },
35 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) },
36 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) },
37 { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) },
38 { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) },
39 { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) },
40 { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) },
41 { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_set_allowed_area_t, p2y) },
42 { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_set_allowed_area_t, p2z) },
43 } \
44}
45#else
46#define MAVLINK_MESSAGE_INFO_SAFETY_SET_ALLOWED_AREA {
47 "SAFETY_SET_ALLOWED_AREA",
48 9,
49 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_safety_set_allowed_area_t, target_system) },
50 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_safety_set_allowed_area_t, target_component) },
51 { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_safety_set_allowed_area_t, frame) },
52 { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_safety_set_allowed_area_t, p1x) },
53 { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_safety_set_allowed_area_t, p1y) },
54 { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_safety_set_allowed_area_t, p1z) },
55 { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_safety_set_allowed_area_t, p2x) },
56 { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_safety_set_allowed_area_t, p2y) },
57 { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_safety_set_allowed_area_t, p2z) },
58 } \
59}
60#endif
61
62/**
63 * @brief Pack a safety_set_allowed_area message
64 * @param system_id ID of this system
65 * @param component_id ID of this component (e.g. 200 for IMU)
66 * @param msg The MAVLink message to compress the data into
67 *
68 * @param target_system System ID
69 * @param target_component Component ID
70 * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
71 * @param p1x [m] x position 1 / Latitude 1
72 * @param p1y [m] y position 1 / Longitude 1
73 * @param p1z [m] z position 1 / Altitude 1
74 * @param p2x [m] x position 2 / Latitude 2
75 * @param p2y [m] y position 2 / Longitude 2
76 * @param p2z [m] z position 2 / Altitude 2
77 * @return length of the message in bytes (excluding serial stream start sign)
78 */
79static inline uint16_t mavlink_msg_safety_set_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
81{
82#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 _mav_put_float(buf, 0, p1x);
85 _mav_put_float(buf, 4, p1y);
86 _mav_put_float(buf, 8, p1z);
87 _mav_put_float(buf, 12, p2x);
88 _mav_put_float(buf, 16, p2y);
89 _mav_put_float(buf, 20, p2z);
90 _mav_put_uint8_t(buf, 24, target_system);
91 _mav_put_uint8_t(buf, 25, target_component);
92 _mav_put_uint8_t(buf, 26, frame);
93
94 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
95#else
96 mavlink_safety_set_allowed_area_t packet;
97 packet.p1x = p1x;
98 packet.p1y = p1y;
99 packet.p1z = p1z;
100 packet.p2x = p2x;
101 packet.p2y = p2y;
102 packet.p2z = p2z;
103 packet.target_system = target_system;
104 packet.target_component = target_component;
105 packet.frame = frame;
106
107 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
108#endif
109
112}
113
114/**
115 * @brief Pack a safety_set_allowed_area message
116 * @param system_id ID of this system
117 * @param component_id ID of this component (e.g. 200 for IMU)
118 * @param status MAVLink status structure
119 * @param msg The MAVLink message to compress the data into
120 *
121 * @param target_system System ID
122 * @param target_component Component ID
123 * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
124 * @param p1x [m] x position 1 / Latitude 1
125 * @param p1y [m] y position 1 / Longitude 1
126 * @param p1z [m] z position 1 / Altitude 1
127 * @param p2x [m] x position 2 / Latitude 2
128 * @param p2y [m] y position 2 / Longitude 2
129 * @param p2z [m] z position 2 / Altitude 2
130 * @return length of the message in bytes (excluding serial stream start sign)
131 */
132static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
133 uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
134{
135#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
137 _mav_put_float(buf, 0, p1x);
138 _mav_put_float(buf, 4, p1y);
139 _mav_put_float(buf, 8, p1z);
140 _mav_put_float(buf, 12, p2x);
141 _mav_put_float(buf, 16, p2y);
142 _mav_put_float(buf, 20, p2z);
143 _mav_put_uint8_t(buf, 24, target_system);
144 _mav_put_uint8_t(buf, 25, target_component);
145 _mav_put_uint8_t(buf, 26, frame);
146
147 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
148#else
149 mavlink_safety_set_allowed_area_t packet;
150 packet.p1x = p1x;
151 packet.p1y = p1y;
152 packet.p1z = p1z;
153 packet.p2x = p2x;
154 packet.p2y = p2y;
155 packet.p2z = p2z;
156 packet.target_system = target_system;
157 packet.target_component = target_component;
158 packet.frame = frame;
159
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
161#endif
162
164#if MAVLINK_CRC_EXTRA
165 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
166#else
167 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
168#endif
169}
170
171/**
172 * @brief Pack a safety_set_allowed_area message on a channel
173 * @param system_id ID of this system
174 * @param component_id ID of this component (e.g. 200 for IMU)
175 * @param chan The MAVLink channel this message will be sent over
176 * @param msg The MAVLink message to compress the data into
177 * @param target_system System ID
178 * @param target_component Component ID
179 * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
180 * @param p1x [m] x position 1 / Latitude 1
181 * @param p1y [m] y position 1 / Longitude 1
182 * @param p1z [m] z position 1 / Altitude 1
183 * @param p2x [m] x position 2 / Latitude 2
184 * @param p2y [m] y position 2 / Longitude 2
185 * @param p2z [m] z position 2 / Altitude 2
186 * @return length of the message in bytes (excluding serial stream start sign)
187 */
188static inline uint16_t mavlink_msg_safety_set_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
189 mavlink_message_t* msg,
190 uint8_t target_system,uint8_t target_component,uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z)
191{
192#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
194 _mav_put_float(buf, 0, p1x);
195 _mav_put_float(buf, 4, p1y);
196 _mav_put_float(buf, 8, p1z);
197 _mav_put_float(buf, 12, p2x);
198 _mav_put_float(buf, 16, p2y);
199 _mav_put_float(buf, 20, p2z);
200 _mav_put_uint8_t(buf, 24, target_system);
201 _mav_put_uint8_t(buf, 25, target_component);
202 _mav_put_uint8_t(buf, 26, frame);
203
204 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
205#else
206 mavlink_safety_set_allowed_area_t packet;
207 packet.p1x = p1x;
208 packet.p1y = p1y;
209 packet.p1z = p1z;
210 packet.p2x = p2x;
211 packet.p2y = p2y;
212 packet.p2z = p2z;
213 packet.target_system = target_system;
214 packet.target_component = target_component;
215 packet.frame = frame;
216
217 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
218#endif
219
222}
223
224/**
225 * @brief Encode a safety_set_allowed_area struct
226 *
227 * @param system_id ID of this system
228 * @param component_id ID of this component (e.g. 200 for IMU)
229 * @param msg The MAVLink message to compress the data into
230 * @param safety_set_allowed_area C-struct to read the message contents from
231 */
232static inline uint16_t mavlink_msg_safety_set_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
233{
234 return mavlink_msg_safety_set_allowed_area_pack(system_id, component_id, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z);
235}
236
237/**
238 * @brief Encode a safety_set_allowed_area struct on a channel
239 *
240 * @param system_id ID of this system
241 * @param component_id ID of this component (e.g. 200 for IMU)
242 * @param chan The MAVLink channel this message will be sent over
243 * @param msg The MAVLink message to compress the data into
244 * @param safety_set_allowed_area C-struct to read the message contents from
245 */
246static inline uint16_t mavlink_msg_safety_set_allowed_area_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
247{
248 return mavlink_msg_safety_set_allowed_area_pack_chan(system_id, component_id, chan, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z);
249}
250
251/**
252 * @brief Encode a safety_set_allowed_area struct with provided status structure
253 *
254 * @param system_id ID of this system
255 * @param component_id ID of this component (e.g. 200 for IMU)
256 * @param status MAVLink status structure
257 * @param msg The MAVLink message to compress the data into
258 * @param safety_set_allowed_area C-struct to read the message contents from
259 */
260static inline uint16_t mavlink_msg_safety_set_allowed_area_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
261{
262 return mavlink_msg_safety_set_allowed_area_pack_status(system_id, component_id, _status, msg, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z);
263}
264
265/**
266 * @brief Send a safety_set_allowed_area message
267 * @param chan MAVLink channel to send the message
268 *
269 * @param target_system System ID
270 * @param target_component Component ID
271 * @param frame Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
272 * @param p1x [m] x position 1 / Latitude 1
273 * @param p1y [m] y position 1 / Longitude 1
274 * @param p1z [m] z position 1 / Altitude 1
275 * @param p2x [m] x position 2 / Latitude 2
276 * @param p2y [m] y position 2 / Longitude 2
277 * @param p2z [m] z position 2 / Altitude 2
278 */
279#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
280
281static inline void mavlink_msg_safety_set_allowed_area_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
282{
283#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
284 char buf[MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN];
285 _mav_put_float(buf, 0, p1x);
286 _mav_put_float(buf, 4, p1y);
287 _mav_put_float(buf, 8, p1z);
288 _mav_put_float(buf, 12, p2x);
289 _mav_put_float(buf, 16, p2y);
290 _mav_put_float(buf, 20, p2z);
291 _mav_put_uint8_t(buf, 24, target_system);
292 _mav_put_uint8_t(buf, 25, target_component);
293 _mav_put_uint8_t(buf, 26, frame);
294
295 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
296#else
297 mavlink_safety_set_allowed_area_t packet;
298 packet.p1x = p1x;
299 packet.p1y = p1y;
300 packet.p1z = p1z;
301 packet.p2x = p2x;
302 packet.p2y = p2y;
303 packet.p2z = p2z;
304 packet.target_system = target_system;
305 packet.target_component = target_component;
306 packet.frame = frame;
307
308 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)&packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
309#endif
310}
311
312/**
313 * @brief Send a safety_set_allowed_area message
314 * @param chan MAVLink channel to send the message
315 * @param struct The MAVLink struct to serialize
316 */
317static inline void mavlink_msg_safety_set_allowed_area_send_struct(mavlink_channel_t chan, const mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
318{
319#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
320 mavlink_msg_safety_set_allowed_area_send(chan, safety_set_allowed_area->target_system, safety_set_allowed_area->target_component, safety_set_allowed_area->frame, safety_set_allowed_area->p1x, safety_set_allowed_area->p1y, safety_set_allowed_area->p1z, safety_set_allowed_area->p2x, safety_set_allowed_area->p2y, safety_set_allowed_area->p2z);
321#else
322 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)safety_set_allowed_area, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
323#endif
324}
325
326#if MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
327/*
328 This variant of _send() can be used to save stack space by reusing
329 memory from the receive buffer. The caller provides a
330 mavlink_message_t which is the size of a full mavlink message. This
331 is usually the receive buffer for the channel, and allows a reply to an
332 incoming message with minimum stack space usage.
333 */
334static inline void mavlink_msg_safety_set_allowed_area_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z)
335{
336#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
337 char *buf = (char *)msgbuf;
338 _mav_put_float(buf, 0, p1x);
339 _mav_put_float(buf, 4, p1y);
340 _mav_put_float(buf, 8, p1z);
341 _mav_put_float(buf, 12, p2x);
342 _mav_put_float(buf, 16, p2y);
343 _mav_put_float(buf, 20, p2z);
344 _mav_put_uint8_t(buf, 24, target_system);
345 _mav_put_uint8_t(buf, 25, target_component);
346 _mav_put_uint8_t(buf, 26, frame);
347
348 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, buf, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
349#else
350 mavlink_safety_set_allowed_area_t *packet = (mavlink_safety_set_allowed_area_t *)msgbuf;
351 packet->p1x = p1x;
352 packet->p1y = p1y;
353 packet->p1z = p1z;
354 packet->p2x = p2x;
355 packet->p2y = p2y;
356 packet->p2z = p2z;
357 packet->target_system = target_system;
358 packet->target_component = target_component;
359 packet->frame = frame;
360
361 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA, (const char *)packet, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_MIN_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_CRC);
362#endif
363}
364#endif
365
366#endif
367
368// MESSAGE SAFETY_SET_ALLOWED_AREA UNPACKING
369
370
371/**
372 * @brief Get field target_system from safety_set_allowed_area message
373 *
374 * @return System ID
375 */
376static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_system(const mavlink_message_t* msg)
377{
378 return _MAV_RETURN_uint8_t(msg, 24);
379}
380
381/**
382 * @brief Get field target_component from safety_set_allowed_area message
383 *
384 * @return Component ID
385 */
386static inline uint8_t mavlink_msg_safety_set_allowed_area_get_target_component(const mavlink_message_t* msg)
387{
388 return _MAV_RETURN_uint8_t(msg, 25);
389}
390
391/**
392 * @brief Get field frame from safety_set_allowed_area message
393 *
394 * @return Coordinate frame. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down.
395 */
396static inline uint8_t mavlink_msg_safety_set_allowed_area_get_frame(const mavlink_message_t* msg)
397{
398 return _MAV_RETURN_uint8_t(msg, 26);
399}
400
401/**
402 * @brief Get field p1x from safety_set_allowed_area message
403 *
404 * @return [m] x position 1 / Latitude 1
405 */
406static inline float mavlink_msg_safety_set_allowed_area_get_p1x(const mavlink_message_t* msg)
407{
408 return _MAV_RETURN_float(msg, 0);
409}
410
411/**
412 * @brief Get field p1y from safety_set_allowed_area message
413 *
414 * @return [m] y position 1 / Longitude 1
415 */
416static inline float mavlink_msg_safety_set_allowed_area_get_p1y(const mavlink_message_t* msg)
417{
418 return _MAV_RETURN_float(msg, 4);
419}
420
421/**
422 * @brief Get field p1z from safety_set_allowed_area message
423 *
424 * @return [m] z position 1 / Altitude 1
425 */
426static inline float mavlink_msg_safety_set_allowed_area_get_p1z(const mavlink_message_t* msg)
427{
428 return _MAV_RETURN_float(msg, 8);
429}
430
431/**
432 * @brief Get field p2x from safety_set_allowed_area message
433 *
434 * @return [m] x position 2 / Latitude 2
435 */
436static inline float mavlink_msg_safety_set_allowed_area_get_p2x(const mavlink_message_t* msg)
437{
438 return _MAV_RETURN_float(msg, 12);
439}
440
441/**
442 * @brief Get field p2y from safety_set_allowed_area message
443 *
444 * @return [m] y position 2 / Longitude 2
445 */
446static inline float mavlink_msg_safety_set_allowed_area_get_p2y(const mavlink_message_t* msg)
447{
448 return _MAV_RETURN_float(msg, 16);
449}
450
451/**
452 * @brief Get field p2z from safety_set_allowed_area message
453 *
454 * @return [m] z position 2 / Altitude 2
455 */
456static inline float mavlink_msg_safety_set_allowed_area_get_p2z(const mavlink_message_t* msg)
457{
458 return _MAV_RETURN_float(msg, 20);
459}
460
461/**
462 * @brief Decode a safety_set_allowed_area message into a struct
463 *
464 * @param msg The message to decode
465 * @param safety_set_allowed_area C-struct to decode the message contents into
466 */
467static inline void mavlink_msg_safety_set_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_set_allowed_area_t* safety_set_allowed_area)
468{
469#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
470 safety_set_allowed_area->p1x = mavlink_msg_safety_set_allowed_area_get_p1x(msg);
471 safety_set_allowed_area->p1y = mavlink_msg_safety_set_allowed_area_get_p1y(msg);
472 safety_set_allowed_area->p1z = mavlink_msg_safety_set_allowed_area_get_p1z(msg);
473 safety_set_allowed_area->p2x = mavlink_msg_safety_set_allowed_area_get_p2x(msg);
474 safety_set_allowed_area->p2y = mavlink_msg_safety_set_allowed_area_get_p2y(msg);
475 safety_set_allowed_area->p2z = mavlink_msg_safety_set_allowed_area_get_p2z(msg);
476 safety_set_allowed_area->target_system = mavlink_msg_safety_set_allowed_area_get_target_system(msg);
477 safety_set_allowed_area->target_component = mavlink_msg_safety_set_allowed_area_get_target_component(msg);
478 safety_set_allowed_area->frame = mavlink_msg_safety_set_allowed_area_get_frame(msg);
479#else
480 uint8_t len = msg->len < MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN? msg->len : MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN;
481 memset(safety_set_allowed_area, 0, MAVLINK_MSG_ID_SAFETY_SET_ALLOWED_AREA_LEN);
482 memcpy(safety_set_allowed_area, _MAV_PAYLOAD(msg), len);
483#endif
484}