Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / flight / libraries / mavlink / v1.0 / common / mavlink_msg_mission_clear_all.h
blob31cd459230e997148d6f2dcd94e032bd5359a53a
1 // MESSAGE MISSION_CLEAR_ALL PACKING
3 #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45
5 typedef struct __mavlink_mission_clear_all_t {
6 uint8_t target_system; ///< System ID
7 uint8_t target_component; ///< Component ID
8 } mavlink_mission_clear_all_t;
10 #define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2
11 #define MAVLINK_MSG_ID_45_LEN 2
14 #define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL \
15 { \
16 "MISSION_CLEAR_ALL", \
17 2, \
18 { \
19 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \
20 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \
21 } \
25 /**
26 * @brief Pack a mission_clear_all message
27 * @param system_id ID of this system
28 * @param component_id ID of this component (e.g. 200 for IMU)
29 * @param msg The MAVLink message to compress the data into
31 * @param target_system System ID
32 * @param target_component Component ID
33 * @return length of the message in bytes (excluding serial stream start sign)
35 static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t *msg,
36 uint8_t target_system, uint8_t target_component)
38 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
39 char buf[2];
40 _mav_put_uint8_t(buf, 0, target_system);
41 _mav_put_uint8_t(buf, 1, target_component);
43 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
44 #else
45 mavlink_mission_clear_all_t packet;
46 packet.target_system = target_system;
47 packet.target_component = target_component;
49 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
50 #endif
52 msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
53 return mavlink_finalize_message(msg, system_id, component_id, 2, 232);
56 /**
57 * @brief Pack a mission_clear_all message on a channel
58 * @param system_id ID of this system
59 * @param component_id ID of this component (e.g. 200 for IMU)
60 * @param chan The MAVLink channel this message was sent over
61 * @param msg The MAVLink message to compress the data into
62 * @param target_system System ID
63 * @param target_component Component ID
64 * @return length of the message in bytes (excluding serial stream start sign)
66 static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
67 mavlink_message_t *msg,
68 uint8_t target_system, uint8_t target_component)
70 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
71 char buf[2];
72 _mav_put_uint8_t(buf, 0, target_system);
73 _mav_put_uint8_t(buf, 1, target_component);
75 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, 2);
76 #else
77 mavlink_mission_clear_all_t packet;
78 packet.target_system = target_system;
79 packet.target_component = target_component;
81 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, 2);
82 #endif
84 msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
85 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 232);
88 /**
89 * @brief Encode a mission_clear_all struct into a message
91 * @param system_id ID of this system
92 * @param component_id ID of this component (e.g. 200 for IMU)
93 * @param msg The MAVLink message to compress the data into
94 * @param mission_clear_all C-struct to read the message contents from
96 static inline uint16_t mavlink_msg_mission_clear_all_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t *msg, const mavlink_mission_clear_all_t *mission_clear_all)
98 return mavlink_msg_mission_clear_all_pack(system_id, component_id, msg, mission_clear_all->target_system, mission_clear_all->target_component);
102 * @brief Send a mission_clear_all message
103 * @param chan MAVLink channel to send the message
105 * @param target_system System ID
106 * @param target_component Component ID
108 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
110 static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
112 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
113 char buf[2];
114 _mav_put_uint8_t(buf, 0, target_system);
115 _mav_put_uint8_t(buf, 1, target_component);
117 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, 2, 232);
118 #else
119 mavlink_mission_clear_all_t packet;
120 packet.target_system = target_system;
121 packet.target_component = target_component;
123 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, 2, 232);
124 #endif
127 #endif
129 // MESSAGE MISSION_CLEAR_ALL UNPACKING
133 * @brief Get field target_system from mission_clear_all message
135 * @return System ID
137 static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavlink_message_t *msg)
139 return _MAV_RETURN_uint8_t(msg, 0);
143 * @brief Get field target_component from mission_clear_all message
145 * @return Component ID
147 static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const mavlink_message_t *msg)
149 return _MAV_RETURN_uint8_t(msg, 1);
153 * @brief Decode a mission_clear_all message into a struct
155 * @param msg The message to decode
156 * @param mission_clear_all C-struct to decode the message contents into
158 static inline void mavlink_msg_mission_clear_all_decode(const mavlink_message_t *msg, mavlink_mission_clear_all_t *mission_clear_all)
160 #if MAVLINK_NEED_BYTE_SWAP
161 mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg);
162 mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg);
163 #else
164 memcpy(mission_clear_all, _MAV_PAYLOAD(msg), 2);
165 #endif