NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_gimbal_set_factory_parameters.h
Go to the documentation of this file.
1 // MESSAGE GIMBAL_SET_FACTORY_PARAMETERS PACKING
2 
3 #define MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS 206
4 
6 {
7  uint32_t magic_1;
8  uint32_t magic_2;
9  uint32_t magic_3;
10  uint32_t serial_number_pt_1;
11  uint32_t serial_number_pt_2;
12  uint32_t serial_number_pt_3;
13  uint16_t assembly_year;
14  uint8_t target_system;
15  uint8_t target_component;
16  uint8_t assembly_month;
17  uint8_t assembly_day;
18  uint8_t assembly_hour;
19  uint8_t assembly_minute;
20  uint8_t assembly_second;
22 
23 #define MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS_LEN 33
24 #define MAVLINK_MSG_ID_206_LEN 33
25 
26 #define MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS_CRC 112
27 #define MAVLINK_MSG_ID_206_CRC 112
28 
29 
30 
31 #define MAVLINK_MESSAGE_INFO_GIMBAL_SET_FACTORY_PARAMETERS { \
32  "GIMBAL_SET_FACTORY_PARAMETERS", \
33  14, \
34  { { "magic_1", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_gimbal_set_factory_parameters_t, magic_1) }, \
35  { "magic_2", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_gimbal_set_factory_parameters_t, magic_2) }, \
36  { "magic_3", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gimbal_set_factory_parameters_t, magic_3) }, \
37  { "serial_number_pt_1", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_gimbal_set_factory_parameters_t, serial_number_pt_1) }, \
38  { "serial_number_pt_2", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_gimbal_set_factory_parameters_t, serial_number_pt_2) }, \
39  { "serial_number_pt_3", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gimbal_set_factory_parameters_t, serial_number_pt_3) }, \
40  { "assembly_year", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gimbal_set_factory_parameters_t, assembly_year) }, \
41  { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_gimbal_set_factory_parameters_t, target_system) }, \
42  { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_gimbal_set_factory_parameters_t, target_component) }, \
43  { "assembly_month", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gimbal_set_factory_parameters_t, assembly_month) }, \
44  { "assembly_day", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gimbal_set_factory_parameters_t, assembly_day) }, \
45  { "assembly_hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_gimbal_set_factory_parameters_t, assembly_hour) }, \
46  { "assembly_minute", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_gimbal_set_factory_parameters_t, assembly_minute) }, \
47  { "assembly_second", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gimbal_set_factory_parameters_t, assembly_second) }, \
48  } \
49 }
50 
51 
74 static inline uint16_t mavlink_msg_gimbal_set_factory_parameters_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
75  uint8_t target_system, uint8_t target_component, uint32_t magic_1, uint32_t magic_2, uint32_t magic_3, uint16_t assembly_year, uint8_t assembly_month, uint8_t assembly_day, uint8_t assembly_hour, uint8_t assembly_minute, uint8_t assembly_second, uint32_t serial_number_pt_1, uint32_t serial_number_pt_2, uint32_t serial_number_pt_3)
76 {
77 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
79  _mav_put_uint32_t(buf, 0, magic_1);
80  _mav_put_uint32_t(buf, 4, magic_2);
81  _mav_put_uint32_t(buf, 8, magic_3);
82  _mav_put_uint32_t(buf, 12, serial_number_pt_1);
83  _mav_put_uint32_t(buf, 16, serial_number_pt_2);
84  _mav_put_uint32_t(buf, 20, serial_number_pt_3);
85  _mav_put_uint16_t(buf, 24, assembly_year);
86  _mav_put_uint8_t(buf, 26, target_system);
87  _mav_put_uint8_t(buf, 27, target_component);
88  _mav_put_uint8_t(buf, 28, assembly_month);
89  _mav_put_uint8_t(buf, 29, assembly_day);
90  _mav_put_uint8_t(buf, 30, assembly_hour);
91  _mav_put_uint8_t(buf, 31, assembly_minute);
92  _mav_put_uint8_t(buf, 32, assembly_second);
93 
95 #else
97  packet.magic_1 = magic_1;
98  packet.magic_2 = magic_2;
99  packet.magic_3 = magic_3;
100  packet.serial_number_pt_1 = serial_number_pt_1;
101  packet.serial_number_pt_2 = serial_number_pt_2;
102  packet.serial_number_pt_3 = serial_number_pt_3;
103  packet.assembly_year = assembly_year;
104  packet.target_system = target_system;
105  packet.target_component = target_component;
106  packet.assembly_month = assembly_month;
107  packet.assembly_day = assembly_day;
108  packet.assembly_hour = assembly_hour;
109  packet.assembly_minute = assembly_minute;
110  packet.assembly_second = assembly_second;
111 
113 #endif
114 
116 #if MAVLINK_CRC_EXTRA
118 #else
120 #endif
121 }
122 
145 static inline uint16_t mavlink_msg_gimbal_set_factory_parameters_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
146  mavlink_message_t* msg,
147  uint8_t target_system,uint8_t target_component,uint32_t magic_1,uint32_t magic_2,uint32_t magic_3,uint16_t assembly_year,uint8_t assembly_month,uint8_t assembly_day,uint8_t assembly_hour,uint8_t assembly_minute,uint8_t assembly_second,uint32_t serial_number_pt_1,uint32_t serial_number_pt_2,uint32_t serial_number_pt_3)
148 {
149 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
151  _mav_put_uint32_t(buf, 0, magic_1);
152  _mav_put_uint32_t(buf, 4, magic_2);
153  _mav_put_uint32_t(buf, 8, magic_3);
154  _mav_put_uint32_t(buf, 12, serial_number_pt_1);
155  _mav_put_uint32_t(buf, 16, serial_number_pt_2);
156  _mav_put_uint32_t(buf, 20, serial_number_pt_3);
157  _mav_put_uint16_t(buf, 24, assembly_year);
158  _mav_put_uint8_t(buf, 26, target_system);
159  _mav_put_uint8_t(buf, 27, target_component);
160  _mav_put_uint8_t(buf, 28, assembly_month);
161  _mav_put_uint8_t(buf, 29, assembly_day);
162  _mav_put_uint8_t(buf, 30, assembly_hour);
163  _mav_put_uint8_t(buf, 31, assembly_minute);
164  _mav_put_uint8_t(buf, 32, assembly_second);
165 
167 #else
169  packet.magic_1 = magic_1;
170  packet.magic_2 = magic_2;
171  packet.magic_3 = magic_3;
172  packet.serial_number_pt_1 = serial_number_pt_1;
173  packet.serial_number_pt_2 = serial_number_pt_2;
174  packet.serial_number_pt_3 = serial_number_pt_3;
175  packet.assembly_year = assembly_year;
176  packet.target_system = target_system;
177  packet.target_component = target_component;
178  packet.assembly_month = assembly_month;
179  packet.assembly_day = assembly_day;
180  packet.assembly_hour = assembly_hour;
181  packet.assembly_minute = assembly_minute;
182  packet.assembly_second = assembly_second;
183 
185 #endif
186 
188 #if MAVLINK_CRC_EXTRA
190 #else
191  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS_LEN);
192 #endif
193 }
194 
203 static inline uint16_t mavlink_msg_gimbal_set_factory_parameters_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gimbal_set_factory_parameters_t* gimbal_set_factory_parameters)
204 {
205  return mavlink_msg_gimbal_set_factory_parameters_pack(system_id, component_id, msg, gimbal_set_factory_parameters->target_system, gimbal_set_factory_parameters->target_component, gimbal_set_factory_parameters->magic_1, gimbal_set_factory_parameters->magic_2, gimbal_set_factory_parameters->magic_3, gimbal_set_factory_parameters->assembly_year, gimbal_set_factory_parameters->assembly_month, gimbal_set_factory_parameters->assembly_day, gimbal_set_factory_parameters->assembly_hour, gimbal_set_factory_parameters->assembly_minute, gimbal_set_factory_parameters->assembly_second, gimbal_set_factory_parameters->serial_number_pt_1, gimbal_set_factory_parameters->serial_number_pt_2, gimbal_set_factory_parameters->serial_number_pt_3);
206 }
207 
217 static inline uint16_t mavlink_msg_gimbal_set_factory_parameters_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gimbal_set_factory_parameters_t* gimbal_set_factory_parameters)
218 {
219  return mavlink_msg_gimbal_set_factory_parameters_pack_chan(system_id, component_id, chan, msg, gimbal_set_factory_parameters->target_system, gimbal_set_factory_parameters->target_component, gimbal_set_factory_parameters->magic_1, gimbal_set_factory_parameters->magic_2, gimbal_set_factory_parameters->magic_3, gimbal_set_factory_parameters->assembly_year, gimbal_set_factory_parameters->assembly_month, gimbal_set_factory_parameters->assembly_day, gimbal_set_factory_parameters->assembly_hour, gimbal_set_factory_parameters->assembly_minute, gimbal_set_factory_parameters->assembly_second, gimbal_set_factory_parameters->serial_number_pt_1, gimbal_set_factory_parameters->serial_number_pt_2, gimbal_set_factory_parameters->serial_number_pt_3);
220 }
221 
241 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
242 
243 static inline void mavlink_msg_gimbal_set_factory_parameters_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t magic_1, uint32_t magic_2, uint32_t magic_3, uint16_t assembly_year, uint8_t assembly_month, uint8_t assembly_day, uint8_t assembly_hour, uint8_t assembly_minute, uint8_t assembly_second, uint32_t serial_number_pt_1, uint32_t serial_number_pt_2, uint32_t serial_number_pt_3)
244 {
245 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
247  _mav_put_uint32_t(buf, 0, magic_1);
248  _mav_put_uint32_t(buf, 4, magic_2);
249  _mav_put_uint32_t(buf, 8, magic_3);
250  _mav_put_uint32_t(buf, 12, serial_number_pt_1);
251  _mav_put_uint32_t(buf, 16, serial_number_pt_2);
252  _mav_put_uint32_t(buf, 20, serial_number_pt_3);
253  _mav_put_uint16_t(buf, 24, assembly_year);
254  _mav_put_uint8_t(buf, 26, target_system);
255  _mav_put_uint8_t(buf, 27, target_component);
256  _mav_put_uint8_t(buf, 28, assembly_month);
257  _mav_put_uint8_t(buf, 29, assembly_day);
258  _mav_put_uint8_t(buf, 30, assembly_hour);
259  _mav_put_uint8_t(buf, 31, assembly_minute);
260  _mav_put_uint8_t(buf, 32, assembly_second);
261 
262 #if MAVLINK_CRC_EXTRA
264 #else
266 #endif
267 #else
269  packet.magic_1 = magic_1;
270  packet.magic_2 = magic_2;
271  packet.magic_3 = magic_3;
272  packet.serial_number_pt_1 = serial_number_pt_1;
273  packet.serial_number_pt_2 = serial_number_pt_2;
274  packet.serial_number_pt_3 = serial_number_pt_3;
275  packet.assembly_year = assembly_year;
276  packet.target_system = target_system;
277  packet.target_component = target_component;
278  packet.assembly_month = assembly_month;
279  packet.assembly_day = assembly_day;
280  packet.assembly_hour = assembly_hour;
281  packet.assembly_minute = assembly_minute;
282  packet.assembly_second = assembly_second;
283 
284 #if MAVLINK_CRC_EXTRA
286 #else
287  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS, (const char *)&packet, MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS_LEN);
288 #endif
289 #endif
290 }
291 
292 #if MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
293 /*
294  This varient of _send() can be used to save stack space by re-using
295  memory from the receive buffer. The caller provides a
296  mavlink_message_t which is the size of a full mavlink message. This
297  is usually the receive buffer for the channel, and allows a reply to an
298  incoming message with minimum stack space usage.
299  */
300 static inline void mavlink_msg_gimbal_set_factory_parameters_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, uint32_t magic_1, uint32_t magic_2, uint32_t magic_3, uint16_t assembly_year, uint8_t assembly_month, uint8_t assembly_day, uint8_t assembly_hour, uint8_t assembly_minute, uint8_t assembly_second, uint32_t serial_number_pt_1, uint32_t serial_number_pt_2, uint32_t serial_number_pt_3)
301 {
302 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
303  char *buf = (char *)msgbuf;
304  _mav_put_uint32_t(buf, 0, magic_1);
305  _mav_put_uint32_t(buf, 4, magic_2);
306  _mav_put_uint32_t(buf, 8, magic_3);
307  _mav_put_uint32_t(buf, 12, serial_number_pt_1);
308  _mav_put_uint32_t(buf, 16, serial_number_pt_2);
309  _mav_put_uint32_t(buf, 20, serial_number_pt_3);
310  _mav_put_uint16_t(buf, 24, assembly_year);
311  _mav_put_uint8_t(buf, 26, target_system);
312  _mav_put_uint8_t(buf, 27, target_component);
313  _mav_put_uint8_t(buf, 28, assembly_month);
314  _mav_put_uint8_t(buf, 29, assembly_day);
315  _mav_put_uint8_t(buf, 30, assembly_hour);
316  _mav_put_uint8_t(buf, 31, assembly_minute);
317  _mav_put_uint8_t(buf, 32, assembly_second);
318 
319 #if MAVLINK_CRC_EXTRA
321 #else
323 #endif
324 #else
326  packet->magic_1 = magic_1;
327  packet->magic_2 = magic_2;
328  packet->magic_3 = magic_3;
329  packet->serial_number_pt_1 = serial_number_pt_1;
330  packet->serial_number_pt_2 = serial_number_pt_2;
331  packet->serial_number_pt_3 = serial_number_pt_3;
332  packet->assembly_year = assembly_year;
333  packet->target_system = target_system;
334  packet->target_component = target_component;
335  packet->assembly_month = assembly_month;
336  packet->assembly_day = assembly_day;
337  packet->assembly_hour = assembly_hour;
338  packet->assembly_minute = assembly_minute;
339  packet->assembly_second = assembly_second;
340 
341 #if MAVLINK_CRC_EXTRA
343 #else
344  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS, (const char *)packet, MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS_LEN);
345 #endif
346 #endif
347 }
348 #endif
349 
350 #endif
351 
352 // MESSAGE GIMBAL_SET_FACTORY_PARAMETERS UNPACKING
353 
354 
360 static inline uint8_t mavlink_msg_gimbal_set_factory_parameters_get_target_system(const mavlink_message_t* msg)
361 {
362  return _MAV_RETURN_uint8_t(msg, 26);
363 }
364 
370 static inline uint8_t mavlink_msg_gimbal_set_factory_parameters_get_target_component(const mavlink_message_t* msg)
371 {
372  return _MAV_RETURN_uint8_t(msg, 27);
373 }
374 
380 static inline uint32_t mavlink_msg_gimbal_set_factory_parameters_get_magic_1(const mavlink_message_t* msg)
381 {
382  return _MAV_RETURN_uint32_t(msg, 0);
383 }
384 
390 static inline uint32_t mavlink_msg_gimbal_set_factory_parameters_get_magic_2(const mavlink_message_t* msg)
391 {
392  return _MAV_RETURN_uint32_t(msg, 4);
393 }
394 
400 static inline uint32_t mavlink_msg_gimbal_set_factory_parameters_get_magic_3(const mavlink_message_t* msg)
401 {
402  return _MAV_RETURN_uint32_t(msg, 8);
403 }
404 
410 static inline uint16_t mavlink_msg_gimbal_set_factory_parameters_get_assembly_year(const mavlink_message_t* msg)
411 {
412  return _MAV_RETURN_uint16_t(msg, 24);
413 }
414 
420 static inline uint8_t mavlink_msg_gimbal_set_factory_parameters_get_assembly_month(const mavlink_message_t* msg)
421 {
422  return _MAV_RETURN_uint8_t(msg, 28);
423 }
424 
430 static inline uint8_t mavlink_msg_gimbal_set_factory_parameters_get_assembly_day(const mavlink_message_t* msg)
431 {
432  return _MAV_RETURN_uint8_t(msg, 29);
433 }
434 
440 static inline uint8_t mavlink_msg_gimbal_set_factory_parameters_get_assembly_hour(const mavlink_message_t* msg)
441 {
442  return _MAV_RETURN_uint8_t(msg, 30);
443 }
444 
450 static inline uint8_t mavlink_msg_gimbal_set_factory_parameters_get_assembly_minute(const mavlink_message_t* msg)
451 {
452  return _MAV_RETURN_uint8_t(msg, 31);
453 }
454 
460 static inline uint8_t mavlink_msg_gimbal_set_factory_parameters_get_assembly_second(const mavlink_message_t* msg)
461 {
462  return _MAV_RETURN_uint8_t(msg, 32);
463 }
464 
470 static inline uint32_t mavlink_msg_gimbal_set_factory_parameters_get_serial_number_pt_1(const mavlink_message_t* msg)
471 {
472  return _MAV_RETURN_uint32_t(msg, 12);
473 }
474 
480 static inline uint32_t mavlink_msg_gimbal_set_factory_parameters_get_serial_number_pt_2(const mavlink_message_t* msg)
481 {
482  return _MAV_RETURN_uint32_t(msg, 16);
483 }
484 
490 static inline uint32_t mavlink_msg_gimbal_set_factory_parameters_get_serial_number_pt_3(const mavlink_message_t* msg)
491 {
492  return _MAV_RETURN_uint32_t(msg, 20);
493 }
494 
501 static inline void mavlink_msg_gimbal_set_factory_parameters_decode(const mavlink_message_t* msg, mavlink_gimbal_set_factory_parameters_t* gimbal_set_factory_parameters)
502 {
503 #if MAVLINK_NEED_BYTE_SWAP
504  gimbal_set_factory_parameters->magic_1 = mavlink_msg_gimbal_set_factory_parameters_get_magic_1(msg);
505  gimbal_set_factory_parameters->magic_2 = mavlink_msg_gimbal_set_factory_parameters_get_magic_2(msg);
506  gimbal_set_factory_parameters->magic_3 = mavlink_msg_gimbal_set_factory_parameters_get_magic_3(msg);
507  gimbal_set_factory_parameters->serial_number_pt_1 = mavlink_msg_gimbal_set_factory_parameters_get_serial_number_pt_1(msg);
508  gimbal_set_factory_parameters->serial_number_pt_2 = mavlink_msg_gimbal_set_factory_parameters_get_serial_number_pt_2(msg);
509  gimbal_set_factory_parameters->serial_number_pt_3 = mavlink_msg_gimbal_set_factory_parameters_get_serial_number_pt_3(msg);
510  gimbal_set_factory_parameters->assembly_year = mavlink_msg_gimbal_set_factory_parameters_get_assembly_year(msg);
511  gimbal_set_factory_parameters->target_system = mavlink_msg_gimbal_set_factory_parameters_get_target_system(msg);
512  gimbal_set_factory_parameters->target_component = mavlink_msg_gimbal_set_factory_parameters_get_target_component(msg);
513  gimbal_set_factory_parameters->assembly_month = mavlink_msg_gimbal_set_factory_parameters_get_assembly_month(msg);
514  gimbal_set_factory_parameters->assembly_day = mavlink_msg_gimbal_set_factory_parameters_get_assembly_day(msg);
515  gimbal_set_factory_parameters->assembly_hour = mavlink_msg_gimbal_set_factory_parameters_get_assembly_hour(msg);
516  gimbal_set_factory_parameters->assembly_minute = mavlink_msg_gimbal_set_factory_parameters_get_assembly_minute(msg);
517  gimbal_set_factory_parameters->assembly_second = mavlink_msg_gimbal_set_factory_parameters_get_assembly_second(msg);
518 #else
519  memcpy(gimbal_set_factory_parameters, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GIMBAL_SET_FACTORY_PARAMETERS_LEN);
520 #endif
521 }
#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
#define _mav_put_uint16_t(buf, wire_offset, b)
Definition: protocol.h:139
#define _mav_put_uint32_t(buf, wire_offset, b)
Definition: protocol.h:141