4#define MAVLINK_MSG_ID_HIL_GPS 113
7typedef struct __mavlink_hil_gps_t {
20 uint8_t satellites_visible;
23#define MAVLINK_MSG_ID_HIL_GPS_LEN 36
24#define MAVLINK_MSG_ID_HIL_GPS_MIN_LEN 36
25#define MAVLINK_MSG_ID_113_LEN 36
26#define MAVLINK_MSG_ID_113_MIN_LEN 36
28#define MAVLINK_MSG_ID_HIL_GPS_CRC 124
29#define MAVLINK_MSG_ID_113_CRC 124
33#if MAVLINK_COMMAND_24BIT
34#define MAVLINK_MESSAGE_INFO_HIL_GPS { \
38 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \
39 { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \
40 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \
41 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \
42 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \
43 { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_gps_t, eph) }, \
44 { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_gps_t, epv) }, \
45 { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_gps_t, vel) }, \
46 { "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_hil_gps_t, vn) }, \
47 { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \
48 { "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \
49 { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \
50 { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \
54#define MAVLINK_MESSAGE_INFO_HIL_GPS { \
57 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_hil_gps_t, time_usec) }, \
58 { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 34, offsetof(mavlink_hil_gps_t, fix_type) }, \
59 { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_hil_gps_t, lat) }, \
60 { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_hil_gps_t, lon) }, \
61 { "alt", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_hil_gps_t, alt) }, \
62 { "eph", NULL, MAVLINK_TYPE_UINT16_T, 0, 20, offsetof(mavlink_hil_gps_t, eph) }, \
63 { "epv", NULL, MAVLINK_TYPE_UINT16_T, 0, 22, offsetof(mavlink_hil_gps_t, epv) }, \
64 { "vel", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_hil_gps_t, vel) }, \
65 { "vn", NULL, MAVLINK_TYPE_INT16_T, 0, 26, offsetof(mavlink_hil_gps_t, vn) }, \
66 { "ve", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_hil_gps_t, ve) }, \
67 { "vd", NULL, MAVLINK_TYPE_INT16_T, 0, 30, offsetof(mavlink_hil_gps_t, vd) }, \
68 { "cog", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_hil_gps_t, cog) }, \
69 { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 35, offsetof(mavlink_hil_gps_t, satellites_visible) }, \
95static inline uint16_t mavlink_msg_hil_gps_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
96 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, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
98#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
99 char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
100 _mav_put_uint64_t(buf, 0, time_usec);
101 _mav_put_int32_t(buf, 8, lat);
102 _mav_put_int32_t(buf, 12, lon);
103 _mav_put_int32_t(buf, 16, alt);
104 _mav_put_uint16_t(buf, 20, eph);
105 _mav_put_uint16_t(buf, 22, epv);
106 _mav_put_uint16_t(buf, 24, vel);
107 _mav_put_int16_t(buf, 26, vn);
108 _mav_put_int16_t(buf, 28, ve);
109 _mav_put_int16_t(buf, 30, vd);
110 _mav_put_uint16_t(buf, 32, cog);
111 _mav_put_uint8_t(buf, 34, fix_type);
112 _mav_put_uint8_t(buf, 35, satellites_visible);
114 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN);
116 mavlink_hil_gps_t packet;
117 packet.time_usec = time_usec;
128 packet.fix_type = fix_type;
129 packet.satellites_visible = satellites_visible;
131 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN);
134 msg->msgid = MAVLINK_MSG_ID_HIL_GPS;
135 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
159static inline uint16_t mavlink_msg_hil_gps_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
160 mavlink_message_t* msg,
161 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,int16_t vn,int16_t ve,int16_t vd,uint16_t cog,uint8_t satellites_visible)
163#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
164 char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
165 _mav_put_uint64_t(buf, 0, time_usec);
166 _mav_put_int32_t(buf, 8, lat);
167 _mav_put_int32_t(buf, 12, lon);
168 _mav_put_int32_t(buf, 16, alt);
169 _mav_put_uint16_t(buf, 20, eph);
170 _mav_put_uint16_t(buf, 22, epv);
171 _mav_put_uint16_t(buf, 24, vel);
172 _mav_put_int16_t(buf, 26, vn);
173 _mav_put_int16_t(buf, 28, ve);
174 _mav_put_int16_t(buf, 30, vd);
175 _mav_put_uint16_t(buf, 32, cog);
176 _mav_put_uint8_t(buf, 34, fix_type);
177 _mav_put_uint8_t(buf, 35, satellites_visible);
179 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_HIL_GPS_LEN);
181 mavlink_hil_gps_t packet;
182 packet.time_usec = time_usec;
193 packet.fix_type = fix_type;
194 packet.satellites_visible = satellites_visible;
196 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_HIL_GPS_LEN);
199 msg->msgid = MAVLINK_MSG_ID_HIL_GPS;
200 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
211static inline uint16_t mavlink_msg_hil_gps_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_hil_gps_t* hil_gps)
213 return mavlink_msg_hil_gps_pack(system_id, component_id, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
225static inline uint16_t mavlink_msg_hil_gps_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_hil_gps_t* hil_gps)
227 return mavlink_msg_hil_gps_pack_chan(system_id, component_id, chan, msg, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
248#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
250static inline void mavlink_msg_hil_gps_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, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
252#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
253 char buf[MAVLINK_MSG_ID_HIL_GPS_LEN];
254 _mav_put_uint64_t(buf, 0, time_usec);
255 _mav_put_int32_t(buf, 8, lat);
256 _mav_put_int32_t(buf, 12, lon);
257 _mav_put_int32_t(buf, 16, alt);
258 _mav_put_uint16_t(buf, 20, eph);
259 _mav_put_uint16_t(buf, 22, epv);
260 _mav_put_uint16_t(buf, 24, vel);
261 _mav_put_int16_t(buf, 26, vn);
262 _mav_put_int16_t(buf, 28, ve);
263 _mav_put_int16_t(buf, 30, vd);
264 _mav_put_uint16_t(buf, 32, cog);
265 _mav_put_uint8_t(buf, 34, fix_type);
266 _mav_put_uint8_t(buf, 35, satellites_visible);
268 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
270 mavlink_hil_gps_t packet;
271 packet.time_usec = time_usec;
282 packet.fix_type = fix_type;
283 packet.satellites_visible = satellites_visible;
285 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (
const char *)&packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
294static inline void mavlink_msg_hil_gps_send_struct(mavlink_channel_t chan,
const mavlink_hil_gps_t* hil_gps)
296#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
297 mavlink_msg_hil_gps_send(chan, hil_gps->time_usec, hil_gps->fix_type, hil_gps->lat, hil_gps->lon, hil_gps->alt, hil_gps->eph, hil_gps->epv, hil_gps->vel, hil_gps->vn, hil_gps->ve, hil_gps->vd, hil_gps->cog, hil_gps->satellites_visible);
299 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (
const char *)hil_gps, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
303#if MAVLINK_MSG_ID_HIL_GPS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
311static inline void mavlink_msg_hil_gps_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, int16_t vn, int16_t ve, int16_t vd, uint16_t cog, uint8_t satellites_visible)
313#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
314 char *buf = (
char *)msgbuf;
315 _mav_put_uint64_t(buf, 0, time_usec);
316 _mav_put_int32_t(buf, 8, lat);
317 _mav_put_int32_t(buf, 12, lon);
318 _mav_put_int32_t(buf, 16, alt);
319 _mav_put_uint16_t(buf, 20, eph);
320 _mav_put_uint16_t(buf, 22, epv);
321 _mav_put_uint16_t(buf, 24, vel);
322 _mav_put_int16_t(buf, 26, vn);
323 _mav_put_int16_t(buf, 28, ve);
324 _mav_put_int16_t(buf, 30, vd);
325 _mav_put_uint16_t(buf, 32, cog);
326 _mav_put_uint8_t(buf, 34, fix_type);
327 _mav_put_uint8_t(buf, 35, satellites_visible);
329 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, buf, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
331 mavlink_hil_gps_t *packet = (mavlink_hil_gps_t *)msgbuf;
332 packet->time_usec = time_usec;
343 packet->fix_type = fix_type;
344 packet->satellites_visible = satellites_visible;
346 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_HIL_GPS, (
const char *)packet, MAVLINK_MSG_ID_HIL_GPS_MIN_LEN, MAVLINK_MSG_ID_HIL_GPS_LEN, MAVLINK_MSG_ID_HIL_GPS_CRC);
361static inline uint64_t mavlink_msg_hil_gps_get_time_usec(
const mavlink_message_t* msg)
363 return _MAV_RETURN_uint64_t(msg, 0);
371static inline uint8_t mavlink_msg_hil_gps_get_fix_type(
const mavlink_message_t* msg)
373 return _MAV_RETURN_uint8_t(msg, 34);
381static inline int32_t mavlink_msg_hil_gps_get_lat(
const mavlink_message_t* msg)
383 return _MAV_RETURN_int32_t(msg, 8);
391static inline int32_t mavlink_msg_hil_gps_get_lon(
const mavlink_message_t* msg)
393 return _MAV_RETURN_int32_t(msg, 12);
401static inline int32_t mavlink_msg_hil_gps_get_alt(
const mavlink_message_t* msg)
403 return _MAV_RETURN_int32_t(msg, 16);
411static inline uint16_t mavlink_msg_hil_gps_get_eph(
const mavlink_message_t* msg)
413 return _MAV_RETURN_uint16_t(msg, 20);
421static inline uint16_t mavlink_msg_hil_gps_get_epv(
const mavlink_message_t* msg)
423 return _MAV_RETURN_uint16_t(msg, 22);
431static inline uint16_t mavlink_msg_hil_gps_get_vel(
const mavlink_message_t* msg)
433 return _MAV_RETURN_uint16_t(msg, 24);
441static inline int16_t mavlink_msg_hil_gps_get_vn(
const mavlink_message_t* msg)
443 return _MAV_RETURN_int16_t(msg, 26);
451static inline int16_t mavlink_msg_hil_gps_get_ve(
const mavlink_message_t* msg)
453 return _MAV_RETURN_int16_t(msg, 28);
461static inline int16_t mavlink_msg_hil_gps_get_vd(
const mavlink_message_t* msg)
463 return _MAV_RETURN_int16_t(msg, 30);
471static inline uint16_t mavlink_msg_hil_gps_get_cog(
const mavlink_message_t* msg)
473 return _MAV_RETURN_uint16_t(msg, 32);
481static inline uint8_t mavlink_msg_hil_gps_get_satellites_visible(
const mavlink_message_t* msg)
483 return _MAV_RETURN_uint8_t(msg, 35);
492static inline void mavlink_msg_hil_gps_decode(
const mavlink_message_t* msg, mavlink_hil_gps_t* hil_gps)
494#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
495 hil_gps->time_usec = mavlink_msg_hil_gps_get_time_usec(msg);
496 hil_gps->lat = mavlink_msg_hil_gps_get_lat(msg);
497 hil_gps->lon = mavlink_msg_hil_gps_get_lon(msg);
498 hil_gps->alt = mavlink_msg_hil_gps_get_alt(msg);
499 hil_gps->eph = mavlink_msg_hil_gps_get_eph(msg);
500 hil_gps->epv = mavlink_msg_hil_gps_get_epv(msg);
501 hil_gps->vel = mavlink_msg_hil_gps_get_vel(msg);
502 hil_gps->vn = mavlink_msg_hil_gps_get_vn(msg);
503 hil_gps->ve = mavlink_msg_hil_gps_get_ve(msg);
504 hil_gps->vd = mavlink_msg_hil_gps_get_vd(msg);
505 hil_gps->cog = mavlink_msg_hil_gps_get_cog(msg);
506 hil_gps->fix_type = mavlink_msg_hil_gps_get_fix_type(msg);
507 hil_gps->satellites_visible = mavlink_msg_hil_gps_get_satellites_visible(msg);
509 uint8_t len = msg->len < MAVLINK_MSG_ID_HIL_GPS_LEN? msg->len : MAVLINK_MSG_ID_HIL_GPS_LEN;
510 memset(hil_gps, 0, MAVLINK_MSG_ID_HIL_GPS_LEN);
511 memcpy(hil_gps, _MAV_PAYLOAD(msg), len);