mavlink_msg_mission_clear_all.h 5.37 KB
Newer Older
lm's avatar
lm committed
1
// MESSAGE MISSION_CLEAR_ALL PACKING
James Goppert's avatar
James Goppert committed
2

lm's avatar
lm committed
3
#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL 45
James Goppert's avatar
James Goppert committed
4

lm's avatar
lm committed
5
typedef struct __mavlink_mission_clear_all_t
James Goppert's avatar
James Goppert committed
6
{
lm's avatar
lm committed
7 8
 uint8_t target_system; ///< System ID
 uint8_t target_component; ///< Component ID
lm's avatar
lm committed
9
} mavlink_mission_clear_all_t;
James Goppert's avatar
James Goppert committed
10

lm's avatar
lm committed
11
#define MAVLINK_MSG_ID_MISSION_CLEAR_ALL_LEN 2
lm's avatar
lm committed
12 13 14 15
#define MAVLINK_MSG_ID_45_LEN 2



lm's avatar
lm committed
16 17
#define MAVLINK_MESSAGE_INFO_MISSION_CLEAR_ALL { \
	"MISSION_CLEAR_ALL", \
lm's avatar
lm committed
18
	2, \
lm's avatar
lm committed
19 20
	{  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_mission_clear_all_t, target_system) }, \
         { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_mission_clear_all_t, target_component) }, \
lm's avatar
lm committed
21 22 23 24
         } \
}


James Goppert's avatar
James Goppert committed
25
/**
lm's avatar
lm committed
26
 * @brief Pack a mission_clear_all message
James Goppert's avatar
James Goppert committed
27 28 29 30 31 32 33 34
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param target_system System ID
 * @param target_component Component ID
 * @return length of the message in bytes (excluding serial stream start sign)
 */
lm's avatar
lm committed
35
static inline uint16_t mavlink_msg_mission_clear_all_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
lm's avatar
lm committed
36
						       uint8_t target_system, uint8_t target_component)
James Goppert's avatar
James Goppert committed
37
{
LM's avatar
LM committed
38 39 40 41 42 43 44
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[2];
	_mav_put_uint8_t(buf, 0, target_system);
	_mav_put_uint8_t(buf, 1, target_component);

        memcpy(_MAV_PAYLOAD(msg), buf, 2);
#else
lm's avatar
lm committed
45
	mavlink_mission_clear_all_t packet;
LM's avatar
LM committed
46 47
	packet.target_system = target_system;
	packet.target_component = target_component;
James Goppert's avatar
James Goppert committed
48

LM's avatar
LM committed
49 50
        memcpy(_MAV_PAYLOAD(msg), &packet, 2);
#endif
James Goppert's avatar
James Goppert committed
51

lm's avatar
lm committed
52 53
	msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
	return mavlink_finalize_message(msg, system_id, component_id, 2, 232);
James Goppert's avatar
James Goppert committed
54 55 56
}

/**
lm's avatar
lm committed
57
 * @brief Pack a mission_clear_all message on a channel
James Goppert's avatar
James Goppert committed
58 59 60 61 62 63 64 65
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message was sent over
 * @param msg The MAVLink message to compress the data into
 * @param target_system System ID
 * @param target_component Component ID
 * @return length of the message in bytes (excluding serial stream start sign)
 */
lm's avatar
lm committed
66
static inline uint16_t mavlink_msg_mission_clear_all_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
lm's avatar
lm committed
67 68 69
							   mavlink_message_t* msg,
						           uint8_t target_system,uint8_t target_component)
{
LM's avatar
LM committed
70 71 72 73
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[2];
	_mav_put_uint8_t(buf, 0, target_system);
	_mav_put_uint8_t(buf, 1, target_component);
lm's avatar
lm committed
74

LM's avatar
LM committed
75 76
        memcpy(_MAV_PAYLOAD(msg), buf, 2);
#else
lm's avatar
lm committed
77
	mavlink_mission_clear_all_t packet;
LM's avatar
LM committed
78 79
	packet.target_system = target_system;
	packet.target_component = target_component;
lm's avatar
lm committed
80

LM's avatar
LM committed
81 82 83
        memcpy(_MAV_PAYLOAD(msg), &packet, 2);
#endif

lm's avatar
lm committed
84 85
	msg->msgid = MAVLINK_MSG_ID_MISSION_CLEAR_ALL;
	return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 2, 232);
lm's avatar
lm committed
86 87
}

James Goppert's avatar
James Goppert committed
88
/**
lm's avatar
lm committed
89
 * @brief Encode a mission_clear_all struct into a message
James Goppert's avatar
James Goppert committed
90 91 92 93
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
lm's avatar
lm committed
94
 * @param mission_clear_all C-struct to read the message contents from
James Goppert's avatar
James Goppert committed
95
 */
lm's avatar
lm committed
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)
James Goppert's avatar
James Goppert committed
97
{
lm's avatar
lm committed
98
	return mavlink_msg_mission_clear_all_pack(system_id, component_id, msg, mission_clear_all->target_system, mission_clear_all->target_component);
James Goppert's avatar
James Goppert committed
99 100 101
}

/**
lm's avatar
lm committed
102
 * @brief Send a mission_clear_all message
James Goppert's avatar
James Goppert committed
103 104 105 106 107
 * @param chan MAVLink channel to send the message
 *
 * @param target_system System ID
 * @param target_component Component ID
 */
lm's avatar
lm committed
108 109
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

lm's avatar
lm committed
110
static inline void mavlink_msg_mission_clear_all_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component)
lm's avatar
lm committed
111
{
LM's avatar
LM committed
112 113 114 115
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
	char buf[2];
	_mav_put_uint8_t(buf, 0, target_system);
	_mav_put_uint8_t(buf, 1, target_component);
LM's avatar
LM committed
116

lm's avatar
lm committed
117
	_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, buf, 2, 232);
LM's avatar
LM committed
118
#else
lm's avatar
lm committed
119
	mavlink_mission_clear_all_t packet;
LM's avatar
LM committed
120 121
	packet.target_system = target_system;
	packet.target_component = target_component;
LM's avatar
LM committed
122

lm's avatar
lm committed
123
	_mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_CLEAR_ALL, (const char *)&packet, 2, 232);
LM's avatar
LM committed
124
#endif
James Goppert's avatar
James Goppert committed
125 126 127
}

#endif
lm's avatar
lm committed
128

lm's avatar
lm committed
129
// MESSAGE MISSION_CLEAR_ALL UNPACKING
James Goppert's avatar
James Goppert committed
130

lm's avatar
lm committed
131

James Goppert's avatar
James Goppert committed
132
/**
lm's avatar
lm committed
133
 * @brief Get field target_system from mission_clear_all message
James Goppert's avatar
James Goppert committed
134 135 136
 *
 * @return System ID
 */
lm's avatar
lm committed
137
static inline uint8_t mavlink_msg_mission_clear_all_get_target_system(const mavlink_message_t* msg)
James Goppert's avatar
James Goppert committed
138
{
LM's avatar
LM committed
139
	return _MAV_RETURN_uint8_t(msg,  0);
James Goppert's avatar
James Goppert committed
140 141 142
}

/**
lm's avatar
lm committed
143
 * @brief Get field target_component from mission_clear_all message
James Goppert's avatar
James Goppert committed
144 145 146
 *
 * @return Component ID
 */
lm's avatar
lm committed
147
static inline uint8_t mavlink_msg_mission_clear_all_get_target_component(const mavlink_message_t* msg)
James Goppert's avatar
James Goppert committed
148
{
LM's avatar
LM committed
149
	return _MAV_RETURN_uint8_t(msg,  1);
James Goppert's avatar
James Goppert committed
150 151 152
}

/**
lm's avatar
lm committed
153
 * @brief Decode a mission_clear_all message into a struct
James Goppert's avatar
James Goppert committed
154 155
 *
 * @param msg The message to decode
lm's avatar
lm committed
156
 * @param mission_clear_all C-struct to decode the message contents into
James Goppert's avatar
James Goppert committed
157
 */
lm's avatar
lm committed
158
static inline void mavlink_msg_mission_clear_all_decode(const mavlink_message_t* msg, mavlink_mission_clear_all_t* mission_clear_all)
James Goppert's avatar
James Goppert committed
159
{
lm's avatar
lm committed
160
#if MAVLINK_NEED_BYTE_SWAP
lm's avatar
lm committed
161 162
	mission_clear_all->target_system = mavlink_msg_mission_clear_all_get_target_system(msg);
	mission_clear_all->target_component = mavlink_msg_mission_clear_all_get_target_component(msg);
lm's avatar
lm committed
163
#else
lm's avatar
lm committed
164
	memcpy(mission_clear_all, _MAV_PAYLOAD(msg), 2);
lm's avatar
lm committed
165
#endif
James Goppert's avatar
James Goppert committed
166
}