NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_asl_obctrl.h
Go to the documentation of this file.
1 // MESSAGE ASL_OBCTRL PACKING
2 
3 #define MAVLINK_MSG_ID_ASL_OBCTRL 207
4 
5 typedef struct __mavlink_asl_obctrl_t
6 {
7  uint64_t timestamp;
8  float uElev;
9  float uThrot;
10  float uThrot2;
11  float uAilL;
12  float uAilR;
13  float uRud;
14  uint8_t obctrl_status;
16 
17 #define MAVLINK_MSG_ID_ASL_OBCTRL_LEN 33
18 #define MAVLINK_MSG_ID_207_LEN 33
19 
20 #define MAVLINK_MSG_ID_ASL_OBCTRL_CRC 234
21 #define MAVLINK_MSG_ID_207_CRC 234
22 
23 
24 
25 #define MAVLINK_MESSAGE_INFO_ASL_OBCTRL { \
26  "ASL_OBCTRL", \
27  8, \
28  { { "timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_asl_obctrl_t, timestamp) }, \
29  { "uElev", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_asl_obctrl_t, uElev) }, \
30  { "uThrot", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_asl_obctrl_t, uThrot) }, \
31  { "uThrot2", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_asl_obctrl_t, uThrot2) }, \
32  { "uAilL", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_asl_obctrl_t, uAilL) }, \
33  { "uAilR", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_asl_obctrl_t, uAilR) }, \
34  { "uRud", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_asl_obctrl_t, uRud) }, \
35  { "obctrl_status", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_asl_obctrl_t, obctrl_status) }, \
36  } \
37 }
38 
39 
56 static inline uint16_t mavlink_msg_asl_obctrl_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
57  uint64_t timestamp, float uElev, float uThrot, float uThrot2, float uAilL, float uAilR, float uRud, uint8_t obctrl_status)
58 {
59 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
61  _mav_put_uint64_t(buf, 0, timestamp);
62  _mav_put_float(buf, 8, uElev);
63  _mav_put_float(buf, 12, uThrot);
64  _mav_put_float(buf, 16, uThrot2);
65  _mav_put_float(buf, 20, uAilL);
66  _mav_put_float(buf, 24, uAilR);
67  _mav_put_float(buf, 28, uRud);
68  _mav_put_uint8_t(buf, 32, obctrl_status);
69 
71 #else
72  mavlink_asl_obctrl_t packet;
73  packet.timestamp = timestamp;
74  packet.uElev = uElev;
75  packet.uThrot = uThrot;
76  packet.uThrot2 = uThrot2;
77  packet.uAilL = uAilL;
78  packet.uAilR = uAilR;
79  packet.uRud = uRud;
80  packet.obctrl_status = obctrl_status;
81 
83 #endif
84 
85  msg->msgid = MAVLINK_MSG_ID_ASL_OBCTRL;
86 #if MAVLINK_CRC_EXTRA
88 #else
89  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
90 #endif
91 }
92 
109 static inline uint16_t mavlink_msg_asl_obctrl_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
110  mavlink_message_t* msg,
111  uint64_t timestamp,float uElev,float uThrot,float uThrot2,float uAilL,float uAilR,float uRud,uint8_t obctrl_status)
112 {
113 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
115  _mav_put_uint64_t(buf, 0, timestamp);
116  _mav_put_float(buf, 8, uElev);
117  _mav_put_float(buf, 12, uThrot);
118  _mav_put_float(buf, 16, uThrot2);
119  _mav_put_float(buf, 20, uAilL);
120  _mav_put_float(buf, 24, uAilR);
121  _mav_put_float(buf, 28, uRud);
122  _mav_put_uint8_t(buf, 32, obctrl_status);
123 
125 #else
126  mavlink_asl_obctrl_t packet;
127  packet.timestamp = timestamp;
128  packet.uElev = uElev;
129  packet.uThrot = uThrot;
130  packet.uThrot2 = uThrot2;
131  packet.uAilL = uAilL;
132  packet.uAilR = uAilR;
133  packet.uRud = uRud;
134  packet.obctrl_status = obctrl_status;
135 
137 #endif
138 
139  msg->msgid = MAVLINK_MSG_ID_ASL_OBCTRL;
140 #if MAVLINK_CRC_EXTRA
142 #else
143  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
144 #endif
145 }
146 
155 static inline uint16_t mavlink_msg_asl_obctrl_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_asl_obctrl_t* asl_obctrl)
156 {
157  return mavlink_msg_asl_obctrl_pack(system_id, component_id, msg, asl_obctrl->timestamp, asl_obctrl->uElev, asl_obctrl->uThrot, asl_obctrl->uThrot2, asl_obctrl->uAilL, asl_obctrl->uAilR, asl_obctrl->uRud, asl_obctrl->obctrl_status);
158 }
159 
169 static inline uint16_t mavlink_msg_asl_obctrl_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_asl_obctrl_t* asl_obctrl)
170 {
171  return mavlink_msg_asl_obctrl_pack_chan(system_id, component_id, chan, msg, asl_obctrl->timestamp, asl_obctrl->uElev, asl_obctrl->uThrot, asl_obctrl->uThrot2, asl_obctrl->uAilL, asl_obctrl->uAilR, asl_obctrl->uRud, asl_obctrl->obctrl_status);
172 }
173 
187 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
188 
189 static inline void mavlink_msg_asl_obctrl_send(mavlink_channel_t chan, uint64_t timestamp, float uElev, float uThrot, float uThrot2, float uAilL, float uAilR, float uRud, uint8_t obctrl_status)
190 {
191 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193  _mav_put_uint64_t(buf, 0, timestamp);
194  _mav_put_float(buf, 8, uElev);
195  _mav_put_float(buf, 12, uThrot);
196  _mav_put_float(buf, 16, uThrot2);
197  _mav_put_float(buf, 20, uAilL);
198  _mav_put_float(buf, 24, uAilR);
199  _mav_put_float(buf, 28, uRud);
200  _mav_put_uint8_t(buf, 32, obctrl_status);
201 
202 #if MAVLINK_CRC_EXTRA
203  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
204 #else
205  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
206 #endif
207 #else
208  mavlink_asl_obctrl_t packet;
209  packet.timestamp = timestamp;
210  packet.uElev = uElev;
211  packet.uThrot = uThrot;
212  packet.uThrot2 = uThrot2;
213  packet.uAilL = uAilL;
214  packet.uAilR = uAilR;
215  packet.uRud = uRud;
216  packet.obctrl_status = obctrl_status;
217 
218 #if MAVLINK_CRC_EXTRA
219  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)&packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
220 #else
221  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)&packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
222 #endif
223 #endif
224 }
225 
226 #if MAVLINK_MSG_ID_ASL_OBCTRL_LEN <= MAVLINK_MAX_PAYLOAD_LEN
227 /*
228  This varient of _send() can be used to save stack space by re-using
229  memory from the receive buffer. The caller provides a
230  mavlink_message_t which is the size of a full mavlink message. This
231  is usually the receive buffer for the channel, and allows a reply to an
232  incoming message with minimum stack space usage.
233  */
234 static inline void mavlink_msg_asl_obctrl_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t timestamp, float uElev, float uThrot, float uThrot2, float uAilL, float uAilR, float uRud, uint8_t obctrl_status)
235 {
236 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
237  char *buf = (char *)msgbuf;
238  _mav_put_uint64_t(buf, 0, timestamp);
239  _mav_put_float(buf, 8, uElev);
240  _mav_put_float(buf, 12, uThrot);
241  _mav_put_float(buf, 16, uThrot2);
242  _mav_put_float(buf, 20, uAilL);
243  _mav_put_float(buf, 24, uAilR);
244  _mav_put_float(buf, 28, uRud);
245  _mav_put_uint8_t(buf, 32, obctrl_status);
246 
247 #if MAVLINK_CRC_EXTRA
248  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
249 #else
250  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, buf, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
251 #endif
252 #else
253  mavlink_asl_obctrl_t *packet = (mavlink_asl_obctrl_t *)msgbuf;
254  packet->timestamp = timestamp;
255  packet->uElev = uElev;
256  packet->uThrot = uThrot;
257  packet->uThrot2 = uThrot2;
258  packet->uAilL = uAilL;
259  packet->uAilR = uAilR;
260  packet->uRud = uRud;
261  packet->obctrl_status = obctrl_status;
262 
263 #if MAVLINK_CRC_EXTRA
264  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN, MAVLINK_MSG_ID_ASL_OBCTRL_CRC);
265 #else
266  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ASL_OBCTRL, (const char *)packet, MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
267 #endif
268 #endif
269 }
270 #endif
271 
272 #endif
273 
274 // MESSAGE ASL_OBCTRL UNPACKING
275 
276 
282 static inline uint64_t mavlink_msg_asl_obctrl_get_timestamp(const mavlink_message_t* msg)
283 {
284  return _MAV_RETURN_uint64_t(msg, 0);
285 }
286 
292 static inline float mavlink_msg_asl_obctrl_get_uElev(const mavlink_message_t* msg)
293 {
294  return _MAV_RETURN_float(msg, 8);
295 }
296 
302 static inline float mavlink_msg_asl_obctrl_get_uThrot(const mavlink_message_t* msg)
303 {
304  return _MAV_RETURN_float(msg, 12);
305 }
306 
312 static inline float mavlink_msg_asl_obctrl_get_uThrot2(const mavlink_message_t* msg)
313 {
314  return _MAV_RETURN_float(msg, 16);
315 }
316 
322 static inline float mavlink_msg_asl_obctrl_get_uAilL(const mavlink_message_t* msg)
323 {
324  return _MAV_RETURN_float(msg, 20);
325 }
326 
332 static inline float mavlink_msg_asl_obctrl_get_uAilR(const mavlink_message_t* msg)
333 {
334  return _MAV_RETURN_float(msg, 24);
335 }
336 
342 static inline float mavlink_msg_asl_obctrl_get_uRud(const mavlink_message_t* msg)
343 {
344  return _MAV_RETURN_float(msg, 28);
345 }
346 
352 static inline uint8_t mavlink_msg_asl_obctrl_get_obctrl_status(const mavlink_message_t* msg)
353 {
354  return _MAV_RETURN_uint8_t(msg, 32);
355 }
356 
363 static inline void mavlink_msg_asl_obctrl_decode(const mavlink_message_t* msg, mavlink_asl_obctrl_t* asl_obctrl)
364 {
365 #if MAVLINK_NEED_BYTE_SWAP
366  asl_obctrl->timestamp = mavlink_msg_asl_obctrl_get_timestamp(msg);
367  asl_obctrl->uElev = mavlink_msg_asl_obctrl_get_uElev(msg);
368  asl_obctrl->uThrot = mavlink_msg_asl_obctrl_get_uThrot(msg);
369  asl_obctrl->uThrot2 = mavlink_msg_asl_obctrl_get_uThrot2(msg);
370  asl_obctrl->uAilL = mavlink_msg_asl_obctrl_get_uAilL(msg);
371  asl_obctrl->uAilR = mavlink_msg_asl_obctrl_get_uAilR(msg);
372  asl_obctrl->uRud = mavlink_msg_asl_obctrl_get_uRud(msg);
373  asl_obctrl->obctrl_status = mavlink_msg_asl_obctrl_get_obctrl_status(msg);
374 #else
375  memcpy(asl_obctrl, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_ASL_OBCTRL_LEN);
376 #endif
377 }
#define _mav_put_float(buf, wire_offset, b)
Definition: protocol.h:145
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134
#define _mav_put_uint64_t(buf, wire_offset, b)
Definition: protocol.h:143