RflySimSDK v3.05
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_isr_location.h
1#pragma once
2// MESSAGE ISR_LOCATION PACKING
3
4#define MAVLINK_MSG_ID_ISR_LOCATION 189
5
6MAVPACKED(
7typedef struct __mavlink_isr_location_t {
8 float latitude; /*< ISR Latitude*/
9 float longitude; /*< ISR Longitude*/
10 float height; /*< ISR Height*/
11 uint8_t target; /*< The system reporting the action*/
12 uint8_t option1; /*< Option 1*/
13 uint8_t option2; /*< Option 2*/
14 uint8_t option3; /*< Option 3*/
15}) mavlink_isr_location_t;
16
17#define MAVLINK_MSG_ID_ISR_LOCATION_LEN 16
18#define MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN 16
19#define MAVLINK_MSG_ID_189_LEN 16
20#define MAVLINK_MSG_ID_189_MIN_LEN 16
21
22#define MAVLINK_MSG_ID_ISR_LOCATION_CRC 246
23#define MAVLINK_MSG_ID_189_CRC 246
24
25
26
27#if MAVLINK_COMMAND_24BIT
28#define MAVLINK_MESSAGE_INFO_ISR_LOCATION { \
29 189, \
30 "ISR_LOCATION", \
31 7, \
32 { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_isr_location_t, target) }, \
33 { "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_isr_location_t, latitude) }, \
34 { "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_isr_location_t, longitude) }, \
35 { "height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_isr_location_t, height) }, \
36 { "option1", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_isr_location_t, option1) }, \
37 { "option2", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_isr_location_t, option2) }, \
38 { "option3", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_isr_location_t, option3) }, \
39 } \
40}
41#else
42#define MAVLINK_MESSAGE_INFO_ISR_LOCATION { \
43 "ISR_LOCATION", \
44 7, \
45 { { "target", NULL, MAVLINK_TYPE_UINT8_T, 0, 12, offsetof(mavlink_isr_location_t, target) }, \
46 { "latitude", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_isr_location_t, latitude) }, \
47 { "longitude", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_isr_location_t, longitude) }, \
48 { "height", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_isr_location_t, height) }, \
49 { "option1", NULL, MAVLINK_TYPE_UINT8_T, 0, 13, offsetof(mavlink_isr_location_t, option1) }, \
50 { "option2", NULL, MAVLINK_TYPE_UINT8_T, 0, 14, offsetof(mavlink_isr_location_t, option2) }, \
51 { "option3", NULL, MAVLINK_TYPE_UINT8_T, 0, 15, offsetof(mavlink_isr_location_t, option3) }, \
52 } \
53}
54#endif
55
71static inline uint16_t mavlink_msg_isr_location_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
72 uint8_t target, float latitude, float longitude, float height, uint8_t option1, uint8_t option2, uint8_t option3)
73{
74#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
75 char buf[MAVLINK_MSG_ID_ISR_LOCATION_LEN];
76 _mav_put_float(buf, 0, latitude);
77 _mav_put_float(buf, 4, longitude);
78 _mav_put_float(buf, 8, height);
79 _mav_put_uint8_t(buf, 12, target);
80 _mav_put_uint8_t(buf, 13, option1);
81 _mav_put_uint8_t(buf, 14, option2);
82 _mav_put_uint8_t(buf, 15, option3);
83
84 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
85#else
86 mavlink_isr_location_t packet;
87 packet.latitude = latitude;
88 packet.longitude = longitude;
89 packet.height = height;
90 packet.target = target;
91 packet.option1 = option1;
92 packet.option2 = option2;
93 packet.option3 = option3;
94
95 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
96#endif
97
98 msg->msgid = MAVLINK_MSG_ID_ISR_LOCATION;
99 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
100}
101
117static inline uint16_t mavlink_msg_isr_location_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
118 mavlink_message_t* msg,
119 uint8_t target,float latitude,float longitude,float height,uint8_t option1,uint8_t option2,uint8_t option3)
120{
121#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
122 char buf[MAVLINK_MSG_ID_ISR_LOCATION_LEN];
123 _mav_put_float(buf, 0, latitude);
124 _mav_put_float(buf, 4, longitude);
125 _mav_put_float(buf, 8, height);
126 _mav_put_uint8_t(buf, 12, target);
127 _mav_put_uint8_t(buf, 13, option1);
128 _mav_put_uint8_t(buf, 14, option2);
129 _mav_put_uint8_t(buf, 15, option3);
130
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
132#else
133 mavlink_isr_location_t packet;
134 packet.latitude = latitude;
135 packet.longitude = longitude;
136 packet.height = height;
137 packet.target = target;
138 packet.option1 = option1;
139 packet.option2 = option2;
140 packet.option3 = option3;
141
142 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
143#endif
144
145 msg->msgid = MAVLINK_MSG_ID_ISR_LOCATION;
146 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
147}
148
157static inline uint16_t mavlink_msg_isr_location_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_isr_location_t* isr_location)
158{
159 return mavlink_msg_isr_location_pack(system_id, component_id, msg, isr_location->target, isr_location->latitude, isr_location->longitude, isr_location->height, isr_location->option1, isr_location->option2, isr_location->option3);
160}
161
171static inline uint16_t mavlink_msg_isr_location_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_isr_location_t* isr_location)
172{
173 return mavlink_msg_isr_location_pack_chan(system_id, component_id, chan, msg, isr_location->target, isr_location->latitude, isr_location->longitude, isr_location->height, isr_location->option1, isr_location->option2, isr_location->option3);
174}
175
188#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
189
190static inline void mavlink_msg_isr_location_send(mavlink_channel_t chan, uint8_t target, float latitude, float longitude, float height, uint8_t option1, uint8_t option2, uint8_t option3)
191{
192#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193 char buf[MAVLINK_MSG_ID_ISR_LOCATION_LEN];
194 _mav_put_float(buf, 0, latitude);
195 _mav_put_float(buf, 4, longitude);
196 _mav_put_float(buf, 8, height);
197 _mav_put_uint8_t(buf, 12, target);
198 _mav_put_uint8_t(buf, 13, option1);
199 _mav_put_uint8_t(buf, 14, option2);
200 _mav_put_uint8_t(buf, 15, option3);
201
202 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, buf, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
203#else
204 mavlink_isr_location_t packet;
205 packet.latitude = latitude;
206 packet.longitude = longitude;
207 packet.height = height;
208 packet.target = target;
209 packet.option1 = option1;
210 packet.option2 = option2;
211 packet.option3 = option3;
212
213 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, (const char *)&packet, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
214#endif
215}
216
222static inline void mavlink_msg_isr_location_send_struct(mavlink_channel_t chan, const mavlink_isr_location_t* isr_location)
223{
224#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
225 mavlink_msg_isr_location_send(chan, isr_location->target, isr_location->latitude, isr_location->longitude, isr_location->height, isr_location->option1, isr_location->option2, isr_location->option3);
226#else
227 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, (const char *)isr_location, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
228#endif
229}
230
231#if MAVLINK_MSG_ID_ISR_LOCATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
232/*
233 This varient of _send() can be used to save stack space by re-using
234 memory from the receive buffer. The caller provides a
235 mavlink_message_t which is the size of a full mavlink message. This
236 is usually the receive buffer for the channel, and allows a reply to an
237 incoming message with minimum stack space usage.
238 */
239static inline void mavlink_msg_isr_location_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target, float latitude, float longitude, float height, uint8_t option1, uint8_t option2, uint8_t option3)
240{
241#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
242 char *buf = (char *)msgbuf;
243 _mav_put_float(buf, 0, latitude);
244 _mav_put_float(buf, 4, longitude);
245 _mav_put_float(buf, 8, height);
246 _mav_put_uint8_t(buf, 12, target);
247 _mav_put_uint8_t(buf, 13, option1);
248 _mav_put_uint8_t(buf, 14, option2);
249 _mav_put_uint8_t(buf, 15, option3);
250
251 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, buf, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
252#else
253 mavlink_isr_location_t *packet = (mavlink_isr_location_t *)msgbuf;
254 packet->latitude = latitude;
255 packet->longitude = longitude;
256 packet->height = height;
257 packet->target = target;
258 packet->option1 = option1;
259 packet->option2 = option2;
260 packet->option3 = option3;
261
262 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ISR_LOCATION, (const char *)packet, MAVLINK_MSG_ID_ISR_LOCATION_MIN_LEN, MAVLINK_MSG_ID_ISR_LOCATION_LEN, MAVLINK_MSG_ID_ISR_LOCATION_CRC);
263#endif
264}
265#endif
266
267#endif
268
269// MESSAGE ISR_LOCATION UNPACKING
270
271
277static inline uint8_t mavlink_msg_isr_location_get_target(const mavlink_message_t* msg)
278{
279 return _MAV_RETURN_uint8_t(msg, 12);
280}
281
287static inline float mavlink_msg_isr_location_get_latitude(const mavlink_message_t* msg)
288{
289 return _MAV_RETURN_float(msg, 0);
290}
291
297static inline float mavlink_msg_isr_location_get_longitude(const mavlink_message_t* msg)
298{
299 return _MAV_RETURN_float(msg, 4);
300}
301
307static inline float mavlink_msg_isr_location_get_height(const mavlink_message_t* msg)
308{
309 return _MAV_RETURN_float(msg, 8);
310}
311
317static inline uint8_t mavlink_msg_isr_location_get_option1(const mavlink_message_t* msg)
318{
319 return _MAV_RETURN_uint8_t(msg, 13);
320}
321
327static inline uint8_t mavlink_msg_isr_location_get_option2(const mavlink_message_t* msg)
328{
329 return _MAV_RETURN_uint8_t(msg, 14);
330}
331
337static inline uint8_t mavlink_msg_isr_location_get_option3(const mavlink_message_t* msg)
338{
339 return _MAV_RETURN_uint8_t(msg, 15);
340}
341
348static inline void mavlink_msg_isr_location_decode(const mavlink_message_t* msg, mavlink_isr_location_t* isr_location)
349{
350#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
351 isr_location->latitude = mavlink_msg_isr_location_get_latitude(msg);
352 isr_location->longitude = mavlink_msg_isr_location_get_longitude(msg);
353 isr_location->height = mavlink_msg_isr_location_get_height(msg);
354 isr_location->target = mavlink_msg_isr_location_get_target(msg);
355 isr_location->option1 = mavlink_msg_isr_location_get_option1(msg);
356 isr_location->option2 = mavlink_msg_isr_location_get_option2(msg);
357 isr_location->option3 = mavlink_msg_isr_location_get_option3(msg);
358#else
359 uint8_t len = msg->len < MAVLINK_MSG_ID_ISR_LOCATION_LEN? msg->len : MAVLINK_MSG_ID_ISR_LOCATION_LEN;
360 memset(isr_location, 0, MAVLINK_MSG_ID_ISR_LOCATION_LEN);
361 memcpy(isr_location, _MAV_PAYLOAD(msg), len);
362#endif
363}