NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_mount_configure.h
Go to the documentation of this file.
1 // MESSAGE MOUNT_CONFIGURE PACKING
2 
3 #define MAVLINK_MSG_ID_MOUNT_CONFIGURE 156
4 
6 {
7  uint8_t target_system;
8  uint8_t target_component;
9  uint8_t mount_mode;
10  uint8_t stab_roll;
11  uint8_t stab_pitch;
12  uint8_t stab_yaw;
14 
15 #define MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN 6
16 #define MAVLINK_MSG_ID_156_LEN 6
17 
18 #define MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC 19
19 #define MAVLINK_MSG_ID_156_CRC 19
20 
21 
22 
23 #define MAVLINK_MESSAGE_INFO_MOUNT_CONFIGURE { \
24  "MOUNT_CONFIGURE", \
25  6, \
26  { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mount_configure_t, target_system) }, \
27  { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mount_configure_t, target_component) }, \
28  { "mount_mode", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_mount_configure_t, mount_mode) }, \
29  { "stab_roll", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_mount_configure_t, stab_roll) }, \
30  { "stab_pitch", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mount_configure_t, stab_pitch) }, \
31  { "stab_yaw", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mount_configure_t, stab_yaw) }, \
32  } \
33 }
34 
35 
50 static inline uint16_t mavlink_msg_mount_configure_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
51  uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
52 {
53 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
55  _mav_put_uint8_t(buf, 0, target_system);
56  _mav_put_uint8_t(buf, 1, target_component);
57  _mav_put_uint8_t(buf, 2, mount_mode);
58  _mav_put_uint8_t(buf, 3, stab_roll);
59  _mav_put_uint8_t(buf, 4, stab_pitch);
60  _mav_put_uint8_t(buf, 5, stab_yaw);
61 
63 #else
65  packet.target_system = target_system;
66  packet.target_component = target_component;
67  packet.mount_mode = mount_mode;
68  packet.stab_roll = stab_roll;
69  packet.stab_pitch = stab_pitch;
70  packet.stab_yaw = stab_yaw;
71 
73 #endif
74 
75  msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
76 #if MAVLINK_CRC_EXTRA
78 #else
79  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
80 #endif
81 }
82 
97 static inline uint16_t mavlink_msg_mount_configure_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
98  mavlink_message_t* msg,
99  uint8_t target_system,uint8_t target_component,uint8_t mount_mode,uint8_t stab_roll,uint8_t stab_pitch,uint8_t stab_yaw)
100 {
101 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
103  _mav_put_uint8_t(buf, 0, target_system);
104  _mav_put_uint8_t(buf, 1, target_component);
105  _mav_put_uint8_t(buf, 2, mount_mode);
106  _mav_put_uint8_t(buf, 3, stab_roll);
107  _mav_put_uint8_t(buf, 4, stab_pitch);
108  _mav_put_uint8_t(buf, 5, stab_yaw);
109 
111 #else
113  packet.target_system = target_system;
114  packet.target_component = target_component;
115  packet.mount_mode = mount_mode;
116  packet.stab_roll = stab_roll;
117  packet.stab_pitch = stab_pitch;
118  packet.stab_yaw = stab_yaw;
119 
121 #endif
122 
123  msg->msgid = MAVLINK_MSG_ID_MOUNT_CONFIGURE;
124 #if MAVLINK_CRC_EXTRA
126 #else
127  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
128 #endif
129 }
130 
139 static inline uint16_t mavlink_msg_mount_configure_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure)
140 {
141  return mavlink_msg_mount_configure_pack(system_id, component_id, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
142 }
143 
153 static inline uint16_t mavlink_msg_mount_configure_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mount_configure_t* mount_configure)
154 {
155  return mavlink_msg_mount_configure_pack_chan(system_id, component_id, chan, msg, mount_configure->target_system, mount_configure->target_component, mount_configure->mount_mode, mount_configure->stab_roll, mount_configure->stab_pitch, mount_configure->stab_yaw);
156 }
157 
169 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
170 
171 static inline void mavlink_msg_mount_configure_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
172 {
173 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
175  _mav_put_uint8_t(buf, 0, target_system);
176  _mav_put_uint8_t(buf, 1, target_component);
177  _mav_put_uint8_t(buf, 2, mount_mode);
178  _mav_put_uint8_t(buf, 3, stab_roll);
179  _mav_put_uint8_t(buf, 4, stab_pitch);
180  _mav_put_uint8_t(buf, 5, stab_yaw);
181 
182 #if MAVLINK_CRC_EXTRA
184 #else
185  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
186 #endif
187 #else
189  packet.target_system = target_system;
190  packet.target_component = target_component;
191  packet.mount_mode = mount_mode;
192  packet.stab_roll = stab_roll;
193  packet.stab_pitch = stab_pitch;
194  packet.stab_yaw = stab_yaw;
195 
196 #if MAVLINK_CRC_EXTRA
197  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
198 #else
199  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)&packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
200 #endif
201 #endif
202 }
203 
204 #if MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
205 /*
206  This varient of _send() can be used to save stack space by re-using
207  memory from the receive buffer. The caller provides a
208  mavlink_message_t which is the size of a full mavlink message. This
209  is usually the receive buffer for the channel, and allows a reply to an
210  incoming message with minimum stack space usage.
211  */
212 static inline void mavlink_msg_mount_configure_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t mount_mode, uint8_t stab_roll, uint8_t stab_pitch, uint8_t stab_yaw)
213 {
214 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
215  char *buf = (char *)msgbuf;
216  _mav_put_uint8_t(buf, 0, target_system);
217  _mav_put_uint8_t(buf, 1, target_component);
218  _mav_put_uint8_t(buf, 2, mount_mode);
219  _mav_put_uint8_t(buf, 3, stab_roll);
220  _mav_put_uint8_t(buf, 4, stab_pitch);
221  _mav_put_uint8_t(buf, 5, stab_yaw);
222 
223 #if MAVLINK_CRC_EXTRA
225 #else
226  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, buf, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
227 #endif
228 #else
230  packet->target_system = target_system;
231  packet->target_component = target_component;
232  packet->mount_mode = mount_mode;
233  packet->stab_roll = stab_roll;
234  packet->stab_pitch = stab_pitch;
235  packet->stab_yaw = stab_yaw;
236 
237 #if MAVLINK_CRC_EXTRA
238  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN, MAVLINK_MSG_ID_MOUNT_CONFIGURE_CRC);
239 #else
240  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MOUNT_CONFIGURE, (const char *)packet, MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
241 #endif
242 #endif
243 }
244 #endif
245 
246 #endif
247 
248 // MESSAGE MOUNT_CONFIGURE UNPACKING
249 
250 
256 static inline uint8_t mavlink_msg_mount_configure_get_target_system(const mavlink_message_t* msg)
257 {
258  return _MAV_RETURN_uint8_t(msg, 0);
259 }
260 
266 static inline uint8_t mavlink_msg_mount_configure_get_target_component(const mavlink_message_t* msg)
267 {
268  return _MAV_RETURN_uint8_t(msg, 1);
269 }
270 
276 static inline uint8_t mavlink_msg_mount_configure_get_mount_mode(const mavlink_message_t* msg)
277 {
278  return _MAV_RETURN_uint8_t(msg, 2);
279 }
280 
286 static inline uint8_t mavlink_msg_mount_configure_get_stab_roll(const mavlink_message_t* msg)
287 {
288  return _MAV_RETURN_uint8_t(msg, 3);
289 }
290 
296 static inline uint8_t mavlink_msg_mount_configure_get_stab_pitch(const mavlink_message_t* msg)
297 {
298  return _MAV_RETURN_uint8_t(msg, 4);
299 }
300 
306 static inline uint8_t mavlink_msg_mount_configure_get_stab_yaw(const mavlink_message_t* msg)
307 {
308  return _MAV_RETURN_uint8_t(msg, 5);
309 }
310 
317 static inline void mavlink_msg_mount_configure_decode(const mavlink_message_t* msg, mavlink_mount_configure_t* mount_configure)
318 {
319 #if MAVLINK_NEED_BYTE_SWAP
320  mount_configure->target_system = mavlink_msg_mount_configure_get_target_system(msg);
321  mount_configure->target_component = mavlink_msg_mount_configure_get_target_component(msg);
322  mount_configure->mount_mode = mavlink_msg_mount_configure_get_mount_mode(msg);
323  mount_configure->stab_roll = mavlink_msg_mount_configure_get_stab_roll(msg);
324  mount_configure->stab_pitch = mavlink_msg_mount_configure_get_stab_pitch(msg);
325  mount_configure->stab_yaw = mavlink_msg_mount_configure_get_stab_yaw(msg);
326 #else
327  memcpy(mount_configure, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MOUNT_CONFIGURE_LEN);
328 #endif
329 }
#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