mavlink_msg_rc_channels_override.h
Go to the documentation of this file.
00001 // MESSAGE RC_CHANNELS_OVERRIDE PACKING
00002 
00003 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE 70
00004 
00005 typedef struct __mavlink_rc_channels_override_t
00006 {
00007  uint16_t chan1_raw; /*< RC channel 1 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00008  uint16_t chan2_raw; /*< RC channel 2 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00009  uint16_t chan3_raw; /*< RC channel 3 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00010  uint16_t chan4_raw; /*< RC channel 4 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00011  uint16_t chan5_raw; /*< RC channel 5 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00012  uint16_t chan6_raw; /*< RC channel 6 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00013  uint16_t chan7_raw; /*< RC channel 7 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00014  uint16_t chan8_raw; /*< RC channel 8 value, in microseconds. A value of UINT16_MAX means to ignore this field.*/
00015  uint8_t target_system; /*< System ID*/
00016  uint8_t target_component; /*< Component ID*/
00017 } mavlink_rc_channels_override_t;
00018 
00019 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN 18
00020 #define MAVLINK_MSG_ID_70_LEN 18
00021 
00022 #define MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC 124
00023 #define MAVLINK_MSG_ID_70_CRC 124
00024 
00025 
00026 
00027 #define MAVLINK_MESSAGE_INFO_RC_CHANNELS_OVERRIDE { \
00028         "RC_CHANNELS_OVERRIDE", \
00029         10, \
00030         {  { "chan1_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_rc_channels_override_t, chan1_raw) }, \
00031          { "chan2_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_rc_channels_override_t, chan2_raw) }, \
00032          { "chan3_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_rc_channels_override_t, chan3_raw) }, \
00033          { "chan4_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 6, offsetof(mavlink_rc_channels_override_t, chan4_raw) }, \
00034          { "chan5_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 8, offsetof(mavlink_rc_channels_override_t, chan5_raw) }, \
00035          { "chan6_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 10, offsetof(mavlink_rc_channels_override_t, chan6_raw) }, \
00036          { "chan7_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 12, offsetof(mavlink_rc_channels_override_t, chan7_raw) }, \
00037          { "chan8_raw", NULL, MAVLINK_TYPE_UINT16_T, 0, 14, offsetof(mavlink_rc_channels_override_t, chan8_raw) }, \
00038          { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 16, offsetof(mavlink_rc_channels_override_t, target_system) }, \
00039          { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 17, offsetof(mavlink_rc_channels_override_t, target_component) }, \
00040          } \
00041 }
00042 
00043 
00062 static inline uint16_t mavlink_msg_rc_channels_override_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
00063                                                        uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw)
00064 {
00065 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00066         char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
00067         _mav_put_uint16_t(buf, 0, chan1_raw);
00068         _mav_put_uint16_t(buf, 2, chan2_raw);
00069         _mav_put_uint16_t(buf, 4, chan3_raw);
00070         _mav_put_uint16_t(buf, 6, chan4_raw);
00071         _mav_put_uint16_t(buf, 8, chan5_raw);
00072         _mav_put_uint16_t(buf, 10, chan6_raw);
00073         _mav_put_uint16_t(buf, 12, chan7_raw);
00074         _mav_put_uint16_t(buf, 14, chan8_raw);
00075         _mav_put_uint8_t(buf, 16, target_system);
00076         _mav_put_uint8_t(buf, 17, target_component);
00077 
00078         memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00079 #else
00080         mavlink_rc_channels_override_t packet;
00081         packet.chan1_raw = chan1_raw;
00082         packet.chan2_raw = chan2_raw;
00083         packet.chan3_raw = chan3_raw;
00084         packet.chan4_raw = chan4_raw;
00085         packet.chan5_raw = chan5_raw;
00086         packet.chan6_raw = chan6_raw;
00087         packet.chan7_raw = chan7_raw;
00088         packet.chan8_raw = chan8_raw;
00089         packet.target_system = target_system;
00090         packet.target_component = target_component;
00091 
00092         memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00093 #endif
00094 
00095         msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
00096 #if MAVLINK_CRC_EXTRA
00097     return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
00098 #else
00099     return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00100 #endif
00101 }
00102 
00121 static inline uint16_t mavlink_msg_rc_channels_override_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
00122                                                            mavlink_message_t* msg,
00123                                                            uint8_t target_system,uint8_t target_component,uint16_t chan1_raw,uint16_t chan2_raw,uint16_t chan3_raw,uint16_t chan4_raw,uint16_t chan5_raw,uint16_t chan6_raw,uint16_t chan7_raw,uint16_t chan8_raw)
00124 {
00125 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00126         char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
00127         _mav_put_uint16_t(buf, 0, chan1_raw);
00128         _mav_put_uint16_t(buf, 2, chan2_raw);
00129         _mav_put_uint16_t(buf, 4, chan3_raw);
00130         _mav_put_uint16_t(buf, 6, chan4_raw);
00131         _mav_put_uint16_t(buf, 8, chan5_raw);
00132         _mav_put_uint16_t(buf, 10, chan6_raw);
00133         _mav_put_uint16_t(buf, 12, chan7_raw);
00134         _mav_put_uint16_t(buf, 14, chan8_raw);
00135         _mav_put_uint8_t(buf, 16, target_system);
00136         _mav_put_uint8_t(buf, 17, target_component);
00137 
00138         memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00139 #else
00140         mavlink_rc_channels_override_t packet;
00141         packet.chan1_raw = chan1_raw;
00142         packet.chan2_raw = chan2_raw;
00143         packet.chan3_raw = chan3_raw;
00144         packet.chan4_raw = chan4_raw;
00145         packet.chan5_raw = chan5_raw;
00146         packet.chan6_raw = chan6_raw;
00147         packet.chan7_raw = chan7_raw;
00148         packet.chan8_raw = chan8_raw;
00149         packet.target_system = target_system;
00150         packet.target_component = target_component;
00151 
00152         memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00153 #endif
00154 
00155         msg->msgid = MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE;
00156 #if MAVLINK_CRC_EXTRA
00157     return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
00158 #else
00159     return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00160 #endif
00161 }
00162 
00171 static inline uint16_t mavlink_msg_rc_channels_override_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
00172 {
00173         return mavlink_msg_rc_channels_override_pack(system_id, component_id, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
00174 }
00175 
00185 static inline uint16_t mavlink_msg_rc_channels_override_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_rc_channels_override_t* rc_channels_override)
00186 {
00187         return mavlink_msg_rc_channels_override_pack_chan(system_id, component_id, chan, msg, rc_channels_override->target_system, rc_channels_override->target_component, rc_channels_override->chan1_raw, rc_channels_override->chan2_raw, rc_channels_override->chan3_raw, rc_channels_override->chan4_raw, rc_channels_override->chan5_raw, rc_channels_override->chan6_raw, rc_channels_override->chan7_raw, rc_channels_override->chan8_raw);
00188 }
00189 
00205 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
00206 
00207 static inline void mavlink_msg_rc_channels_override_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw)
00208 {
00209 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00210         char buf[MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN];
00211         _mav_put_uint16_t(buf, 0, chan1_raw);
00212         _mav_put_uint16_t(buf, 2, chan2_raw);
00213         _mav_put_uint16_t(buf, 4, chan3_raw);
00214         _mav_put_uint16_t(buf, 6, chan4_raw);
00215         _mav_put_uint16_t(buf, 8, chan5_raw);
00216         _mav_put_uint16_t(buf, 10, chan6_raw);
00217         _mav_put_uint16_t(buf, 12, chan7_raw);
00218         _mav_put_uint16_t(buf, 14, chan8_raw);
00219         _mav_put_uint8_t(buf, 16, target_system);
00220         _mav_put_uint8_t(buf, 17, target_component);
00221 
00222 #if MAVLINK_CRC_EXTRA
00223     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
00224 #else
00225     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00226 #endif
00227 #else
00228         mavlink_rc_channels_override_t packet;
00229         packet.chan1_raw = chan1_raw;
00230         packet.chan2_raw = chan2_raw;
00231         packet.chan3_raw = chan3_raw;
00232         packet.chan4_raw = chan4_raw;
00233         packet.chan5_raw = chan5_raw;
00234         packet.chan6_raw = chan6_raw;
00235         packet.chan7_raw = chan7_raw;
00236         packet.chan8_raw = chan8_raw;
00237         packet.target_system = target_system;
00238         packet.target_component = target_component;
00239 
00240 #if MAVLINK_CRC_EXTRA
00241     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
00242 #else
00243     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)&packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00244 #endif
00245 #endif
00246 }
00247 
00248 #if MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN <= MAVLINK_MAX_PAYLOAD_LEN
00249 /*
00250   This varient of _send() can be used to save stack space by re-using
00251   memory from the receive buffer.  The caller provides a
00252   mavlink_message_t which is the size of a full mavlink message. This
00253   is usually the receive buffer for the channel, and allows a reply to an
00254   incoming message with minimum stack space usage.
00255  */
00256 static inline void mavlink_msg_rc_channels_override_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint8_t target_system, uint8_t target_component, uint16_t chan1_raw, uint16_t chan2_raw, uint16_t chan3_raw, uint16_t chan4_raw, uint16_t chan5_raw, uint16_t chan6_raw, uint16_t chan7_raw, uint16_t chan8_raw)
00257 {
00258 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
00259         char *buf = (char *)msgbuf;
00260         _mav_put_uint16_t(buf, 0, chan1_raw);
00261         _mav_put_uint16_t(buf, 2, chan2_raw);
00262         _mav_put_uint16_t(buf, 4, chan3_raw);
00263         _mav_put_uint16_t(buf, 6, chan4_raw);
00264         _mav_put_uint16_t(buf, 8, chan5_raw);
00265         _mav_put_uint16_t(buf, 10, chan6_raw);
00266         _mav_put_uint16_t(buf, 12, chan7_raw);
00267         _mav_put_uint16_t(buf, 14, chan8_raw);
00268         _mav_put_uint8_t(buf, 16, target_system);
00269         _mav_put_uint8_t(buf, 17, target_component);
00270 
00271 #if MAVLINK_CRC_EXTRA
00272     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
00273 #else
00274     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, buf, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00275 #endif
00276 #else
00277         mavlink_rc_channels_override_t *packet = (mavlink_rc_channels_override_t *)msgbuf;
00278         packet->chan1_raw = chan1_raw;
00279         packet->chan2_raw = chan2_raw;
00280         packet->chan3_raw = chan3_raw;
00281         packet->chan4_raw = chan4_raw;
00282         packet->chan5_raw = chan5_raw;
00283         packet->chan6_raw = chan6_raw;
00284         packet->chan7_raw = chan7_raw;
00285         packet->chan8_raw = chan8_raw;
00286         packet->target_system = target_system;
00287         packet->target_component = target_component;
00288 
00289 #if MAVLINK_CRC_EXTRA
00290     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_CRC);
00291 #else
00292     _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE, (const char *)packet, MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00293 #endif
00294 #endif
00295 }
00296 #endif
00297 
00298 #endif
00299 
00300 // MESSAGE RC_CHANNELS_OVERRIDE UNPACKING
00301 
00302 
00308 static inline uint8_t mavlink_msg_rc_channels_override_get_target_system(const mavlink_message_t* msg)
00309 {
00310         return _MAV_RETURN_uint8_t(msg,  16);
00311 }
00312 
00318 static inline uint8_t mavlink_msg_rc_channels_override_get_target_component(const mavlink_message_t* msg)
00319 {
00320         return _MAV_RETURN_uint8_t(msg,  17);
00321 }
00322 
00328 static inline uint16_t mavlink_msg_rc_channels_override_get_chan1_raw(const mavlink_message_t* msg)
00329 {
00330         return _MAV_RETURN_uint16_t(msg,  0);
00331 }
00332 
00338 static inline uint16_t mavlink_msg_rc_channels_override_get_chan2_raw(const mavlink_message_t* msg)
00339 {
00340         return _MAV_RETURN_uint16_t(msg,  2);
00341 }
00342 
00348 static inline uint16_t mavlink_msg_rc_channels_override_get_chan3_raw(const mavlink_message_t* msg)
00349 {
00350         return _MAV_RETURN_uint16_t(msg,  4);
00351 }
00352 
00358 static inline uint16_t mavlink_msg_rc_channels_override_get_chan4_raw(const mavlink_message_t* msg)
00359 {
00360         return _MAV_RETURN_uint16_t(msg,  6);
00361 }
00362 
00368 static inline uint16_t mavlink_msg_rc_channels_override_get_chan5_raw(const mavlink_message_t* msg)
00369 {
00370         return _MAV_RETURN_uint16_t(msg,  8);
00371 }
00372 
00378 static inline uint16_t mavlink_msg_rc_channels_override_get_chan6_raw(const mavlink_message_t* msg)
00379 {
00380         return _MAV_RETURN_uint16_t(msg,  10);
00381 }
00382 
00388 static inline uint16_t mavlink_msg_rc_channels_override_get_chan7_raw(const mavlink_message_t* msg)
00389 {
00390         return _MAV_RETURN_uint16_t(msg,  12);
00391 }
00392 
00398 static inline uint16_t mavlink_msg_rc_channels_override_get_chan8_raw(const mavlink_message_t* msg)
00399 {
00400         return _MAV_RETURN_uint16_t(msg,  14);
00401 }
00402 
00409 static inline void mavlink_msg_rc_channels_override_decode(const mavlink_message_t* msg, mavlink_rc_channels_override_t* rc_channels_override)
00410 {
00411 #if MAVLINK_NEED_BYTE_SWAP
00412         rc_channels_override->chan1_raw = mavlink_msg_rc_channels_override_get_chan1_raw(msg);
00413         rc_channels_override->chan2_raw = mavlink_msg_rc_channels_override_get_chan2_raw(msg);
00414         rc_channels_override->chan3_raw = mavlink_msg_rc_channels_override_get_chan3_raw(msg);
00415         rc_channels_override->chan4_raw = mavlink_msg_rc_channels_override_get_chan4_raw(msg);
00416         rc_channels_override->chan5_raw = mavlink_msg_rc_channels_override_get_chan5_raw(msg);
00417         rc_channels_override->chan6_raw = mavlink_msg_rc_channels_override_get_chan6_raw(msg);
00418         rc_channels_override->chan7_raw = mavlink_msg_rc_channels_override_get_chan7_raw(msg);
00419         rc_channels_override->chan8_raw = mavlink_msg_rc_channels_override_get_chan8_raw(msg);
00420         rc_channels_override->target_system = mavlink_msg_rc_channels_override_get_target_system(msg);
00421         rc_channels_override->target_component = mavlink_msg_rc_channels_override_get_target_component(msg);
00422 #else
00423         memcpy(rc_channels_override, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_RC_CHANNELS_OVERRIDE_LEN);
00424 #endif
00425 }


dji_sdk_dji2mav
Author(s):
autogenerated on Thu Jun 6 2019 17:55:35