2 // MESSAGE MISSION_CURRENT PACKING
4 #define MAVLINK_MSG_ID_MISSION_CURRENT 42
7 typedef struct __mavlink_mission_current_t
{
8 uint16_t seq
; /*< Sequence*/
9 } mavlink_mission_current_t
;
11 #define MAVLINK_MSG_ID_MISSION_CURRENT_LEN 2
12 #define MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN 2
13 #define MAVLINK_MSG_ID_42_LEN 2
14 #define MAVLINK_MSG_ID_42_MIN_LEN 2
16 #define MAVLINK_MSG_ID_MISSION_CURRENT_CRC 28
17 #define MAVLINK_MSG_ID_42_CRC 28
21 #if MAVLINK_COMMAND_24BIT
22 #define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \
26 { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \
30 #define MAVLINK_MESSAGE_INFO_MISSION_CURRENT { \
33 { { "seq", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_mission_current_t, seq) }, \
39 * @brief Pack a mission_current message
40 * @param system_id ID of this system
41 * @param component_id ID of this component (e.g. 200 for IMU)
42 * @param msg The MAVLink message to compress the data into
45 * @return length of the message in bytes (excluding serial stream start sign)
47 static inline uint16_t mavlink_msg_mission_current_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
50 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
51 char buf
[MAVLINK_MSG_ID_MISSION_CURRENT_LEN
];
52 _mav_put_uint16_t(buf
, 0, seq
);
54 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
);
56 mavlink_mission_current_t packet
;
59 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
);
62 msg
->msgid
= MAVLINK_MSG_ID_MISSION_CURRENT
;
63 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_CRC
);
67 * @brief Pack a mission_current message on a channel
68 * @param system_id ID of this system
69 * @param component_id ID of this component (e.g. 200 for IMU)
70 * @param chan The MAVLink channel this message will be sent over
71 * @param msg The MAVLink message to compress the data into
73 * @return length of the message in bytes (excluding serial stream start sign)
75 static inline uint16_t mavlink_msg_mission_current_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
76 mavlink_message_t
* msg
,
79 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
80 char buf
[MAVLINK_MSG_ID_MISSION_CURRENT_LEN
];
81 _mav_put_uint16_t(buf
, 0, seq
);
83 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
);
85 mavlink_mission_current_t packet
;
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
);
91 msg
->msgid
= MAVLINK_MSG_ID_MISSION_CURRENT
;
92 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_CRC
);
96 * @brief Encode a mission_current struct
98 * @param system_id ID of this system
99 * @param component_id ID of this component (e.g. 200 for IMU)
100 * @param msg The MAVLink message to compress the data into
101 * @param mission_current C-struct to read the message contents from
103 static inline uint16_t mavlink_msg_mission_current_encode(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_mission_current_t
* mission_current
)
105 return mavlink_msg_mission_current_pack(system_id
, component_id
, msg
, mission_current
->seq
);
109 * @brief Encode a mission_current struct on a channel
111 * @param system_id ID of this system
112 * @param component_id ID of this component (e.g. 200 for IMU)
113 * @param chan The MAVLink channel this message will be sent over
114 * @param msg The MAVLink message to compress the data into
115 * @param mission_current C-struct to read the message contents from
117 static inline uint16_t mavlink_msg_mission_current_encode_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
, mavlink_message_t
* msg
, const mavlink_mission_current_t
* mission_current
)
119 return mavlink_msg_mission_current_pack_chan(system_id
, component_id
, chan
, msg
, mission_current
->seq
);
123 * @brief Send a mission_current message
124 * @param chan MAVLink channel to send the message
126 * @param seq Sequence
128 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
130 static inline void mavlink_msg_mission_current_send(mavlink_channel_t chan
, uint16_t seq
)
132 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
133 char buf
[MAVLINK_MSG_ID_MISSION_CURRENT_LEN
];
134 _mav_put_uint16_t(buf
, 0, seq
);
136 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_CURRENT
, buf
, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_CRC
);
138 mavlink_mission_current_t packet
;
141 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_CURRENT
, (const char *)&packet
, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_CRC
);
146 * @brief Send a mission_current message
147 * @param chan MAVLink channel to send the message
148 * @param struct The MAVLink struct to serialize
150 static inline void mavlink_msg_mission_current_send_struct(mavlink_channel_t chan
, const mavlink_mission_current_t
* mission_current
)
152 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
153 mavlink_msg_mission_current_send(chan
, mission_current
->seq
);
155 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_CURRENT
, (const char *)mission_current
, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_CRC
);
159 #if MAVLINK_MSG_ID_MISSION_CURRENT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
161 This varient of _send() can be used to save stack space by re-using
162 memory from the receive buffer. The caller provides a
163 mavlink_message_t which is the size of a full mavlink message. This
164 is usually the receive buffer for the channel, and allows a reply to an
165 incoming message with minimum stack space usage.
167 static inline void mavlink_msg_mission_current_send_buf(mavlink_message_t
*msgbuf
, mavlink_channel_t chan
, uint16_t seq
)
169 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
170 char *buf
= (char *)msgbuf
;
171 _mav_put_uint16_t(buf
, 0, seq
);
173 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_CURRENT
, buf
, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_CRC
);
175 mavlink_mission_current_t
*packet
= (mavlink_mission_current_t
*)msgbuf
;
178 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_MISSION_CURRENT
, (const char *)packet
, MAVLINK_MSG_ID_MISSION_CURRENT_MIN_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
, MAVLINK_MSG_ID_MISSION_CURRENT_CRC
);
185 // MESSAGE MISSION_CURRENT UNPACKING
189 * @brief Get field seq from mission_current message
193 static inline uint16_t mavlink_msg_mission_current_get_seq(const mavlink_message_t
* msg
)
195 return _MAV_RETURN_uint16_t(msg
, 0);
199 * @brief Decode a mission_current message into a struct
201 * @param msg The message to decode
202 * @param mission_current C-struct to decode the message contents into
204 static inline void mavlink_msg_mission_current_decode(const mavlink_message_t
* msg
, mavlink_mission_current_t
* mission_current
)
206 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
207 mission_current
->seq
= mavlink_msg_mission_current_get_seq(msg
);
209 uint8_t len
= msg
->len
< MAVLINK_MSG_ID_MISSION_CURRENT_LEN
? msg
->len
: MAVLINK_MSG_ID_MISSION_CURRENT_LEN
;
210 memset(mission_current
, 0, MAVLINK_MSG_ID_MISSION_CURRENT_LEN
);
211 memcpy(mission_current
, _MAV_PAYLOAD(msg
), len
);