[GYRO] Refactor gyro driver for dual-gyro support
[inav.git] / lib / main / MAVLink / common / mavlink_msg_gps_raw_int.h
blob3033b6d5fcd715309d3928eb20e04481d57247f8
1 #pragma once
2 // MESSAGE GPS_RAW_INT PACKING
4 #define MAVLINK_MSG_ID_GPS_RAW_INT 24
6 MAVPACKED(
7 typedef struct __mavlink_gps_raw_int_t {
8 uint64_t time_usec; /*< Timestamp (microseconds since UNIX epoch or microseconds since system boot)*/
9 int32_t lat; /*< Latitude (WGS84), in degrees * 1E7*/
10 int32_t lon; /*< Longitude (WGS84), in degrees * 1E7*/
11 int32_t alt; /*< Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.*/
12 uint16_t eph; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/
13 uint16_t epv; /*< GPS VDOP vertical dilution of position (unitless). 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; /*< See the GPS_FIX_TYPE enum.*/
17 uint8_t satellites_visible; /*< Number of satellites visible. If unknown, set to 255*/
18 }) mavlink_gps_raw_int_t;
20 #define MAVLINK_MSG_ID_GPS_RAW_INT_LEN 30
21 #define MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN 30
22 #define MAVLINK_MSG_ID_24_LEN 30
23 #define MAVLINK_MSG_ID_24_MIN_LEN 30
25 #define MAVLINK_MSG_ID_GPS_RAW_INT_CRC 24
26 #define MAVLINK_MSG_ID_24_CRC 24
30 #if MAVLINK_COMMAND_24BIT
31 #define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
32 24, \
33 "GPS_RAW_INT", \
34 10, \
35 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
36 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
37 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
38 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
39 { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
40 { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
41 { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
42 { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
43 { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
44 { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
45 } \
47 #else
48 #define MAVLINK_MESSAGE_INFO_GPS_RAW_INT { \
49 "GPS_RAW_INT", \
50 10, \
51 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_raw_int_t, time_usec) }, \
52 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_gps_raw_int_t, lat) }, \
53 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_raw_int_t, lon) }, \
54 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_raw_int_t, alt) }, \
55 { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_gps_raw_int_t, eph) }, \
56 { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_gps_raw_int_t, epv) }, \
57 { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_gps_raw_int_t, vel) }, \
58 { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_gps_raw_int_t, cog) }, \
59 { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_gps_raw_int_t, fix_type) }, \
60 { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_gps_raw_int_t, satellites_visible) }, \
61 } \
63 #endif
65 /**
66 * @brief Pack a gps_raw_int message
67 * @param system_id ID of this system
68 * @param component_id ID of this component (e.g. 200 for IMU)
69 * @param msg The MAVLink message to compress the data into
71 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
72 * @param fix_type See the GPS_FIX_TYPE enum.
73 * @param lat Latitude (WGS84), in degrees * 1E7
74 * @param lon Longitude (WGS84), in degrees * 1E7
75 * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
76 * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
77 * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
78 * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
79 * @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
80 * @param satellites_visible Number of satellites visible. If unknown, set to 255
81 * @return length of the message in bytes (excluding serial stream start sign)
83 static inline uint16_t mavlink_msg_gps_raw_int_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
84 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)
86 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
87 char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
88 _mav_put_uint64_t(buf, 0, time_usec);
89 _mav_put_int32_t(buf, 8, lat);
90 _mav_put_int32_t(buf, 12, lon);
91 _mav_put_int32_t(buf, 16, alt);
92 _mav_put_uint16_t(buf, 20, eph);
93 _mav_put_uint16_t(buf, 22, epv);
94 _mav_put_uint16_t(buf, 24, vel);
95 _mav_put_uint16_t(buf, 26, cog);
96 _mav_put_uint8_t(buf, 28, fix_type);
97 _mav_put_uint8_t(buf, 29, satellites_visible);
99 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
100 #else
101 mavlink_gps_raw_int_t packet;
102 packet.time_usec = time_usec;
103 packet.lat = lat;
104 packet.lon = lon;
105 packet.alt = alt;
106 packet.eph = eph;
107 packet.epv = epv;
108 packet.vel = vel;
109 packet.cog = cog;
110 packet.fix_type = fix_type;
111 packet.satellites_visible = satellites_visible;
113 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
114 #endif
116 msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
117 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
121 * @brief Pack a gps_raw_int message on a channel
122 * @param system_id ID of this system
123 * @param component_id ID of this component (e.g. 200 for IMU)
124 * @param chan The MAVLink channel this message will be sent over
125 * @param msg The MAVLink message to compress the data into
126 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
127 * @param fix_type See the GPS_FIX_TYPE enum.
128 * @param lat Latitude (WGS84), in degrees * 1E7
129 * @param lon Longitude (WGS84), in degrees * 1E7
130 * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
131 * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
132 * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
133 * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
134 * @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
135 * @param satellites_visible Number of satellites visible. If unknown, set to 255
136 * @return length of the message in bytes (excluding serial stream start sign)
138 static inline uint16_t mavlink_msg_gps_raw_int_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
139 mavlink_message_t* msg,
140 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)
142 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
143 char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
144 _mav_put_uint64_t(buf, 0, time_usec);
145 _mav_put_int32_t(buf, 8, lat);
146 _mav_put_int32_t(buf, 12, lon);
147 _mav_put_int32_t(buf, 16, alt);
148 _mav_put_uint16_t(buf, 20, eph);
149 _mav_put_uint16_t(buf, 22, epv);
150 _mav_put_uint16_t(buf, 24, vel);
151 _mav_put_uint16_t(buf, 26, cog);
152 _mav_put_uint8_t(buf, 28, fix_type);
153 _mav_put_uint8_t(buf, 29, satellites_visible);
155 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
156 #else
157 mavlink_gps_raw_int_t packet;
158 packet.time_usec = time_usec;
159 packet.lat = lat;
160 packet.lon = lon;
161 packet.alt = alt;
162 packet.eph = eph;
163 packet.epv = epv;
164 packet.vel = vel;
165 packet.cog = cog;
166 packet.fix_type = fix_type;
167 packet.satellites_visible = satellites_visible;
169 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
170 #endif
172 msg->msgid = MAVLINK_MSG_ID_GPS_RAW_INT;
173 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
177 * @brief Encode a gps_raw_int struct
179 * @param system_id ID of this system
180 * @param component_id ID of this component (e.g. 200 for IMU)
181 * @param msg The MAVLink message to compress the data into
182 * @param gps_raw_int C-struct to read the message contents from
184 static inline uint16_t mavlink_msg_gps_raw_int_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
186 return mavlink_msg_gps_raw_int_pack(system_id, component_id, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
190 * @brief Encode a gps_raw_int struct on a channel
192 * @param system_id ID of this system
193 * @param component_id ID of this component (e.g. 200 for IMU)
194 * @param chan The MAVLink channel this message will be sent over
195 * @param msg The MAVLink message to compress the data into
196 * @param gps_raw_int C-struct to read the message contents from
198 static inline uint16_t mavlink_msg_gps_raw_int_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_raw_int_t* gps_raw_int)
200 return mavlink_msg_gps_raw_int_pack_chan(system_id, component_id, chan, msg, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
204 * @brief Send a gps_raw_int message
205 * @param chan MAVLink channel to send the message
207 * @param time_usec Timestamp (microseconds since UNIX epoch or microseconds since system boot)
208 * @param fix_type See the GPS_FIX_TYPE enum.
209 * @param lat Latitude (WGS84), in degrees * 1E7
210 * @param lon Longitude (WGS84), in degrees * 1E7
211 * @param alt Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
212 * @param eph GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
213 * @param epv GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
214 * @param vel GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
215 * @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
216 * @param satellites_visible Number of satellites visible. If unknown, set to 255
218 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
220 static inline void mavlink_msg_gps_raw_int_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)
222 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
223 char buf[MAVLINK_MSG_ID_GPS_RAW_INT_LEN];
224 _mav_put_uint64_t(buf, 0, time_usec);
225 _mav_put_int32_t(buf, 8, lat);
226 _mav_put_int32_t(buf, 12, lon);
227 _mav_put_int32_t(buf, 16, alt);
228 _mav_put_uint16_t(buf, 20, eph);
229 _mav_put_uint16_t(buf, 22, epv);
230 _mav_put_uint16_t(buf, 24, vel);
231 _mav_put_uint16_t(buf, 26, cog);
232 _mav_put_uint8_t(buf, 28, fix_type);
233 _mav_put_uint8_t(buf, 29, satellites_visible);
235 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
236 #else
237 mavlink_gps_raw_int_t packet;
238 packet.time_usec = time_usec;
239 packet.lat = lat;
240 packet.lon = lon;
241 packet.alt = alt;
242 packet.eph = eph;
243 packet.epv = epv;
244 packet.vel = vel;
245 packet.cog = cog;
246 packet.fix_type = fix_type;
247 packet.satellites_visible = satellites_visible;
249 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)&packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
250 #endif
254 * @brief Send a gps_raw_int message
255 * @param chan MAVLink channel to send the message
256 * @param struct The MAVLink struct to serialize
258 static inline void mavlink_msg_gps_raw_int_send_struct(mavlink_channel_t chan, const mavlink_gps_raw_int_t* gps_raw_int)
260 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
261 mavlink_msg_gps_raw_int_send(chan, gps_raw_int->time_usec, gps_raw_int->fix_type, gps_raw_int->lat, gps_raw_int->lon, gps_raw_int->alt, gps_raw_int->eph, gps_raw_int->epv, gps_raw_int->vel, gps_raw_int->cog, gps_raw_int->satellites_visible);
262 #else
263 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)gps_raw_int, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
264 #endif
267 #if MAVLINK_MSG_ID_GPS_RAW_INT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
269 This varient of _send() can be used to save stack space by re-using
270 memory from the receive buffer. The caller provides a
271 mavlink_message_t which is the size of a full mavlink message. This
272 is usually the receive buffer for the channel, and allows a reply to an
273 incoming message with minimum stack space usage.
275 static inline void mavlink_msg_gps_raw_int_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)
277 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
278 char *buf = (char *)msgbuf;
279 _mav_put_uint64_t(buf, 0, time_usec);
280 _mav_put_int32_t(buf, 8, lat);
281 _mav_put_int32_t(buf, 12, lon);
282 _mav_put_int32_t(buf, 16, alt);
283 _mav_put_uint16_t(buf, 20, eph);
284 _mav_put_uint16_t(buf, 22, epv);
285 _mav_put_uint16_t(buf, 24, vel);
286 _mav_put_uint16_t(buf, 26, cog);
287 _mav_put_uint8_t(buf, 28, fix_type);
288 _mav_put_uint8_t(buf, 29, satellites_visible);
290 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, buf, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
291 #else
292 mavlink_gps_raw_int_t *packet = (mavlink_gps_raw_int_t *)msgbuf;
293 packet->time_usec = time_usec;
294 packet->lat = lat;
295 packet->lon = lon;
296 packet->alt = alt;
297 packet->eph = eph;
298 packet->epv = epv;
299 packet->vel = vel;
300 packet->cog = cog;
301 packet->fix_type = fix_type;
302 packet->satellites_visible = satellites_visible;
304 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_RAW_INT, (const char *)packet, MAVLINK_MSG_ID_GPS_RAW_INT_MIN_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_LEN, MAVLINK_MSG_ID_GPS_RAW_INT_CRC);
305 #endif
307 #endif
309 #endif
311 // MESSAGE GPS_RAW_INT UNPACKING
315 * @brief Get field time_usec from gps_raw_int message
317 * @return Timestamp (microseconds since UNIX epoch or microseconds since system boot)
319 static inline uint64_t mavlink_msg_gps_raw_int_get_time_usec(const mavlink_message_t* msg)
321 return _MAV_RETURN_uint64_t(msg, 0);
325 * @brief Get field fix_type from gps_raw_int message
327 * @return See the GPS_FIX_TYPE enum.
329 static inline uint8_t mavlink_msg_gps_raw_int_get_fix_type(const mavlink_message_t* msg)
331 return _MAV_RETURN_uint8_t(msg, 28);
335 * @brief Get field lat from gps_raw_int message
337 * @return Latitude (WGS84), in degrees * 1E7
339 static inline int32_t mavlink_msg_gps_raw_int_get_lat(const mavlink_message_t* msg)
341 return _MAV_RETURN_int32_t(msg, 8);
345 * @brief Get field lon from gps_raw_int message
347 * @return Longitude (WGS84), in degrees * 1E7
349 static inline int32_t mavlink_msg_gps_raw_int_get_lon(const mavlink_message_t* msg)
351 return _MAV_RETURN_int32_t(msg, 12);
355 * @brief Get field alt from gps_raw_int message
357 * @return Altitude (AMSL, NOT WGS84), in meters * 1000 (positive for up). Note that virtually all GPS modules provide the AMSL altitude in addition to the WGS84 altitude.
359 static inline int32_t mavlink_msg_gps_raw_int_get_alt(const mavlink_message_t* msg)
361 return _MAV_RETURN_int32_t(msg, 16);
365 * @brief Get field eph from gps_raw_int message
367 * @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
369 static inline uint16_t mavlink_msg_gps_raw_int_get_eph(const mavlink_message_t* msg)
371 return _MAV_RETURN_uint16_t(msg, 20);
375 * @brief Get field epv from gps_raw_int message
377 * @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
379 static inline uint16_t mavlink_msg_gps_raw_int_get_epv(const mavlink_message_t* msg)
381 return _MAV_RETURN_uint16_t(msg, 22);
385 * @brief Get field vel from gps_raw_int message
387 * @return GPS ground speed (m/s * 100). If unknown, set to: UINT16_MAX
389 static inline uint16_t mavlink_msg_gps_raw_int_get_vel(const mavlink_message_t* msg)
391 return _MAV_RETURN_uint16_t(msg, 24);
395 * @brief Get field cog from gps_raw_int message
397 * @return Course over ground (NOT heading, but direction of movement) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX
399 static inline uint16_t mavlink_msg_gps_raw_int_get_cog(const mavlink_message_t* msg)
401 return _MAV_RETURN_uint16_t(msg, 26);
405 * @brief Get field satellites_visible from gps_raw_int message
407 * @return Number of satellites visible. If unknown, set to 255
409 static inline uint8_t mavlink_msg_gps_raw_int_get_satellites_visible(const mavlink_message_t* msg)
411 return _MAV_RETURN_uint8_t(msg, 29);
415 * @brief Decode a gps_raw_int message into a struct
417 * @param msg The message to decode
418 * @param gps_raw_int C-struct to decode the message contents into
420 static inline void mavlink_msg_gps_raw_int_decode(const mavlink_message_t* msg, mavlink_gps_raw_int_t* gps_raw_int)
422 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
423 gps_raw_int->time_usec = mavlink_msg_gps_raw_int_get_time_usec(msg);
424 gps_raw_int->lat = mavlink_msg_gps_raw_int_get_lat(msg);
425 gps_raw_int->lon = mavlink_msg_gps_raw_int_get_lon(msg);
426 gps_raw_int->alt = mavlink_msg_gps_raw_int_get_alt(msg);
427 gps_raw_int->eph = mavlink_msg_gps_raw_int_get_eph(msg);
428 gps_raw_int->epv = mavlink_msg_gps_raw_int_get_epv(msg);
429 gps_raw_int->vel = mavlink_msg_gps_raw_int_get_vel(msg);
430 gps_raw_int->cog = mavlink_msg_gps_raw_int_get_cog(msg);
431 gps_raw_int->fix_type = mavlink_msg_gps_raw_int_get_fix_type(msg);
432 gps_raw_int->satellites_visible = mavlink_msg_gps_raw_int_get_satellites_visible(msg);
433 #else
434 uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_RAW_INT_LEN? msg->len : MAVLINK_MSG_ID_GPS_RAW_INT_LEN;
435 memset(gps_raw_int, 0, MAVLINK_MSG_ID_GPS_RAW_INT_LEN);
436 memcpy(gps_raw_int, _MAV_PAYLOAD(msg), len);
437 #endif