NinjaFlight
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
mavlink_msg_gps_date_time.h
Go to the documentation of this file.
1 // MESSAGE GPS_DATE_TIME PACKING
2 
3 #define MAVLINK_MSG_ID_GPS_DATE_TIME 179
4 
6 {
7  uint8_t year;
8  uint8_t month;
9  uint8_t day;
10  uint8_t hour;
11  uint8_t min;
12  uint8_t sec;
13  uint8_t clockStat;
14  uint8_t visSat;
15  uint8_t useSat;
16  uint8_t GppGl;
17  uint8_t sigUsedMask;
18  uint8_t percentUsed;
20 
21 #define MAVLINK_MSG_ID_GPS_DATE_TIME_LEN 12
22 #define MAVLINK_MSG_ID_179_LEN 12
23 
24 #define MAVLINK_MSG_ID_GPS_DATE_TIME_CRC 132
25 #define MAVLINK_MSG_ID_179_CRC 132
26 
27 
28 
29 #define MAVLINK_MESSAGE_INFO_GPS_DATE_TIME { \
30  "GPS_DATE_TIME", \
31  12, \
32  { { "year", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_date_time_t, year) }, \
33  { "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_date_time_t, month) }, \
34  { "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_date_time_t, day) }, \
35  { "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_gps_date_time_t, hour) }, \
36  { "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_gps_date_time_t, min) }, \
37  { "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_gps_date_time_t, sec) }, \
38  { "clockStat", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gps_date_time_t, clockStat) }, \
39  { "visSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_gps_date_time_t, visSat) }, \
40  { "useSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_gps_date_time_t, useSat) }, \
41  { "GppGl", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_gps_date_time_t, GppGl) }, \
42  { "sigUsedMask", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_gps_date_time_t, sigUsedMask) }, \
43  { "percentUsed", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_gps_date_time_t, percentUsed) }, \
44  } \
45 }
46 
47 
68 static inline uint16_t mavlink_msg_gps_date_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
69  uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t clockStat, uint8_t visSat, uint8_t useSat, uint8_t GppGl, uint8_t sigUsedMask, uint8_t percentUsed)
70 {
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
73  _mav_put_uint8_t(buf, 0, year);
74  _mav_put_uint8_t(buf, 1, month);
75  _mav_put_uint8_t(buf, 2, day);
76  _mav_put_uint8_t(buf, 3, hour);
77  _mav_put_uint8_t(buf, 4, min);
78  _mav_put_uint8_t(buf, 5, sec);
79  _mav_put_uint8_t(buf, 6, clockStat);
80  _mav_put_uint8_t(buf, 7, visSat);
81  _mav_put_uint8_t(buf, 8, useSat);
82  _mav_put_uint8_t(buf, 9, GppGl);
83  _mav_put_uint8_t(buf, 10, sigUsedMask);
84  _mav_put_uint8_t(buf, 11, percentUsed);
85 
87 #else
89  packet.year = year;
90  packet.month = month;
91  packet.day = day;
92  packet.hour = hour;
93  packet.min = min;
94  packet.sec = sec;
95  packet.clockStat = clockStat;
96  packet.visSat = visSat;
97  packet.useSat = useSat;
98  packet.GppGl = GppGl;
99  packet.sigUsedMask = sigUsedMask;
100  packet.percentUsed = percentUsed;
101 
103 #endif
104 
105  msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
106 #if MAVLINK_CRC_EXTRA
108 #else
109  return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
110 #endif
111 }
112 
133 static inline uint16_t mavlink_msg_gps_date_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
134  mavlink_message_t* msg,
135  uint8_t year,uint8_t month,uint8_t day,uint8_t hour,uint8_t min,uint8_t sec,uint8_t clockStat,uint8_t visSat,uint8_t useSat,uint8_t GppGl,uint8_t sigUsedMask,uint8_t percentUsed)
136 {
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
139  _mav_put_uint8_t(buf, 0, year);
140  _mav_put_uint8_t(buf, 1, month);
141  _mav_put_uint8_t(buf, 2, day);
142  _mav_put_uint8_t(buf, 3, hour);
143  _mav_put_uint8_t(buf, 4, min);
144  _mav_put_uint8_t(buf, 5, sec);
145  _mav_put_uint8_t(buf, 6, clockStat);
146  _mav_put_uint8_t(buf, 7, visSat);
147  _mav_put_uint8_t(buf, 8, useSat);
148  _mav_put_uint8_t(buf, 9, GppGl);
149  _mav_put_uint8_t(buf, 10, sigUsedMask);
150  _mav_put_uint8_t(buf, 11, percentUsed);
151 
153 #else
155  packet.year = year;
156  packet.month = month;
157  packet.day = day;
158  packet.hour = hour;
159  packet.min = min;
160  packet.sec = sec;
161  packet.clockStat = clockStat;
162  packet.visSat = visSat;
163  packet.useSat = useSat;
164  packet.GppGl = GppGl;
165  packet.sigUsedMask = sigUsedMask;
166  packet.percentUsed = percentUsed;
167 
169 #endif
170 
171  msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
172 #if MAVLINK_CRC_EXTRA
174 #else
175  return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
176 #endif
177 }
178 
187 static inline uint16_t mavlink_msg_gps_date_time_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_date_time_t* gps_date_time)
188 {
189  return mavlink_msg_gps_date_time_pack(system_id, component_id, msg, gps_date_time->year, gps_date_time->month, gps_date_time->day, gps_date_time->hour, gps_date_time->min, gps_date_time->sec, gps_date_time->clockStat, gps_date_time->visSat, gps_date_time->useSat, gps_date_time->GppGl, gps_date_time->sigUsedMask, gps_date_time->percentUsed);
190 }
191 
201 static inline uint16_t mavlink_msg_gps_date_time_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_date_time_t* gps_date_time)
202 {
203  return mavlink_msg_gps_date_time_pack_chan(system_id, component_id, chan, msg, gps_date_time->year, gps_date_time->month, gps_date_time->day, gps_date_time->hour, gps_date_time->min, gps_date_time->sec, gps_date_time->clockStat, gps_date_time->visSat, gps_date_time->useSat, gps_date_time->GppGl, gps_date_time->sigUsedMask, gps_date_time->percentUsed);
204 }
205 
223 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
224 
225 static inline void mavlink_msg_gps_date_time_send(mavlink_channel_t chan, uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t clockStat, uint8_t visSat, uint8_t useSat, uint8_t GppGl, uint8_t sigUsedMask, uint8_t percentUsed)
226 {
227 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
229  _mav_put_uint8_t(buf, 0, year);
230  _mav_put_uint8_t(buf, 1, month);
231  _mav_put_uint8_t(buf, 2, day);
232  _mav_put_uint8_t(buf, 3, hour);
233  _mav_put_uint8_t(buf, 4, min);
234  _mav_put_uint8_t(buf, 5, sec);
235  _mav_put_uint8_t(buf, 6, clockStat);
236  _mav_put_uint8_t(buf, 7, visSat);
237  _mav_put_uint8_t(buf, 8, useSat);
238  _mav_put_uint8_t(buf, 9, GppGl);
239  _mav_put_uint8_t(buf, 10, sigUsedMask);
240  _mav_put_uint8_t(buf, 11, percentUsed);
241 
242 #if MAVLINK_CRC_EXTRA
244 #else
245  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, buf, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
246 #endif
247 #else
249  packet.year = year;
250  packet.month = month;
251  packet.day = day;
252  packet.hour = hour;
253  packet.min = min;
254  packet.sec = sec;
255  packet.clockStat = clockStat;
256  packet.visSat = visSat;
257  packet.useSat = useSat;
258  packet.GppGl = GppGl;
259  packet.sigUsedMask = sigUsedMask;
260  packet.percentUsed = percentUsed;
261 
262 #if MAVLINK_CRC_EXTRA
263  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)&packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
264 #else
265  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)&packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
266 #endif
267 #endif
268 }
269 
270 #if MAVLINK_MSG_ID_GPS_DATE_TIME_LEN <= MAVLINK_MAX_PAYLOAD_LEN
271 /*
272  This varient of _send() can be used to save stack space by re-using
273  memory from the receive buffer. The caller provides a
274  mavlink_message_t which is the size of a full mavlink message. This
275  is usually the receive buffer for the channel, and allows a reply to an
276  incoming message with minimum stack space usage.
277  */
278 static inline void mavlink_msg_gps_date_time_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t year, uint8_t month, uint8_t day, uint8_t hour, uint8_t min, uint8_t sec, uint8_t clockStat, uint8_t visSat, uint8_t useSat, uint8_t GppGl, uint8_t sigUsedMask, uint8_t percentUsed)
279 {
280 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
281  char *buf = (char *)msgbuf;
282  _mav_put_uint8_t(buf, 0, year);
283  _mav_put_uint8_t(buf, 1, month);
284  _mav_put_uint8_t(buf, 2, day);
285  _mav_put_uint8_t(buf, 3, hour);
286  _mav_put_uint8_t(buf, 4, min);
287  _mav_put_uint8_t(buf, 5, sec);
288  _mav_put_uint8_t(buf, 6, clockStat);
289  _mav_put_uint8_t(buf, 7, visSat);
290  _mav_put_uint8_t(buf, 8, useSat);
291  _mav_put_uint8_t(buf, 9, GppGl);
292  _mav_put_uint8_t(buf, 10, sigUsedMask);
293  _mav_put_uint8_t(buf, 11, percentUsed);
294 
295 #if MAVLINK_CRC_EXTRA
297 #else
298  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, buf, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
299 #endif
300 #else
302  packet->year = year;
303  packet->month = month;
304  packet->day = day;
305  packet->hour = hour;
306  packet->min = min;
307  packet->sec = sec;
308  packet->clockStat = clockStat;
309  packet->visSat = visSat;
310  packet->useSat = useSat;
311  packet->GppGl = GppGl;
312  packet->sigUsedMask = sigUsedMask;
313  packet->percentUsed = percentUsed;
314 
315 #if MAVLINK_CRC_EXTRA
316  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
317 #else
318  _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
319 #endif
320 #endif
321 }
322 #endif
323 
324 #endif
325 
326 // MESSAGE GPS_DATE_TIME UNPACKING
327 
328 
334 static inline uint8_t mavlink_msg_gps_date_time_get_year(const mavlink_message_t* msg)
335 {
336  return _MAV_RETURN_uint8_t(msg, 0);
337 }
338 
344 static inline uint8_t mavlink_msg_gps_date_time_get_month(const mavlink_message_t* msg)
345 {
346  return _MAV_RETURN_uint8_t(msg, 1);
347 }
348 
354 static inline uint8_t mavlink_msg_gps_date_time_get_day(const mavlink_message_t* msg)
355 {
356  return _MAV_RETURN_uint8_t(msg, 2);
357 }
358 
364 static inline uint8_t mavlink_msg_gps_date_time_get_hour(const mavlink_message_t* msg)
365 {
366  return _MAV_RETURN_uint8_t(msg, 3);
367 }
368 
374 static inline uint8_t mavlink_msg_gps_date_time_get_min(const mavlink_message_t* msg)
375 {
376  return _MAV_RETURN_uint8_t(msg, 4);
377 }
378 
384 static inline uint8_t mavlink_msg_gps_date_time_get_sec(const mavlink_message_t* msg)
385 {
386  return _MAV_RETURN_uint8_t(msg, 5);
387 }
388 
394 static inline uint8_t mavlink_msg_gps_date_time_get_clockStat(const mavlink_message_t* msg)
395 {
396  return _MAV_RETURN_uint8_t(msg, 6);
397 }
398 
404 static inline uint8_t mavlink_msg_gps_date_time_get_visSat(const mavlink_message_t* msg)
405 {
406  return _MAV_RETURN_uint8_t(msg, 7);
407 }
408 
414 static inline uint8_t mavlink_msg_gps_date_time_get_useSat(const mavlink_message_t* msg)
415 {
416  return _MAV_RETURN_uint8_t(msg, 8);
417 }
418 
424 static inline uint8_t mavlink_msg_gps_date_time_get_GppGl(const mavlink_message_t* msg)
425 {
426  return _MAV_RETURN_uint8_t(msg, 9);
427 }
428 
434 static inline uint8_t mavlink_msg_gps_date_time_get_sigUsedMask(const mavlink_message_t* msg)
435 {
436  return _MAV_RETURN_uint8_t(msg, 10);
437 }
438 
444 static inline uint8_t mavlink_msg_gps_date_time_get_percentUsed(const mavlink_message_t* msg)
445 {
446  return _MAV_RETURN_uint8_t(msg, 11);
447 }
448 
455 static inline void mavlink_msg_gps_date_time_decode(const mavlink_message_t* msg, mavlink_gps_date_time_t* gps_date_time)
456 {
457 #if MAVLINK_NEED_BYTE_SWAP
458  gps_date_time->year = mavlink_msg_gps_date_time_get_year(msg);
459  gps_date_time->month = mavlink_msg_gps_date_time_get_month(msg);
460  gps_date_time->day = mavlink_msg_gps_date_time_get_day(msg);
461  gps_date_time->hour = mavlink_msg_gps_date_time_get_hour(msg);
462  gps_date_time->min = mavlink_msg_gps_date_time_get_min(msg);
463  gps_date_time->sec = mavlink_msg_gps_date_time_get_sec(msg);
464  gps_date_time->clockStat = mavlink_msg_gps_date_time_get_clockStat(msg);
465  gps_date_time->visSat = mavlink_msg_gps_date_time_get_visSat(msg);
466  gps_date_time->useSat = mavlink_msg_gps_date_time_get_useSat(msg);
467  gps_date_time->GppGl = mavlink_msg_gps_date_time_get_GppGl(msg);
468  gps_date_time->sigUsedMask = mavlink_msg_gps_date_time_get_sigUsedMask(msg);
469  gps_date_time->percentUsed = mavlink_msg_gps_date_time_get_percentUsed(msg);
470 #else
471  memcpy(gps_date_time, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
472 #endif
473 }
#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
int16_t min
Minimum pwm value that is sent to the servo.
Definition: mixer.h:12