mavlink_msg_mission_write_partial_list.h
Go to the documentation of this file.
1 // MESSAGE MISSION_WRITE_PARTIAL_LIST PACKING
2 
3 #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST 38
4 
6 {
7  int16_t start_index; /*< Start index, 0 by default and smaller / equal to the largest index of the current onboard list.*/
8  int16_t end_index; /*< End index, equal or greater than start index.*/
9  uint8_t target_system; /*< System ID*/
10  uint8_t target_component; /*< Component ID*/
12 
13 #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN 6
14 #define MAVLINK_MSG_ID_38_LEN 6
15 
16 #define MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_CRC 9
17 #define MAVLINK_MSG_ID_38_CRC 9
18 
19 
20 
21 #define MAVLINK_MESSAGE_INFO_MISSION_WRITE_PARTIAL_LIST { \
22  "MISSION_WRITE_PARTIAL_LIST", \
23  4, \
24  { { "start_index", NULL, MAVLINK_TYPE_INT16_T, 0, 0, offsetof(mavlink_mission_write_partial_list_t, start_index) }, \
25  { "end_index", NULL, MAVLINK_TYPE_INT16_T, 0, 2, offsetof(mavlink_mission_write_partial_list_t, end_index) }, \
26  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_mission_write_partial_list_t, target_system) }, \
27  { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_mission_write_partial_list_t, target_component) }, \
28  } \
29 }
30 
31 
44 static inline uint16_t mavlink_msg_mission_write_partial_list_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
45  uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
46 {
47 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
49  _mav_put_int16_t(buf, 0, start_index);
50  _mav_put_int16_t(buf, 2, end_index);
51  _mav_put_uint8_t(buf, 4, target_system);
52  _mav_put_uint8_t(buf, 5, target_component);
53 
55 #else
57  packet.start_index = start_index;
58  packet.end_index = end_index;
61 
63 #endif
64 
66 #if MAVLINK_CRC_EXTRA
68 #else
69  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
70 #endif
71 }
72 
85 static inline uint16_t mavlink_msg_mission_write_partial_list_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
86  mavlink_message_t* msg,
87  uint8_t target_system,uint8_t target_component,int16_t start_index,int16_t end_index)
88 {
89 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91  _mav_put_int16_t(buf, 0, start_index);
92  _mav_put_int16_t(buf, 2, end_index);
93  _mav_put_uint8_t(buf, 4, target_system);
94  _mav_put_uint8_t(buf, 5, target_component);
95 
97 #else
99  packet.start_index = start_index;
100  packet.end_index = end_index;
101  packet.target_system = target_system;
103 
105 #endif
106 
108 #if MAVLINK_CRC_EXTRA
110 #else
111  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
112 #endif
113 }
114 
123 static inline uint16_t mavlink_msg_mission_write_partial_list_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
124 {
125  return mavlink_msg_mission_write_partial_list_pack(system_id, component_id, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index);
126 }
127 
137 static inline uint16_t mavlink_msg_mission_write_partial_list_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_mission_write_partial_list_t* mission_write_partial_list)
138 {
139  return mavlink_msg_mission_write_partial_list_pack_chan(system_id, component_id, chan, msg, mission_write_partial_list->target_system, mission_write_partial_list->target_component, mission_write_partial_list->start_index, mission_write_partial_list->end_index);
140 }
141 
151 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
152 
153 static inline void mavlink_msg_mission_write_partial_list_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
154 {
155 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
157  _mav_put_int16_t(buf, 0, start_index);
158  _mav_put_int16_t(buf, 2, end_index);
161 
162 #if MAVLINK_CRC_EXTRA
164 #else
166 #endif
167 #else
169  packet.start_index = start_index;
170  packet.end_index = end_index;
171  packet.target_system = target_system;
173 
174 #if MAVLINK_CRC_EXTRA
176 #else
177  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)&packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
178 #endif
179 #endif
180 }
181 
182 #if MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN <= MAVLINK_MAX_PAYLOAD_LEN
183 /*
184  This varient of _send() can be used to save stack space by re-using
185  memory from the receive buffer. The caller provides a
186  mavlink_message_t which is the size of a full mavlink message. This
187  is usually the receive buffer for the channel, and allows a reply to an
188  incoming message with minimum stack space usage.
189  */
190 static inline void mavlink_msg_mission_write_partial_list_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, int16_t start_index, int16_t end_index)
191 {
192 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
193  char *buf = (char *)msgbuf;
194  _mav_put_int16_t(buf, 0, start_index);
195  _mav_put_int16_t(buf, 2, end_index);
198 
199 #if MAVLINK_CRC_EXTRA
201 #else
203 #endif
204 #else
206  packet->start_index = start_index;
207  packet->end_index = end_index;
208  packet->target_system = target_system;
210 
211 #if MAVLINK_CRC_EXTRA
213 #else
214  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST, (const char *)packet, MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
215 #endif
216 #endif
217 }
218 #endif
219 
220 #endif
221 
222 // MESSAGE MISSION_WRITE_PARTIAL_LIST UNPACKING
223 
224 
230 static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_system(const mavlink_message_t* msg)
231 {
232  return _MAV_RETURN_uint8_t(msg, 4);
233 }
234 
240 static inline uint8_t mavlink_msg_mission_write_partial_list_get_target_component(const mavlink_message_t* msg)
241 {
242  return _MAV_RETURN_uint8_t(msg, 5);
243 }
244 
250 static inline int16_t mavlink_msg_mission_write_partial_list_get_start_index(const mavlink_message_t* msg)
251 {
252  return _MAV_RETURN_int16_t(msg, 0);
253 }
254 
260 static inline int16_t mavlink_msg_mission_write_partial_list_get_end_index(const mavlink_message_t* msg)
261 {
262  return _MAV_RETURN_int16_t(msg, 2);
263 }
264 
271 static inline void mavlink_msg_mission_write_partial_list_decode(const mavlink_message_t* msg, mavlink_mission_write_partial_list_t* mission_write_partial_list)
272 {
273 #if MAVLINK_NEED_BYTE_SWAP
274  mission_write_partial_list->start_index = mavlink_msg_mission_write_partial_list_get_start_index(msg);
275  mission_write_partial_list->end_index = mavlink_msg_mission_write_partial_list_get_end_index(msg);
278 #else
279  memcpy(mission_write_partial_list, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_MISSION_WRITE_PARTIAL_LIST_LEN);
280 #endif
281 }
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:244
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:140
#define _mav_put_int16_t(buf, wire_offset, b)
Definition: protocol.h:146


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:18