NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_flexifunction_directory.h
Go to the documentation of this file.
1 // MESSAGE FLEXIFUNCTION_DIRECTORY PACKING
2 
3 #define MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY 155
4 
6 {
7  uint8_t target_system;
8  uint8_t target_component;
9  uint8_t directory_type;
10  uint8_t start_index;
11  uint8_t count;
12  int8_t directory_data[48];
14 
15 #define MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN 53
16 #define MAVLINK_MSG_ID_155_LEN 53
17 
18 #define MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_CRC 12
19 #define MAVLINK_MSG_ID_155_CRC 12
20 
21 #define MAVLINK_MSG_FLEXIFUNCTION_DIRECTORY_FIELD_DIRECTORY_DATA_LEN 48
22 
23 #define MAVLINK_MESSAGE_INFO_FLEXIFUNCTION_DIRECTORY { \
24  "FLEXIFUNCTION_DIRECTORY", \
25  6, \
26  { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_flexifunction_directory_t, target_system) }, \
27  { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_flexifunction_directory_t, target_component) }, \
28  { "directory_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_flexifunction_directory_t, directory_type) }, \
29  { "start_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_flexifunction_directory_t, start_index) }, \
30  { "count", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_flexifunction_directory_t, count) }, \
31  { "directory_data", NULL, MAVLINK_TYPE_INT8_T, 48, 5, offsetof(mavlink_flexifunction_directory_t, directory_data) }, \
32  } \
33 }
34 
35 
50 static inline uint16_t mavlink_msg_flexifunction_directory_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
51  uint8_t target_system, uint8_t target_component, uint8_t directory_type, uint8_t start_index, uint8_t count, const int8_t *directory_data)
52 {
53 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
55  _mav_put_uint8_t(buf, 0, target_system);
56  _mav_put_uint8_t(buf, 1, target_component);
57  _mav_put_uint8_t(buf, 2, directory_type);
58  _mav_put_uint8_t(buf, 3, start_index);
59  _mav_put_uint8_t(buf, 4, count);
60  _mav_put_int8_t_array(buf, 5, directory_data, 48);
62 #else
64  packet.target_system = target_system;
65  packet.target_component = target_component;
66  packet.directory_type = directory_type;
67  packet.start_index = start_index;
68  packet.count = count;
69  mav_array_memcpy(packet.directory_data, directory_data, sizeof(int8_t)*48);
71 #endif
72 
74 #if MAVLINK_CRC_EXTRA
76 #else
77  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN);
78 #endif
79 }
80 
95 static inline uint16_t mavlink_msg_flexifunction_directory_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
96  mavlink_message_t* msg,
97  uint8_t target_system,uint8_t target_component,uint8_t directory_type,uint8_t start_index,uint8_t count,const int8_t *directory_data)
98 {
99 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
101  _mav_put_uint8_t(buf, 0, target_system);
102  _mav_put_uint8_t(buf, 1, target_component);
103  _mav_put_uint8_t(buf, 2, directory_type);
104  _mav_put_uint8_t(buf, 3, start_index);
105  _mav_put_uint8_t(buf, 4, count);
106  _mav_put_int8_t_array(buf, 5, directory_data, 48);
108 #else
110  packet.target_system = target_system;
111  packet.target_component = target_component;
112  packet.directory_type = directory_type;
113  packet.start_index = start_index;
114  packet.count = count;
115  mav_array_memcpy(packet.directory_data, directory_data, sizeof(int8_t)*48);
117 #endif
118 
120 #if MAVLINK_CRC_EXTRA
122 #else
123  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN);
124 #endif
125 }
126 
135 static inline uint16_t mavlink_msg_flexifunction_directory_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_flexifunction_directory_t* flexifunction_directory)
136 {
137  return mavlink_msg_flexifunction_directory_pack(system_id, component_id, msg, flexifunction_directory->target_system, flexifunction_directory->target_component, flexifunction_directory->directory_type, flexifunction_directory->start_index, flexifunction_directory->count, flexifunction_directory->directory_data);
138 }
139 
149 static inline uint16_t mavlink_msg_flexifunction_directory_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_flexifunction_directory_t* flexifunction_directory)
150 {
151  return mavlink_msg_flexifunction_directory_pack_chan(system_id, component_id, chan, msg, flexifunction_directory->target_system, flexifunction_directory->target_component, flexifunction_directory->directory_type, flexifunction_directory->start_index, flexifunction_directory->count, flexifunction_directory->directory_data);
152 }
153 
165 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
166 
167 static inline void mavlink_msg_flexifunction_directory_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t directory_type, uint8_t start_index, uint8_t count, const int8_t *directory_data)
168 {
169 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
171  _mav_put_uint8_t(buf, 0, target_system);
172  _mav_put_uint8_t(buf, 1, target_component);
173  _mav_put_uint8_t(buf, 2, directory_type);
174  _mav_put_uint8_t(buf, 3, start_index);
175  _mav_put_uint8_t(buf, 4, count);
176  _mav_put_int8_t_array(buf, 5, directory_data, 48);
177 #if MAVLINK_CRC_EXTRA
179 #else
180  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY, buf, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN);
181 #endif
182 #else
184  packet.target_system = target_system;
185  packet.target_component = target_component;
186  packet.directory_type = directory_type;
187  packet.start_index = start_index;
188  packet.count = count;
189  mav_array_memcpy(packet.directory_data, directory_data, sizeof(int8_t)*48);
190 #if MAVLINK_CRC_EXTRA
192 #else
193  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY, (const char *)&packet, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN);
194 #endif
195 #endif
196 }
197 
198 #if MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN <= MAVLINK_MAX_PAYLOAD_LEN
199 /*
200  This varient of _send() can be used to save stack space by re-using
201  memory from the receive buffer. The caller provides a
202  mavlink_message_t which is the size of a full mavlink message. This
203  is usually the receive buffer for the channel, and allows a reply to an
204  incoming message with minimum stack space usage.
205  */
206 static inline void mavlink_msg_flexifunction_directory_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint8_t directory_type, uint8_t start_index, uint8_t count, const int8_t *directory_data)
207 {
208 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
209  char *buf = (char *)msgbuf;
210  _mav_put_uint8_t(buf, 0, target_system);
211  _mav_put_uint8_t(buf, 1, target_component);
212  _mav_put_uint8_t(buf, 2, directory_type);
213  _mav_put_uint8_t(buf, 3, start_index);
214  _mav_put_uint8_t(buf, 4, count);
215  _mav_put_int8_t_array(buf, 5, directory_data, 48);
216 #if MAVLINK_CRC_EXTRA
218 #else
219  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY, buf, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN);
220 #endif
221 #else
223  packet->target_system = target_system;
224  packet->target_component = target_component;
225  packet->directory_type = directory_type;
226  packet->start_index = start_index;
227  packet->count = count;
228  mav_array_memcpy(packet->directory_data, directory_data, sizeof(int8_t)*48);
229 #if MAVLINK_CRC_EXTRA
231 #else
232  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY, (const char *)packet, MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN);
233 #endif
234 #endif
235 }
236 #endif
237 
238 #endif
239 
240 // MESSAGE FLEXIFUNCTION_DIRECTORY UNPACKING
241 
242 
248 static inline uint8_t mavlink_msg_flexifunction_directory_get_target_system(const mavlink_message_t* msg)
249 {
250  return _MAV_RETURN_uint8_t(msg, 0);
251 }
252 
258 static inline uint8_t mavlink_msg_flexifunction_directory_get_target_component(const mavlink_message_t* msg)
259 {
260  return _MAV_RETURN_uint8_t(msg, 1);
261 }
262 
268 static inline uint8_t mavlink_msg_flexifunction_directory_get_directory_type(const mavlink_message_t* msg)
269 {
270  return _MAV_RETURN_uint8_t(msg, 2);
271 }
272 
278 static inline uint8_t mavlink_msg_flexifunction_directory_get_start_index(const mavlink_message_t* msg)
279 {
280  return _MAV_RETURN_uint8_t(msg, 3);
281 }
282 
288 static inline uint8_t mavlink_msg_flexifunction_directory_get_count(const mavlink_message_t* msg)
289 {
290  return _MAV_RETURN_uint8_t(msg, 4);
291 }
292 
298 static inline uint16_t mavlink_msg_flexifunction_directory_get_directory_data(const mavlink_message_t* msg, int8_t *directory_data)
299 {
300  return _MAV_RETURN_int8_t_array(msg, directory_data, 48, 5);
301 }
302 
309 static inline void mavlink_msg_flexifunction_directory_decode(const mavlink_message_t* msg, mavlink_flexifunction_directory_t* flexifunction_directory)
310 {
311 #if MAVLINK_NEED_BYTE_SWAP
312  flexifunction_directory->target_system = mavlink_msg_flexifunction_directory_get_target_system(msg);
313  flexifunction_directory->target_component = mavlink_msg_flexifunction_directory_get_target_component(msg);
314  flexifunction_directory->directory_type = mavlink_msg_flexifunction_directory_get_directory_type(msg);
315  flexifunction_directory->start_index = mavlink_msg_flexifunction_directory_get_start_index(msg);
316  flexifunction_directory->count = mavlink_msg_flexifunction_directory_get_count(msg);
317  mavlink_msg_flexifunction_directory_get_directory_data(msg, flexifunction_directory->directory_data);
318 #else
319  memcpy(flexifunction_directory, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_FLEXIFUNCTION_DIRECTORY_LEN);
320 #endif
321 }
#define _MAV_RETURN_uint8_t(msg, wire_offset)
Definition: protocol.h:238
#define _mav_put_uint8_t(buf, wire_offset, b)
Definition: protocol.h:134