Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
1702 | - | 1 | // MESSAGE SAFETY_ALLOWED_AREA PACKING |
2 | |||
3 | #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA 54 |
||
4 | |||
5 | typedef struct __mavlink_safety_allowed_area_t |
||
6 | { |
||
7 | uint8_t frame; ///< Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. |
||
8 | float p1x; ///< x position 1 / Latitude 1 |
||
9 | float p1y; ///< y position 1 / Longitude 1 |
||
10 | float p1z; ///< z position 1 / Altitude 1 |
||
11 | float p2x; ///< x position 2 / Latitude 2 |
||
12 | float p2y; ///< y position 2 / Longitude 2 |
||
13 | float p2z; ///< z position 2 / Altitude 2 |
||
14 | } mavlink_safety_allowed_area_t; |
||
15 | |||
16 | #define MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA_LEN 25 |
||
17 | #define MAVLINK_MSG_ID_54_LEN 25 |
||
18 | |||
19 | |||
20 | |||
21 | #define MAVLINK_MESSAGE_INFO_SAFETY_ALLOWED_AREA { \ |
||
22 | "SAFETY_ALLOWED_AREA", \ |
||
23 | 7, \ |
||
24 | { { "frame", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_safety_allowed_area_t, frame) }, \ |
||
25 | { "p1x", NULL, MAVLINK_TYPE_FLOAT, 0, 1, offsetof(mavlink_safety_allowed_area_t, p1x) }, \ |
||
26 | { "p1y", NULL, MAVLINK_TYPE_FLOAT, 0, 5, offsetof(mavlink_safety_allowed_area_t, p1y) }, \ |
||
27 | { "p1z", NULL, MAVLINK_TYPE_FLOAT, 0, 9, offsetof(mavlink_safety_allowed_area_t, p1z) }, \ |
||
28 | { "p2x", NULL, MAVLINK_TYPE_FLOAT, 0, 13, offsetof(mavlink_safety_allowed_area_t, p2x) }, \ |
||
29 | { "p2y", NULL, MAVLINK_TYPE_FLOAT, 0, 17, offsetof(mavlink_safety_allowed_area_t, p2y) }, \ |
||
30 | { "p2z", NULL, MAVLINK_TYPE_FLOAT, 0, 21, offsetof(mavlink_safety_allowed_area_t, p2z) }, \ |
||
31 | } \ |
||
32 | } |
||
33 | |||
34 | |||
35 | /** |
||
36 | * @brief Pack a safety_allowed_area message |
||
37 | * @param system_id ID of this system |
||
38 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
39 | * @param msg The MAVLink message to compress the data into |
||
40 | * |
||
41 | * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. |
||
42 | * @param p1x x position 1 / Latitude 1 |
||
43 | * @param p1y y position 1 / Longitude 1 |
||
44 | * @param p1z z position 1 / Altitude 1 |
||
45 | * @param p2x x position 2 / Latitude 2 |
||
46 | * @param p2y y position 2 / Longitude 2 |
||
47 | * @param p2z z position 2 / Altitude 2 |
||
48 | * @return length of the message in bytes (excluding serial stream start sign) |
||
49 | */ |
||
50 | static inline uint16_t mavlink_msg_safety_allowed_area_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, |
||
51 | uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) |
||
52 | { |
||
53 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
54 | char buf[25]; |
||
55 | _mav_put_uint8_t(buf, 0, frame); |
||
56 | _mav_put_float(buf, 1, p1x); |
||
57 | _mav_put_float(buf, 5, p1y); |
||
58 | _mav_put_float(buf, 9, p1z); |
||
59 | _mav_put_float(buf, 13, p2x); |
||
60 | _mav_put_float(buf, 17, p2y); |
||
61 | _mav_put_float(buf, 21, p2z); |
||
62 | |||
63 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); |
||
64 | #else |
||
65 | mavlink_safety_allowed_area_t packet; |
||
66 | packet.frame = frame; |
||
67 | packet.p1x = p1x; |
||
68 | packet.p1y = p1y; |
||
69 | packet.p1z = p1z; |
||
70 | packet.p2x = p2x; |
||
71 | packet.p2y = p2y; |
||
72 | packet.p2z = p2z; |
||
73 | |||
74 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); |
||
75 | #endif |
||
76 | |||
77 | msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; |
||
78 | return mavlink_finalize_message(msg, system_id, component_id, 25); |
||
79 | } |
||
80 | |||
81 | /** |
||
82 | * @brief Pack a safety_allowed_area message on a channel |
||
83 | * @param system_id ID of this system |
||
84 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
85 | * @param chan The MAVLink channel this message was sent over |
||
86 | * @param msg The MAVLink message to compress the data into |
||
87 | * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. |
||
88 | * @param p1x x position 1 / Latitude 1 |
||
89 | * @param p1y y position 1 / Longitude 1 |
||
90 | * @param p1z z position 1 / Altitude 1 |
||
91 | * @param p2x x position 2 / Latitude 2 |
||
92 | * @param p2y y position 2 / Longitude 2 |
||
93 | * @param p2z z position 2 / Altitude 2 |
||
94 | * @return length of the message in bytes (excluding serial stream start sign) |
||
95 | */ |
||
96 | static inline uint16_t mavlink_msg_safety_allowed_area_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, |
||
97 | mavlink_message_t* msg, |
||
98 | uint8_t frame,float p1x,float p1y,float p1z,float p2x,float p2y,float p2z) |
||
99 | { |
||
100 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
101 | char buf[25]; |
||
102 | _mav_put_uint8_t(buf, 0, frame); |
||
103 | _mav_put_float(buf, 1, p1x); |
||
104 | _mav_put_float(buf, 5, p1y); |
||
105 | _mav_put_float(buf, 9, p1z); |
||
106 | _mav_put_float(buf, 13, p2x); |
||
107 | _mav_put_float(buf, 17, p2y); |
||
108 | _mav_put_float(buf, 21, p2z); |
||
109 | |||
110 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 25); |
||
111 | #else |
||
112 | mavlink_safety_allowed_area_t packet; |
||
113 | packet.frame = frame; |
||
114 | packet.p1x = p1x; |
||
115 | packet.p1y = p1y; |
||
116 | packet.p1z = p1z; |
||
117 | packet.p2x = p2x; |
||
118 | packet.p2y = p2y; |
||
119 | packet.p2z = p2z; |
||
120 | |||
121 | memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 25); |
||
122 | #endif |
||
123 | |||
124 | msg->msgid = MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA; |
||
125 | return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 25); |
||
126 | } |
||
127 | |||
128 | /** |
||
129 | * @brief Encode a safety_allowed_area struct into a message |
||
130 | * |
||
131 | * @param system_id ID of this system |
||
132 | * @param component_id ID of this component (e.g. 200 for IMU) |
||
133 | * @param msg The MAVLink message to compress the data into |
||
134 | * @param safety_allowed_area C-struct to read the message contents from |
||
135 | */ |
||
136 | static inline uint16_t mavlink_msg_safety_allowed_area_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_safety_allowed_area_t* safety_allowed_area) |
||
137 | { |
||
138 | return mavlink_msg_safety_allowed_area_pack(system_id, component_id, msg, safety_allowed_area->frame, safety_allowed_area->p1x, safety_allowed_area->p1y, safety_allowed_area->p1z, safety_allowed_area->p2x, safety_allowed_area->p2y, safety_allowed_area->p2z); |
||
139 | } |
||
140 | |||
141 | /** |
||
142 | * @brief Send a safety_allowed_area message |
||
143 | * @param chan MAVLink channel to send the message |
||
144 | * |
||
145 | * @param frame Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. |
||
146 | * @param p1x x position 1 / Latitude 1 |
||
147 | * @param p1y y position 1 / Longitude 1 |
||
148 | * @param p1z z position 1 / Altitude 1 |
||
149 | * @param p2x x position 2 / Latitude 2 |
||
150 | * @param p2y y position 2 / Longitude 2 |
||
151 | * @param p2z z position 2 / Altitude 2 |
||
152 | */ |
||
153 | #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS |
||
154 | |||
155 | static inline void mavlink_msg_safety_allowed_area_send(mavlink_channel_t chan, uint8_t frame, float p1x, float p1y, float p1z, float p2x, float p2y, float p2z) |
||
156 | { |
||
157 | #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS |
||
158 | char buf[25]; |
||
159 | _mav_put_uint8_t(buf, 0, frame); |
||
160 | _mav_put_float(buf, 1, p1x); |
||
161 | _mav_put_float(buf, 5, p1y); |
||
162 | _mav_put_float(buf, 9, p1z); |
||
163 | _mav_put_float(buf, 13, p2x); |
||
164 | _mav_put_float(buf, 17, p2y); |
||
165 | _mav_put_float(buf, 21, p2z); |
||
166 | |||
167 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, buf, 25); |
||
168 | #else |
||
169 | mavlink_safety_allowed_area_t packet; |
||
170 | packet.frame = frame; |
||
171 | packet.p1x = p1x; |
||
172 | packet.p1y = p1y; |
||
173 | packet.p1z = p1z; |
||
174 | packet.p2x = p2x; |
||
175 | packet.p2y = p2y; |
||
176 | packet.p2z = p2z; |
||
177 | |||
178 | _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_SAFETY_ALLOWED_AREA, (const char *)&packet, 25); |
||
179 | #endif |
||
180 | } |
||
181 | |||
182 | #endif |
||
183 | |||
184 | // MESSAGE SAFETY_ALLOWED_AREA UNPACKING |
||
185 | |||
186 | |||
187 | /** |
||
188 | * @brief Get field frame from safety_allowed_area message |
||
189 | * |
||
190 | * @return Coordinate frame, as defined by MAV_FRAME enum in mavlink_types.h. Can be either global, GPS, right-handed with Z axis up or local, right handed, Z axis down. |
||
191 | */ |
||
192 | static inline uint8_t mavlink_msg_safety_allowed_area_get_frame(const mavlink_message_t* msg) |
||
193 | { |
||
194 | return _MAV_RETURN_uint8_t(msg, 0); |
||
195 | } |
||
196 | |||
197 | /** |
||
198 | * @brief Get field p1x from safety_allowed_area message |
||
199 | * |
||
200 | * @return x position 1 / Latitude 1 |
||
201 | */ |
||
202 | static inline float mavlink_msg_safety_allowed_area_get_p1x(const mavlink_message_t* msg) |
||
203 | { |
||
204 | return _MAV_RETURN_float(msg, 1); |
||
205 | } |
||
206 | |||
207 | /** |
||
208 | * @brief Get field p1y from safety_allowed_area message |
||
209 | * |
||
210 | * @return y position 1 / Longitude 1 |
||
211 | */ |
||
212 | static inline float mavlink_msg_safety_allowed_area_get_p1y(const mavlink_message_t* msg) |
||
213 | { |
||
214 | return _MAV_RETURN_float(msg, 5); |
||
215 | } |
||
216 | |||
217 | /** |
||
218 | * @brief Get field p1z from safety_allowed_area message |
||
219 | * |
||
220 | * @return z position 1 / Altitude 1 |
||
221 | */ |
||
222 | static inline float mavlink_msg_safety_allowed_area_get_p1z(const mavlink_message_t* msg) |
||
223 | { |
||
224 | return _MAV_RETURN_float(msg, 9); |
||
225 | } |
||
226 | |||
227 | /** |
||
228 | * @brief Get field p2x from safety_allowed_area message |
||
229 | * |
||
230 | * @return x position 2 / Latitude 2 |
||
231 | */ |
||
232 | static inline float mavlink_msg_safety_allowed_area_get_p2x(const mavlink_message_t* msg) |
||
233 | { |
||
234 | return _MAV_RETURN_float(msg, 13); |
||
235 | } |
||
236 | |||
237 | /** |
||
238 | * @brief Get field p2y from safety_allowed_area message |
||
239 | * |
||
240 | * @return y position 2 / Longitude 2 |
||
241 | */ |
||
242 | static inline float mavlink_msg_safety_allowed_area_get_p2y(const mavlink_message_t* msg) |
||
243 | { |
||
244 | return _MAV_RETURN_float(msg, 17); |
||
245 | } |
||
246 | |||
247 | /** |
||
248 | * @brief Get field p2z from safety_allowed_area message |
||
249 | * |
||
250 | * @return z position 2 / Altitude 2 |
||
251 | */ |
||
252 | static inline float mavlink_msg_safety_allowed_area_get_p2z(const mavlink_message_t* msg) |
||
253 | { |
||
254 | return _MAV_RETURN_float(msg, 21); |
||
255 | } |
||
256 | |||
257 | /** |
||
258 | * @brief Decode a safety_allowed_area message into a struct |
||
259 | * |
||
260 | * @param msg The message to decode |
||
261 | * @param safety_allowed_area C-struct to decode the message contents into |
||
262 | */ |
||
263 | static inline void mavlink_msg_safety_allowed_area_decode(const mavlink_message_t* msg, mavlink_safety_allowed_area_t* safety_allowed_area) |
||
264 | { |
||
265 | #if MAVLINK_NEED_BYTE_SWAP |
||
266 | safety_allowed_area->frame = mavlink_msg_safety_allowed_area_get_frame(msg); |
||
267 | safety_allowed_area->p1x = mavlink_msg_safety_allowed_area_get_p1x(msg); |
||
268 | safety_allowed_area->p1y = mavlink_msg_safety_allowed_area_get_p1y(msg); |
||
269 | safety_allowed_area->p1z = mavlink_msg_safety_allowed_area_get_p1z(msg); |
||
270 | safety_allowed_area->p2x = mavlink_msg_safety_allowed_area_get_p2x(msg); |
||
271 | safety_allowed_area->p2y = mavlink_msg_safety_allowed_area_get_p2y(msg); |
||
272 | safety_allowed_area->p2z = mavlink_msg_safety_allowed_area_get_p2z(msg); |
||
273 | #else |
||
274 | memcpy(safety_allowed_area, _MAV_PAYLOAD(msg), 25); |
||
275 | #endif |
||
276 | } |