Move telemetry displayport init and cms device registering
[betaflight.git] / lib / main / MAVLink / common / mavlink_msg_gps2_raw.h
blob9101b24583b552b1db0d987a5a0806a9e56628d8
1 // MESSAGE GPS2_RAW PACKING
3 #define MAVLINK_MSG_ID_GPS2_RAW 124
5 typedef struct __mavlink_gps2_raw_t
7 uint64_t time_usec; ///< Timestamp (microseconds since UNIX epoch or microseconds since system boot)
8 int32_t lat; ///< Latitude (WGS84), in degrees * 1E7
9 int32_t lon; ///< Longitude (WGS84), in degrees * 1E7
10 int32_t alt; ///< Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
11 uint32_t dgps_age; ///< Age of DGPS info
12 uint16_t eph; ///< GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
13 uint16_t epv; ///< GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
14 uint16_t vel; ///< GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
15 uint16_t cog; ///< Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
16 uint8_t fix_type; ///< 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
17 uint8_t satellites_visible; ///< Number of satellites visible. If unknown, set to 255
18 uint8_t dgps_numch; ///< Number of DGPS satellites
19 } mavlink_gps2_raw_t;
21 #define MAVLINK_MSG_ID_GPS2_RAW_LEN 35
22 #define MAVLINK_MSG_ID_124_LEN 35
24 #define MAVLINK_MSG_ID_GPS2_RAW_CRC 87
25 #define MAVLINK_MSG_ID_124_CRC 87
29 #define MAVLINK_MESSAGE_INFO_GPS2_RAW { \
30 "GPS2_RAW", \
31 12, \
32 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps2_raw_t, time_usec) }, \
33 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps2_raw_t, lat) }, \
34 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps2_raw_t, lon) }, \
35 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps2_raw_t, alt) }, \
36 { "dgps_age", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_gps2_raw_t, dgps_age) }, \
37 { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps2_raw_t, eph) }, \
38 { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps2_raw_t, epv) }, \
39 { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 28, offsetof(mavlink_gps2_raw_t, vel) }, \
40 { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 30, offsetof(mavlink_gps2_raw_t, cog) }, \
41 { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 32, offsetof(mavlink_gps2_raw_t, fix_type) }, \
42 { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 33, offsetof(mavlink_gps2_raw_t, satellites_visible) }, \
43 { "dgps_numch", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_gps2_raw_t, dgps_numch) }, \
44 } \
48 /**
49 * @brief Pack a gps2_raw message
50 * @param system_id ID of this system
51 * @param component_id ID of this component (e.g. 200 for IMU)
52 * @param msg The MAVLink message to compress the data into
54 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
55 * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
56 * @param lat Latitude (WGS84), in degrees * 1E7
57 * @param lon Longitude (WGS84), in degrees * 1E7
58 * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
59 * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
60 * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
61 * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
62 * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
63 * @param satellites_visible Number of satellites visible. If unknown, set to 255
64 * @param dgps_numch Number of DGPS satellites
65 * @param dgps_age Age of DGPS info
66 * @return length of the message in bytes (excluding serial stream start sign)
68 static inline uint16_t mavlink_msg_gps2_raw_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
69 uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
72 char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
73 _mav_put_uint64_t(buf, 0, time_usec);
74 _mav_put_int32_t(buf, 8, lat);
75 _mav_put_int32_t(buf, 12, lon);
76 _mav_put_int32_t(buf, 16, alt);
77 _mav_put_uint32_t(buf, 20, dgps_age);
78 _mav_put_uint16_t(buf, 24, eph);
79 _mav_put_uint16_t(buf, 26, epv);
80 _mav_put_uint16_t(buf, 28, vel);
81 _mav_put_uint16_t(buf, 30, cog);
82 _mav_put_uint8_t(buf, 32, fix_type);
83 _mav_put_uint8_t(buf, 33, satellites_visible);
84 _mav_put_uint8_t(buf, 34, dgps_numch);
86 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
87 #else
88 mavlink_gps2_raw_t packet;
89 packet.time_usec = time_usec;
90 packet.lat = lat;
91 packet.lon = lon;
92 packet.alt = alt;
93 packet.dgps_age = dgps_age;
94 packet.eph = eph;
95 packet.epv = epv;
96 packet.vel = vel;
97 packet.cog = cog;
98 packet.fix_type = fix_type;
99 packet.satellites_visible = satellites_visible;
100 packet.dgps_numch = dgps_numch;
102 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
103 #endif
105 msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
106 #if MAVLINK_CRC_EXTRA
107 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
108 #else
109 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS2_RAW_LEN);
110 #endif
114 * @brief Pack a gps2_raw message on a channel
115 * @param system_id ID of this system
116 * @param component_id ID of this component (e.g. 200 for IMU)
117 * @param chan The MAVLink channel this message will be sent over
118 * @param msg The MAVLink message to compress the data into
119 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
120 * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
121 * @param lat Latitude (WGS84), in degrees * 1E7
122 * @param lon Longitude (WGS84), in degrees * 1E7
123 * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
124 * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
125 * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
126 * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
127 * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
128 * @param satellites_visible Number of satellites visible. If unknown, set to 255
129 * @param dgps_numch Number of DGPS satellites
130 * @param dgps_age Age of DGPS info
131 * @return length of the message in bytes (excluding serial stream start sign)
133 static inline uint16_t mavlink_msg_gps2_raw_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
134 mavlink_message_t* msg,
135 uint64_t time_usec,uint8_t fix_type,int32_t lat,int32_t lon,int32_t alt,uint16_t eph,uint16_t epv,uint16_t vel,uint16_t cog,uint8_t satellites_visible,uint8_t dgps_numch,uint32_t dgps_age)
137 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
138 char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
139 _mav_put_uint64_t(buf, 0, time_usec);
140 _mav_put_int32_t(buf, 8, lat);
141 _mav_put_int32_t(buf, 12, lon);
142 _mav_put_int32_t(buf, 16, alt);
143 _mav_put_uint32_t(buf, 20, dgps_age);
144 _mav_put_uint16_t(buf, 24, eph);
145 _mav_put_uint16_t(buf, 26, epv);
146 _mav_put_uint16_t(buf, 28, vel);
147 _mav_put_uint16_t(buf, 30, cog);
148 _mav_put_uint8_t(buf, 32, fix_type);
149 _mav_put_uint8_t(buf, 33, satellites_visible);
150 _mav_put_uint8_t(buf, 34, dgps_numch);
152 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
153 #else
154 mavlink_gps2_raw_t packet;
155 packet.time_usec = time_usec;
156 packet.lat = lat;
157 packet.lon = lon;
158 packet.alt = alt;
159 packet.dgps_age = dgps_age;
160 packet.eph = eph;
161 packet.epv = epv;
162 packet.vel = vel;
163 packet.cog = cog;
164 packet.fix_type = fix_type;
165 packet.satellites_visible = satellites_visible;
166 packet.dgps_numch = dgps_numch;
168 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
169 #endif
171 msg->msgid = MAVLINK_MSG_ID_GPS2_RAW;
172 #if MAVLINK_CRC_EXTRA
173 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
174 #else
175 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS2_RAW_LEN);
176 #endif
180 * @brief Encode a gps2_raw struct
182 * @param system_id ID of this system
183 * @param component_id ID of this component (e.g. 200 for IMU)
184 * @param msg The MAVLink message to compress the data into
185 * @param gps2_raw C-struct to read the message contents from
187 static inline uint16_t mavlink_msg_gps2_raw_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
189 return mavlink_msg_gps2_raw_pack(system_id, component_id, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
193 * @brief Encode a gps2_raw struct on a channel
195 * @param system_id ID of this system
196 * @param component_id ID of this component (e.g. 200 for IMU)
197 * @param chan The MAVLink channel this message will be sent over
198 * @param msg The MAVLink message to compress the data into
199 * @param gps2_raw C-struct to read the message contents from
201 static inline uint16_t mavlink_msg_gps2_raw_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps2_raw_t* gps2_raw)
203 return mavlink_msg_gps2_raw_pack_chan(system_id, component_id, chan, msg, gps2_raw->time_usec, gps2_raw->fix_type, gps2_raw->lat, gps2_raw->lon, gps2_raw->alt, gps2_raw->eph, gps2_raw->epv, gps2_raw->vel, gps2_raw->cog, gps2_raw->satellites_visible, gps2_raw->dgps_numch, gps2_raw->dgps_age);
207 * @brief Send a gps2_raw message
208 * @param chan MAVLink channel to send the message
210 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
211 * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
212 * @param lat Latitude (WGS84), in degrees * 1E7
213 * @param lon Longitude (WGS84), in degrees * 1E7
214 * @param alt Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
215 * @param eph GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
216 * @param epv GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
217 * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
218 * @param cog Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
219 * @param satellites_visible Number of satellites visible. If unknown, set to 255
220 * @param dgps_numch Number of DGPS satellites
221 * @param dgps_age Age of DGPS info
223 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
225 static inline void mavlink_msg_gps2_raw_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
227 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
228 char buf[MAVLINK_MSG_ID_GPS2_RAW_LEN];
229 _mav_put_uint64_t(buf, 0, time_usec);
230 _mav_put_int32_t(buf, 8, lat);
231 _mav_put_int32_t(buf, 12, lon);
232 _mav_put_int32_t(buf, 16, alt);
233 _mav_put_uint32_t(buf, 20, dgps_age);
234 _mav_put_uint16_t(buf, 24, eph);
235 _mav_put_uint16_t(buf, 26, epv);
236 _mav_put_uint16_t(buf, 28, vel);
237 _mav_put_uint16_t(buf, 30, cog);
238 _mav_put_uint8_t(buf, 32, fix_type);
239 _mav_put_uint8_t(buf, 33, satellites_visible);
240 _mav_put_uint8_t(buf, 34, dgps_numch);
242 #if MAVLINK_CRC_EXTRA
243 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
244 #else
245 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
246 #endif
247 #else
248 mavlink_gps2_raw_t packet;
249 packet.time_usec = time_usec;
250 packet.lat = lat;
251 packet.lon = lon;
252 packet.alt = alt;
253 packet.dgps_age = dgps_age;
254 packet.eph = eph;
255 packet.epv = epv;
256 packet.vel = vel;
257 packet.cog = cog;
258 packet.fix_type = fix_type;
259 packet.satellites_visible = satellites_visible;
260 packet.dgps_numch = dgps_numch;
262 #if MAVLINK_CRC_EXTRA
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
264 #else
265 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)&packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
266 #endif
267 #endif
270 #if MAVLINK_MSG_ID_GPS2_RAW_LEN <= MAVLINK_MAX_PAYLOAD_LEN
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.
278 static inline void mavlink_msg_gps2_raw_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t fix_type, int32_t lat, int32_t lon, int32_t alt, uint16_t eph, uint16_t epv, uint16_t vel, uint16_t cog, uint8_t satellites_visible, uint8_t dgps_numch, uint32_t dgps_age)
280 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
281 char *buf = (char *)msgbuf;
282 _mav_put_uint64_t(buf, 0, time_usec);
283 _mav_put_int32_t(buf, 8, lat);
284 _mav_put_int32_t(buf, 12, lon);
285 _mav_put_int32_t(buf, 16, alt);
286 _mav_put_uint32_t(buf, 20, dgps_age);
287 _mav_put_uint16_t(buf, 24, eph);
288 _mav_put_uint16_t(buf, 26, epv);
289 _mav_put_uint16_t(buf, 28, vel);
290 _mav_put_uint16_t(buf, 30, cog);
291 _mav_put_uint8_t(buf, 32, fix_type);
292 _mav_put_uint8_t(buf, 33, satellites_visible);
293 _mav_put_uint8_t(buf, 34, dgps_numch);
295 #if MAVLINK_CRC_EXTRA
296 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
297 #else
298 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, buf, MAVLINK_MSG_ID_GPS2_RAW_LEN);
299 #endif
300 #else
301 mavlink_gps2_raw_t *packet = (mavlink_gps2_raw_t *)msgbuf;
302 packet->time_usec = time_usec;
303 packet->lat = lat;
304 packet->lon = lon;
305 packet->alt = alt;
306 packet->dgps_age = dgps_age;
307 packet->eph = eph;
308 packet->epv = epv;
309 packet->vel = vel;
310 packet->cog = cog;
311 packet->fix_type = fix_type;
312 packet->satellites_visible = satellites_visible;
313 packet->dgps_numch = dgps_numch;
315 #if MAVLINK_CRC_EXTRA
316 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_LEN, MAVLINK_MSG_ID_GPS2_RAW_CRC);
317 #else
318 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS2_RAW, (const char *)packet, MAVLINK_MSG_ID_GPS2_RAW_LEN);
319 #endif
320 #endif
322 #endif
324 #endif
326 // MESSAGE GPS2_RAW UNPACKING
330 * @brief Get field time_usec from gps2_raw message
332 * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
334 static inline uint64_t mavlink_msg_gps2_raw_get_time_usec(const mavlink_message_t* msg)
336 return _MAV_RETURN_uint64_t(msg, 0);
340 * @brief Get field fix_type from gps2_raw message
342 * @return 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: DGPS fix, 5: RTK Fix. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix.
344 static inline uint8_t mavlink_msg_gps2_raw_get_fix_type(const mavlink_message_t* msg)
346 return _MAV_RETURN_uint8_t(msg, 32);
350 * @brief Get field lat from gps2_raw message
352 * @return Latitude (WGS84), in degrees * 1E7
354 static inline int32_t mavlink_msg_gps2_raw_get_lat(const mavlink_message_t* msg)
356 return _MAV_RETURN_int32_t(msg, 8);
360 * @brief Get field lon from gps2_raw message
362 * @return Longitude (WGS84), in degrees * 1E7
364 static inline int32_t mavlink_msg_gps2_raw_get_lon(const mavlink_message_t* msg)
366 return _MAV_RETURN_int32_t(msg, 12);
370 * @brief Get field alt from gps2_raw message
372 * @return Altitude (AMSL, not WGS84), in meters * 1000 (positive for up)
374 static inline int32_t mavlink_msg_gps2_raw_get_alt(const mavlink_message_t* msg)
376 return _MAV_RETURN_int32_t(msg, 16);
380 * @brief Get field eph from gps2_raw message
382 * @return GPS HDOP horizontal dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
384 static inline uint16_t mavlink_msg_gps2_raw_get_eph(const mavlink_message_t* msg)
386 return _MAV_RETURN_uint16_t(msg, 24);
390 * @brief Get field epv from gps2_raw message
392 * @return GPS VDOP vertical dilution of position in cm (m*100). If unknown, set to: UINT16_MAX
394 static inline uint16_t mavlink_msg_gps2_raw_get_epv(const mavlink_message_t* msg)
396 return _MAV_RETURN_uint16_t(msg, 26);
400 * @brief Get field vel from gps2_raw message
402 * @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
404 static inline uint16_t mavlink_msg_gps2_raw_get_vel(const mavlink_message_t* msg)
406 return _MAV_RETURN_uint16_t(msg, 28);
410 * @brief Get field cog from gps2_raw message
412 * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
414 static inline uint16_t mavlink_msg_gps2_raw_get_cog(const mavlink_message_t* msg)
416 return _MAV_RETURN_uint16_t(msg, 30);
420 * @brief Get field satellites_visible from gps2_raw message
422 * @return Number of satellites visible. If unknown, set to 255
424 static inline uint8_t mavlink_msg_gps2_raw_get_satellites_visible(const mavlink_message_t* msg)
426 return _MAV_RETURN_uint8_t(msg, 33);
430 * @brief Get field dgps_numch from gps2_raw message
432 * @return Number of DGPS satellites
434 static inline uint8_t mavlink_msg_gps2_raw_get_dgps_numch(const mavlink_message_t* msg)
436 return _MAV_RETURN_uint8_t(msg, 34);
440 * @brief Get field dgps_age from gps2_raw message
442 * @return Age of DGPS info
444 static inline uint32_t mavlink_msg_gps2_raw_get_dgps_age(const mavlink_message_t* msg)
446 return _MAV_RETURN_uint32_t(msg, 20);
450 * @brief Decode a gps2_raw message into a struct
452 * @param msg The message to decode
453 * @param gps2_raw C-struct to decode the message contents into
455 static inline void mavlink_msg_gps2_raw_decode(const mavlink_message_t* msg, mavlink_gps2_raw_t* gps2_raw)
457 #if MAVLINK_NEED_BYTE_SWAP
458 gps2_raw->time_usec = mavlink_msg_gps2_raw_get_time_usec(msg);
459 gps2_raw->lat = mavlink_msg_gps2_raw_get_lat(msg);
460 gps2_raw->lon = mavlink_msg_gps2_raw_get_lon(msg);
461 gps2_raw->alt = mavlink_msg_gps2_raw_get_alt(msg);
462 gps2_raw->dgps_age = mavlink_msg_gps2_raw_get_dgps_age(msg);
463 gps2_raw->eph = mavlink_msg_gps2_raw_get_eph(msg);
464 gps2_raw->epv = mavlink_msg_gps2_raw_get_epv(msg);
465 gps2_raw->vel = mavlink_msg_gps2_raw_get_vel(msg);
466 gps2_raw->cog = mavlink_msg_gps2_raw_get_cog(msg);
467 gps2_raw->fix_type = mavlink_msg_gps2_raw_get_fix_type(msg);
468 gps2_raw->satellites_visible = mavlink_msg_gps2_raw_get_satellites_visible(msg);
469 gps2_raw->dgps_numch = mavlink_msg_gps2_raw_get_dgps_numch(msg);
470 #else
471 memcpy(gps2_raw, _MAV_PAYLOAD(msg), MAVLINK_MSG_ID_GPS2_RAW_LEN);
472 #endif