RflySimSDK v3.08
RflySimSDK说明文档
载入中...
搜索中...
未找到
mavlink_msg_gps_date_time.h
1#pragma once
2// MESSAGE GPS_DATE_TIME PACKING
3
4#define MAVLINK_MSG_ID_GPS_DATE_TIME 179
5
6MAVPACKED(
7typedef struct __mavlink_gps_date_time_t {
8 uint8_t year; /*< Year reported by Gps */
9 uint8_t month; /*< Month reported by Gps */
10 uint8_t day; /*< Day reported by Gps */
11 uint8_t hour; /*< Hour reported by Gps */
12 uint8_t min; /*< Min reported by Gps */
13 uint8_t sec; /*< Sec reported by Gps */
14 uint8_t clockStat; /*< Clock Status. See table 47 page 211 OEMStar Manual */
15 uint8_t visSat; /*< Visible satellites reported by Gps */
16 uint8_t useSat; /*< Used satellites in Solution */
17 uint8_t GppGl; /*< GPS+GLONASS satellites in Solution */
18 uint8_t sigUsedMask; /*< GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)*/
19 uint8_t percentUsed; /*< Percent used GPS*/
20}) mavlink_gps_date_time_t;
21
22#define MAVLINK_MSG_ID_GPS_DATE_TIME_LEN 12
23#define MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN 12
24#define MAVLINK_MSG_ID_179_LEN 12
25#define MAVLINK_MSG_ID_179_MIN_LEN 12
26
27#define MAVLINK_MSG_ID_GPS_DATE_TIME_CRC 132
28#define MAVLINK_MSG_ID_179_CRC 132
29
30
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_GPS_DATE_TIME { \
34 179, \
35 "GPS_DATE_TIME", \
36 12, \
37 { { "year", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_date_time_t, year) }, \
38 { "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_date_time_t, month) }, \
39 { "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_date_time_t, day) }, \
40 { "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_gps_date_time_t, hour) }, \
41 { "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_gps_date_time_t, min) }, \
42 { "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_gps_date_time_t, sec) }, \
43 { "clockStat", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gps_date_time_t, clockStat) }, \
44 { "visSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_gps_date_time_t, visSat) }, \
45 { "useSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_gps_date_time_t, useSat) }, \
46 { "GppGl", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_gps_date_time_t, GppGl) }, \
47 { "sigUsedMask", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_gps_date_time_t, sigUsedMask) }, \
48 { "percentUsed", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_gps_date_time_t, percentUsed) }, \
49 } \
50}
51#else
52#define MAVLINK_MESSAGE_INFO_GPS_DATE_TIME { \
53 "GPS_DATE_TIME", \
54 12, \
55 { { "year", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_date_time_t, year) }, \
56 { "month", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_gps_date_time_t, month) }, \
57 { "day", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_gps_date_time_t, day) }, \
58 { "hour", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_gps_date_time_t, hour) }, \
59 { "min", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_gps_date_time_t, min) }, \
60 { "sec", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_gps_date_time_t, sec) }, \
61 { "clockStat", NULL, MAVLINK_TYPE_UINT8_T, 0, 6, offsetof(mavlink_gps_date_time_t, clockStat) }, \
62 { "visSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 7, offsetof(mavlink_gps_date_time_t, visSat) }, \
63 { "useSat", NULL, MAVLINK_TYPE_UINT8_T, 0, 8, offsetof(mavlink_gps_date_time_t, useSat) }, \
64 { "GppGl", NULL, MAVLINK_TYPE_UINT8_T, 0, 9, offsetof(mavlink_gps_date_time_t, GppGl) }, \
65 { "sigUsedMask", NULL, MAVLINK_TYPE_UINT8_T, 0, 10, offsetof(mavlink_gps_date_time_t, sigUsedMask) }, \
66 { "percentUsed", NULL, MAVLINK_TYPE_UINT8_T, 0, 11, offsetof(mavlink_gps_date_time_t, percentUsed) }, \
67 } \
68}
69#endif
70
71/**
72 * @brief Pack a gps_date_time message
73 * @param system_id ID of this system
74 * @param component_id ID of this component (e.g. 200 for IMU)
75 * @param msg The MAVLink message to compress the data into
76 *
77 * @param year Year reported by Gps
78 * @param month Month reported by Gps
79 * @param day Day reported by Gps
80 * @param hour Hour reported by Gps
81 * @param min Min reported by Gps
82 * @param sec Sec reported by Gps
83 * @param clockStat Clock Status. See table 47 page 211 OEMStar Manual
84 * @param visSat Visible satellites reported by Gps
85 * @param useSat Used satellites in Solution
86 * @param GppGl GPS+GLONASS satellites in Solution
87 * @param sigUsedMask GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
88 * @param percentUsed Percent used GPS
89 * @return length of the message in bytes (excluding serial stream start sign)
90 */
91static inline uint16_t mavlink_msg_gps_date_time_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
92 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)
93{
94#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
95 char buf[MAVLINK_MSG_ID_GPS_DATE_TIME_LEN];
96 _mav_put_uint8_t(buf, 0, year);
97 _mav_put_uint8_t(buf, 1, month);
98 _mav_put_uint8_t(buf, 2, day);
99 _mav_put_uint8_t(buf, 3, hour);
100 _mav_put_uint8_t(buf, 4, min);
101 _mav_put_uint8_t(buf, 5, sec);
102 _mav_put_uint8_t(buf, 6, clockStat);
103 _mav_put_uint8_t(buf, 7, visSat);
104 _mav_put_uint8_t(buf, 8, useSat);
105 _mav_put_uint8_t(buf, 9, GppGl);
106 _mav_put_uint8_t(buf, 10, sigUsedMask);
107 _mav_put_uint8_t(buf, 11, percentUsed);
108
109 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
110#else
111 mavlink_gps_date_time_t packet;
112 packet.year = year;
113 packet.month = month;
114 packet.day = day;
115 packet.hour = hour;
116 packet.min = min;
117 packet.sec = sec;
118 packet.clockStat = clockStat;
119 packet.visSat = visSat;
120 packet.useSat = useSat;
121 packet.GppGl = GppGl;
122 packet.sigUsedMask = sigUsedMask;
123 packet.percentUsed = percentUsed;
124
125 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
126#endif
127
128 msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
129 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
130}
131
132/**
133 * @brief Pack a gps_date_time message on a channel
134 * @param system_id ID of this system
135 * @param component_id ID of this component (e.g. 200 for IMU)
136 * @param chan The MAVLink channel this message will be sent over
137 * @param msg The MAVLink message to compress the data into
138 * @param year Year reported by Gps
139 * @param month Month reported by Gps
140 * @param day Day reported by Gps
141 * @param hour Hour reported by Gps
142 * @param min Min reported by Gps
143 * @param sec Sec reported by Gps
144 * @param clockStat Clock Status. See table 47 page 211 OEMStar Manual
145 * @param visSat Visible satellites reported by Gps
146 * @param useSat Used satellites in Solution
147 * @param GppGl GPS+GLONASS satellites in Solution
148 * @param sigUsedMask GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
149 * @param percentUsed Percent used GPS
150 * @return length of the message in bytes (excluding serial stream start sign)
151 */
152static inline uint16_t mavlink_msg_gps_date_time_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
153 mavlink_message_t* msg,
154 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)
155{
156#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
157 char buf[MAVLINK_MSG_ID_GPS_DATE_TIME_LEN];
158 _mav_put_uint8_t(buf, 0, year);
159 _mav_put_uint8_t(buf, 1, month);
160 _mav_put_uint8_t(buf, 2, day);
161 _mav_put_uint8_t(buf, 3, hour);
162 _mav_put_uint8_t(buf, 4, min);
163 _mav_put_uint8_t(buf, 5, sec);
164 _mav_put_uint8_t(buf, 6, clockStat);
165 _mav_put_uint8_t(buf, 7, visSat);
166 _mav_put_uint8_t(buf, 8, useSat);
167 _mav_put_uint8_t(buf, 9, GppGl);
168 _mav_put_uint8_t(buf, 10, sigUsedMask);
169 _mav_put_uint8_t(buf, 11, percentUsed);
170
171 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
172#else
173 mavlink_gps_date_time_t packet;
174 packet.year = year;
175 packet.month = month;
176 packet.day = day;
177 packet.hour = hour;
178 packet.min = min;
179 packet.sec = sec;
180 packet.clockStat = clockStat;
181 packet.visSat = visSat;
182 packet.useSat = useSat;
183 packet.GppGl = GppGl;
184 packet.sigUsedMask = sigUsedMask;
185 packet.percentUsed = percentUsed;
186
187 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
188#endif
189
190 msg->msgid = MAVLINK_MSG_ID_GPS_DATE_TIME;
191 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
192}
193
194/**
195 * @brief Encode a gps_date_time struct
196 *
197 * @param system_id ID of this system
198 * @param component_id ID of this component (e.g. 200 for IMU)
199 * @param msg The MAVLink message to compress the data into
200 * @param gps_date_time C-struct to read the message contents from
201 */
202static 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)
203{
204 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);
205}
206
207/**
208 * @brief Encode a gps_date_time struct on a channel
209 *
210 * @param system_id ID of this system
211 * @param component_id ID of this component (e.g. 200 for IMU)
212 * @param chan The MAVLink channel this message will be sent over
213 * @param msg The MAVLink message to compress the data into
214 * @param gps_date_time C-struct to read the message contents from
215 */
216static 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)
217{
218 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);
219}
220
221/**
222 * @brief Send a gps_date_time message
223 * @param chan MAVLink channel to send the message
224 *
225 * @param year Year reported by Gps
226 * @param month Month reported by Gps
227 * @param day Day reported by Gps
228 * @param hour Hour reported by Gps
229 * @param min Min reported by Gps
230 * @param sec Sec reported by Gps
231 * @param clockStat Clock Status. See table 47 page 211 OEMStar Manual
232 * @param visSat Visible satellites reported by Gps
233 * @param useSat Used satellites in Solution
234 * @param GppGl GPS+GLONASS satellites in Solution
235 * @param sigUsedMask GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
236 * @param percentUsed Percent used GPS
237 */
238#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
239
240static 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)
241{
242#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
243 char buf[MAVLINK_MSG_ID_GPS_DATE_TIME_LEN];
244 _mav_put_uint8_t(buf, 0, year);
245 _mav_put_uint8_t(buf, 1, month);
246 _mav_put_uint8_t(buf, 2, day);
247 _mav_put_uint8_t(buf, 3, hour);
248 _mav_put_uint8_t(buf, 4, min);
249 _mav_put_uint8_t(buf, 5, sec);
250 _mav_put_uint8_t(buf, 6, clockStat);
251 _mav_put_uint8_t(buf, 7, visSat);
252 _mav_put_uint8_t(buf, 8, useSat);
253 _mav_put_uint8_t(buf, 9, GppGl);
254 _mav_put_uint8_t(buf, 10, sigUsedMask);
255 _mav_put_uint8_t(buf, 11, percentUsed);
256
257 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, buf, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
258#else
259 mavlink_gps_date_time_t packet;
260 packet.year = year;
261 packet.month = month;
262 packet.day = day;
263 packet.hour = hour;
264 packet.min = min;
265 packet.sec = sec;
266 packet.clockStat = clockStat;
267 packet.visSat = visSat;
268 packet.useSat = useSat;
269 packet.GppGl = GppGl;
270 packet.sigUsedMask = sigUsedMask;
271 packet.percentUsed = percentUsed;
272
273 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)&packet, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
274#endif
275}
276
277/**
278 * @brief Send a gps_date_time message
279 * @param chan MAVLink channel to send the message
280 * @param struct The MAVLink struct to serialize
281 */
282static inline void mavlink_msg_gps_date_time_send_struct(mavlink_channel_t chan, const mavlink_gps_date_time_t* gps_date_time)
283{
284#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 mavlink_msg_gps_date_time_send(chan, 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);
286#else
287 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)gps_date_time, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
288#endif
289}
290
291#if MAVLINK_MSG_ID_GPS_DATE_TIME_LEN <= MAVLINK_MAX_PAYLOAD_LEN
292/*
293 This varient of _send() can be used to save stack space by re-using
294 memory from the receive buffer. The caller provides a
295 mavlink_message_t which is the size of a full mavlink message. This
296 is usually the receive buffer for the channel, and allows a reply to an
297 incoming message with minimum stack space usage.
298 */
299static 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)
300{
301#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
302 char *buf = (char *)msgbuf;
303 _mav_put_uint8_t(buf, 0, year);
304 _mav_put_uint8_t(buf, 1, month);
305 _mav_put_uint8_t(buf, 2, day);
306 _mav_put_uint8_t(buf, 3, hour);
307 _mav_put_uint8_t(buf, 4, min);
308 _mav_put_uint8_t(buf, 5, sec);
309 _mav_put_uint8_t(buf, 6, clockStat);
310 _mav_put_uint8_t(buf, 7, visSat);
311 _mav_put_uint8_t(buf, 8, useSat);
312 _mav_put_uint8_t(buf, 9, GppGl);
313 _mav_put_uint8_t(buf, 10, sigUsedMask);
314 _mav_put_uint8_t(buf, 11, percentUsed);
315
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, buf, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
317#else
318 mavlink_gps_date_time_t *packet = (mavlink_gps_date_time_t *)msgbuf;
319 packet->year = year;
320 packet->month = month;
321 packet->day = day;
322 packet->hour = hour;
323 packet->min = min;
324 packet->sec = sec;
325 packet->clockStat = clockStat;
326 packet->visSat = visSat;
327 packet->useSat = useSat;
328 packet->GppGl = GppGl;
329 packet->sigUsedMask = sigUsedMask;
330 packet->percentUsed = percentUsed;
331
332 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_DATE_TIME, (const char *)packet, MAVLINK_MSG_ID_GPS_DATE_TIME_MIN_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN, MAVLINK_MSG_ID_GPS_DATE_TIME_CRC);
333#endif
334}
335#endif
336
337#endif
338
339// MESSAGE GPS_DATE_TIME UNPACKING
340
341
342/**
343 * @brief Get field year from gps_date_time message
344 *
345 * @return Year reported by Gps
346 */
347static inline uint8_t mavlink_msg_gps_date_time_get_year(const mavlink_message_t* msg)
348{
349 return _MAV_RETURN_uint8_t(msg, 0);
350}
351
352/**
353 * @brief Get field month from gps_date_time message
354 *
355 * @return Month reported by Gps
356 */
357static inline uint8_t mavlink_msg_gps_date_time_get_month(const mavlink_message_t* msg)
358{
359 return _MAV_RETURN_uint8_t(msg, 1);
360}
361
362/**
363 * @brief Get field day from gps_date_time message
364 *
365 * @return Day reported by Gps
366 */
367static inline uint8_t mavlink_msg_gps_date_time_get_day(const mavlink_message_t* msg)
368{
369 return _MAV_RETURN_uint8_t(msg, 2);
370}
371
372/**
373 * @brief Get field hour from gps_date_time message
374 *
375 * @return Hour reported by Gps
376 */
377static inline uint8_t mavlink_msg_gps_date_time_get_hour(const mavlink_message_t* msg)
378{
379 return _MAV_RETURN_uint8_t(msg, 3);
380}
381
382/**
383 * @brief Get field min from gps_date_time message
384 *
385 * @return Min reported by Gps
386 */
387static inline uint8_t mavlink_msg_gps_date_time_get_min(const mavlink_message_t* msg)
388{
389 return _MAV_RETURN_uint8_t(msg, 4);
390}
391
392/**
393 * @brief Get field sec from gps_date_time message
394 *
395 * @return Sec reported by Gps
396 */
397static inline uint8_t mavlink_msg_gps_date_time_get_sec(const mavlink_message_t* msg)
398{
399 return _MAV_RETURN_uint8_t(msg, 5);
400}
401
402/**
403 * @brief Get field clockStat from gps_date_time message
404 *
405 * @return Clock Status. See table 47 page 211 OEMStar Manual
406 */
407static inline uint8_t mavlink_msg_gps_date_time_get_clockStat(const mavlink_message_t* msg)
408{
409 return _MAV_RETURN_uint8_t(msg, 6);
410}
411
412/**
413 * @brief Get field visSat from gps_date_time message
414 *
415 * @return Visible satellites reported by Gps
416 */
417static inline uint8_t mavlink_msg_gps_date_time_get_visSat(const mavlink_message_t* msg)
418{
419 return _MAV_RETURN_uint8_t(msg, 7);
420}
421
422/**
423 * @brief Get field useSat from gps_date_time message
424 *
425 * @return Used satellites in Solution
426 */
427static inline uint8_t mavlink_msg_gps_date_time_get_useSat(const mavlink_message_t* msg)
428{
429 return _MAV_RETURN_uint8_t(msg, 8);
430}
431
432/**
433 * @brief Get field GppGl from gps_date_time message
434 *
435 * @return GPS+GLONASS satellites in Solution
436 */
437static inline uint8_t mavlink_msg_gps_date_time_get_GppGl(const mavlink_message_t* msg)
438{
439 return _MAV_RETURN_uint8_t(msg, 9);
440}
441
442/**
443 * @brief Get field sigUsedMask from gps_date_time message
444 *
445 * @return GPS and GLONASS usage mask (bit 0 GPS_used? bit_4 GLONASS_used?)
446 */
447static inline uint8_t mavlink_msg_gps_date_time_get_sigUsedMask(const mavlink_message_t* msg)
448{
449 return _MAV_RETURN_uint8_t(msg, 10);
450}
451
452/**
453 * @brief Get field percentUsed from gps_date_time message
454 *
455 * @return Percent used GPS
456 */
457static inline uint8_t mavlink_msg_gps_date_time_get_percentUsed(const mavlink_message_t* msg)
458{
459 return _MAV_RETURN_uint8_t(msg, 11);
460}
461
462/**
463 * @brief Decode a gps_date_time message into a struct
464 *
465 * @param msg The message to decode
466 * @param gps_date_time C-struct to decode the message contents into
467 */
468static inline void mavlink_msg_gps_date_time_decode(const mavlink_message_t* msg, mavlink_gps_date_time_t* gps_date_time)
469{
470#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
471 gps_date_time->year = mavlink_msg_gps_date_time_get_year(msg);
472 gps_date_time->month = mavlink_msg_gps_date_time_get_month(msg);
473 gps_date_time->day = mavlink_msg_gps_date_time_get_day(msg);
474 gps_date_time->hour = mavlink_msg_gps_date_time_get_hour(msg);
475 gps_date_time->min = mavlink_msg_gps_date_time_get_min(msg);
476 gps_date_time->sec = mavlink_msg_gps_date_time_get_sec(msg);
477 gps_date_time->clockStat = mavlink_msg_gps_date_time_get_clockStat(msg);
478 gps_date_time->visSat = mavlink_msg_gps_date_time_get_visSat(msg);
479 gps_date_time->useSat = mavlink_msg_gps_date_time_get_useSat(msg);
480 gps_date_time->GppGl = mavlink_msg_gps_date_time_get_GppGl(msg);
481 gps_date_time->sigUsedMask = mavlink_msg_gps_date_time_get_sigUsedMask(msg);
482 gps_date_time->percentUsed = mavlink_msg_gps_date_time_get_percentUsed(msg);
483#else
484 uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_DATE_TIME_LEN? msg->len : MAVLINK_MSG_ID_GPS_DATE_TIME_LEN;
485 memset(gps_date_time, 0, MAVLINK_MSG_ID_GPS_DATE_TIME_LEN);
486 memcpy(gps_date_time, _MAV_PAYLOAD(msg), len);
487#endif
488}