mavlink_msg_gps_input.h 35 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764
  1. #pragma once
  2. // MESSAGE GPS_INPUT PACKING
  3. #define MAVLINK_MSG_ID_GPS_INPUT 232
  4. MAVPACKED(
  5. typedef struct __mavlink_gps_input_t {
  6. uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
  7. uint32_t time_week_ms; /*< [ms] GPS time (from start of GPS week)*/
  8. int32_t lat; /*< [degE7] Latitude (WGS84)*/
  9. int32_t lon; /*< [degE7] Longitude (WGS84)*/
  10. float alt; /*< [m] Altitude (MSL). Positive for up.*/
  11. float hdop; /*< GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX*/
  12. float vdop; /*< GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX*/
  13. float vn; /*< [m/s] GPS velocity in north direction in earth-fixed NED frame*/
  14. float ve; /*< [m/s] GPS velocity in east direction in earth-fixed NED frame*/
  15. float vd; /*< [m/s] GPS velocity in down direction in earth-fixed NED frame*/
  16. float speed_accuracy; /*< [m/s] GPS speed accuracy*/
  17. float horiz_accuracy; /*< [m] GPS horizontal accuracy*/
  18. float vert_accuracy; /*< [m] GPS vertical accuracy*/
  19. uint16_t ignore_flags; /*< Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.*/
  20. uint16_t time_week; /*< GPS week number*/
  21. uint8_t gps_id; /*< ID of the GPS for multiple GPS inputs*/
  22. uint8_t fix_type; /*< 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK*/
  23. uint8_t satellites_visible; /*< Number of satellites visible.*/
  24. uint16_t yaw; /*< [cdeg] Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north*/
  25. }) mavlink_gps_input_t;
  26. #define MAVLINK_MSG_ID_GPS_INPUT_LEN 65
  27. #define MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN 63
  28. #define MAVLINK_MSG_ID_232_LEN 65
  29. #define MAVLINK_MSG_ID_232_MIN_LEN 63
  30. #define MAVLINK_MSG_ID_GPS_INPUT_CRC 151
  31. #define MAVLINK_MSG_ID_232_CRC 151
  32. #if MAVLINK_COMMAND_24BIT
  33. #define MAVLINK_MESSAGE_INFO_GPS_INPUT { \
  34. 232, \
  35. "GPS_INPUT", \
  36. 19, \
  37. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \
  38. { "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \
  39. { "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \
  40. { "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \
  41. { "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \
  42. { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \
  43. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \
  44. { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \
  45. { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \
  46. { "hdop", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gps_input_t, hdop) }, \
  47. { "vdop", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gps_input_t, vdop) }, \
  48. { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gps_input_t, vn) }, \
  49. { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gps_input_t, ve) }, \
  50. { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gps_input_t, vd) }, \
  51. { "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \
  52. { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \
  53. { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \
  54. { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \
  55. { "yaw", NULL, MAVLINK_TYPE_UINT16_T, 0, 63, offsetof(mavlink_gps_input_t, yaw) }, \
  56. } \
  57. }
  58. #else
  59. #define MAVLINK_MESSAGE_INFO_GPS_INPUT { \
  60. "GPS_INPUT", \
  61. 19, \
  62. { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_gps_input_t, time_usec) }, \
  63. { "gps_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 60, offsetof(mavlink_gps_input_t, gps_id) }, \
  64. { "ignore_flags", NULL, MAVLINK_TYPE_UINT16_T, 0, 56, offsetof(mavlink_gps_input_t, ignore_flags) }, \
  65. { "time_week_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_gps_input_t, time_week_ms) }, \
  66. { "time_week", NULL, MAVLINK_TYPE_UINT16_T, 0, 58, offsetof(mavlink_gps_input_t, time_week) }, \
  67. { "fix_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 61, offsetof(mavlink_gps_input_t, fix_type) }, \
  68. { "lat", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_gps_input_t, lat) }, \
  69. { "lon", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_gps_input_t, lon) }, \
  70. { "alt", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_gps_input_t, alt) }, \
  71. { "hdop", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_gps_input_t, hdop) }, \
  72. { "vdop", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_gps_input_t, vdop) }, \
  73. { "vn", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_gps_input_t, vn) }, \
  74. { "ve", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_gps_input_t, ve) }, \
  75. { "vd", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_gps_input_t, vd) }, \
  76. { "speed_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_gps_input_t, speed_accuracy) }, \
  77. { "horiz_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_gps_input_t, horiz_accuracy) }, \
  78. { "vert_accuracy", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_gps_input_t, vert_accuracy) }, \
  79. { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 62, offsetof(mavlink_gps_input_t, satellites_visible) }, \
  80. { "yaw", NULL, MAVLINK_TYPE_UINT16_T, 0, 63, offsetof(mavlink_gps_input_t, yaw) }, \
  81. } \
  82. }
  83. #endif
  84. /**
  85. * @brief Pack a gps_input message
  86. * @param system_id ID of this system
  87. * @param component_id ID of this component (e.g. 200 for IMU)
  88. * @param msg The MAVLink message to compress the data into
  89. *
  90. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  91. * @param gps_id ID of the GPS for multiple GPS inputs
  92. * @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
  93. * @param time_week_ms [ms] GPS time (from start of GPS week)
  94. * @param time_week GPS week number
  95. * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
  96. * @param lat [degE7] Latitude (WGS84)
  97. * @param lon [degE7] Longitude (WGS84)
  98. * @param alt [m] Altitude (MSL). Positive for up.
  99. * @param hdop GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
  100. * @param vdop GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
  101. * @param vn [m/s] GPS velocity in north direction in earth-fixed NED frame
  102. * @param ve [m/s] GPS velocity in east direction in earth-fixed NED frame
  103. * @param vd [m/s] GPS velocity in down direction in earth-fixed NED frame
  104. * @param speed_accuracy [m/s] GPS speed accuracy
  105. * @param horiz_accuracy [m] GPS horizontal accuracy
  106. * @param vert_accuracy [m] GPS vertical accuracy
  107. * @param satellites_visible Number of satellites visible.
  108. * @param yaw [cdeg] Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north
  109. * @return length of the message in bytes (excluding serial stream start sign)
  110. */
  111. static inline uint16_t mavlink_msg_gps_input_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  112. uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible, uint16_t yaw)
  113. {
  114. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  115. char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
  116. _mav_put_uint64_t(buf, 0, time_usec);
  117. _mav_put_uint32_t(buf, 8, time_week_ms);
  118. _mav_put_int32_t(buf, 12, lat);
  119. _mav_put_int32_t(buf, 16, lon);
  120. _mav_put_float(buf, 20, alt);
  121. _mav_put_float(buf, 24, hdop);
  122. _mav_put_float(buf, 28, vdop);
  123. _mav_put_float(buf, 32, vn);
  124. _mav_put_float(buf, 36, ve);
  125. _mav_put_float(buf, 40, vd);
  126. _mav_put_float(buf, 44, speed_accuracy);
  127. _mav_put_float(buf, 48, horiz_accuracy);
  128. _mav_put_float(buf, 52, vert_accuracy);
  129. _mav_put_uint16_t(buf, 56, ignore_flags);
  130. _mav_put_uint16_t(buf, 58, time_week);
  131. _mav_put_uint8_t(buf, 60, gps_id);
  132. _mav_put_uint8_t(buf, 61, fix_type);
  133. _mav_put_uint8_t(buf, 62, satellites_visible);
  134. _mav_put_uint16_t(buf, 63, yaw);
  135. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  136. #else
  137. mavlink_gps_input_t packet;
  138. packet.time_usec = time_usec;
  139. packet.time_week_ms = time_week_ms;
  140. packet.lat = lat;
  141. packet.lon = lon;
  142. packet.alt = alt;
  143. packet.hdop = hdop;
  144. packet.vdop = vdop;
  145. packet.vn = vn;
  146. packet.ve = ve;
  147. packet.vd = vd;
  148. packet.speed_accuracy = speed_accuracy;
  149. packet.horiz_accuracy = horiz_accuracy;
  150. packet.vert_accuracy = vert_accuracy;
  151. packet.ignore_flags = ignore_flags;
  152. packet.time_week = time_week;
  153. packet.gps_id = gps_id;
  154. packet.fix_type = fix_type;
  155. packet.satellites_visible = satellites_visible;
  156. packet.yaw = yaw;
  157. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  158. #endif
  159. msg->msgid = MAVLINK_MSG_ID_GPS_INPUT;
  160. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  161. }
  162. /**
  163. * @brief Pack a gps_input message
  164. * @param system_id ID of this system
  165. * @param component_id ID of this component (e.g. 200 for IMU)
  166. * @param status MAVLink status structure
  167. * @param msg The MAVLink message to compress the data into
  168. *
  169. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  170. * @param gps_id ID of the GPS for multiple GPS inputs
  171. * @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
  172. * @param time_week_ms [ms] GPS time (from start of GPS week)
  173. * @param time_week GPS week number
  174. * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
  175. * @param lat [degE7] Latitude (WGS84)
  176. * @param lon [degE7] Longitude (WGS84)
  177. * @param alt [m] Altitude (MSL). Positive for up.
  178. * @param hdop GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
  179. * @param vdop GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
  180. * @param vn [m/s] GPS velocity in north direction in earth-fixed NED frame
  181. * @param ve [m/s] GPS velocity in east direction in earth-fixed NED frame
  182. * @param vd [m/s] GPS velocity in down direction in earth-fixed NED frame
  183. * @param speed_accuracy [m/s] GPS speed accuracy
  184. * @param horiz_accuracy [m] GPS horizontal accuracy
  185. * @param vert_accuracy [m] GPS vertical accuracy
  186. * @param satellites_visible Number of satellites visible.
  187. * @param yaw [cdeg] Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north
  188. * @return length of the message in bytes (excluding serial stream start sign)
  189. */
  190. static inline uint16_t mavlink_msg_gps_input_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  191. uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible, uint16_t yaw)
  192. {
  193. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  194. char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
  195. _mav_put_uint64_t(buf, 0, time_usec);
  196. _mav_put_uint32_t(buf, 8, time_week_ms);
  197. _mav_put_int32_t(buf, 12, lat);
  198. _mav_put_int32_t(buf, 16, lon);
  199. _mav_put_float(buf, 20, alt);
  200. _mav_put_float(buf, 24, hdop);
  201. _mav_put_float(buf, 28, vdop);
  202. _mav_put_float(buf, 32, vn);
  203. _mav_put_float(buf, 36, ve);
  204. _mav_put_float(buf, 40, vd);
  205. _mav_put_float(buf, 44, speed_accuracy);
  206. _mav_put_float(buf, 48, horiz_accuracy);
  207. _mav_put_float(buf, 52, vert_accuracy);
  208. _mav_put_uint16_t(buf, 56, ignore_flags);
  209. _mav_put_uint16_t(buf, 58, time_week);
  210. _mav_put_uint8_t(buf, 60, gps_id);
  211. _mav_put_uint8_t(buf, 61, fix_type);
  212. _mav_put_uint8_t(buf, 62, satellites_visible);
  213. _mav_put_uint16_t(buf, 63, yaw);
  214. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  215. #else
  216. mavlink_gps_input_t packet;
  217. packet.time_usec = time_usec;
  218. packet.time_week_ms = time_week_ms;
  219. packet.lat = lat;
  220. packet.lon = lon;
  221. packet.alt = alt;
  222. packet.hdop = hdop;
  223. packet.vdop = vdop;
  224. packet.vn = vn;
  225. packet.ve = ve;
  226. packet.vd = vd;
  227. packet.speed_accuracy = speed_accuracy;
  228. packet.horiz_accuracy = horiz_accuracy;
  229. packet.vert_accuracy = vert_accuracy;
  230. packet.ignore_flags = ignore_flags;
  231. packet.time_week = time_week;
  232. packet.gps_id = gps_id;
  233. packet.fix_type = fix_type;
  234. packet.satellites_visible = satellites_visible;
  235. packet.yaw = yaw;
  236. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  237. #endif
  238. msg->msgid = MAVLINK_MSG_ID_GPS_INPUT;
  239. #if MAVLINK_CRC_EXTRA
  240. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  241. #else
  242. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  243. #endif
  244. }
  245. /**
  246. * @brief Pack a gps_input message on a channel
  247. * @param system_id ID of this system
  248. * @param component_id ID of this component (e.g. 200 for IMU)
  249. * @param chan The MAVLink channel this message will be sent over
  250. * @param msg The MAVLink message to compress the data into
  251. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  252. * @param gps_id ID of the GPS for multiple GPS inputs
  253. * @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
  254. * @param time_week_ms [ms] GPS time (from start of GPS week)
  255. * @param time_week GPS week number
  256. * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
  257. * @param lat [degE7] Latitude (WGS84)
  258. * @param lon [degE7] Longitude (WGS84)
  259. * @param alt [m] Altitude (MSL). Positive for up.
  260. * @param hdop GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
  261. * @param vdop GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
  262. * @param vn [m/s] GPS velocity in north direction in earth-fixed NED frame
  263. * @param ve [m/s] GPS velocity in east direction in earth-fixed NED frame
  264. * @param vd [m/s] GPS velocity in down direction in earth-fixed NED frame
  265. * @param speed_accuracy [m/s] GPS speed accuracy
  266. * @param horiz_accuracy [m] GPS horizontal accuracy
  267. * @param vert_accuracy [m] GPS vertical accuracy
  268. * @param satellites_visible Number of satellites visible.
  269. * @param yaw [cdeg] Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north
  270. * @return length of the message in bytes (excluding serial stream start sign)
  271. */
  272. static inline uint16_t mavlink_msg_gps_input_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  273. mavlink_message_t* msg,
  274. uint64_t time_usec,uint8_t gps_id,uint16_t ignore_flags,uint32_t time_week_ms,uint16_t time_week,uint8_t fix_type,int32_t lat,int32_t lon,float alt,float hdop,float vdop,float vn,float ve,float vd,float speed_accuracy,float horiz_accuracy,float vert_accuracy,uint8_t satellites_visible,uint16_t yaw)
  275. {
  276. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  277. char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
  278. _mav_put_uint64_t(buf, 0, time_usec);
  279. _mav_put_uint32_t(buf, 8, time_week_ms);
  280. _mav_put_int32_t(buf, 12, lat);
  281. _mav_put_int32_t(buf, 16, lon);
  282. _mav_put_float(buf, 20, alt);
  283. _mav_put_float(buf, 24, hdop);
  284. _mav_put_float(buf, 28, vdop);
  285. _mav_put_float(buf, 32, vn);
  286. _mav_put_float(buf, 36, ve);
  287. _mav_put_float(buf, 40, vd);
  288. _mav_put_float(buf, 44, speed_accuracy);
  289. _mav_put_float(buf, 48, horiz_accuracy);
  290. _mav_put_float(buf, 52, vert_accuracy);
  291. _mav_put_uint16_t(buf, 56, ignore_flags);
  292. _mav_put_uint16_t(buf, 58, time_week);
  293. _mav_put_uint8_t(buf, 60, gps_id);
  294. _mav_put_uint8_t(buf, 61, fix_type);
  295. _mav_put_uint8_t(buf, 62, satellites_visible);
  296. _mav_put_uint16_t(buf, 63, yaw);
  297. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  298. #else
  299. mavlink_gps_input_t packet;
  300. packet.time_usec = time_usec;
  301. packet.time_week_ms = time_week_ms;
  302. packet.lat = lat;
  303. packet.lon = lon;
  304. packet.alt = alt;
  305. packet.hdop = hdop;
  306. packet.vdop = vdop;
  307. packet.vn = vn;
  308. packet.ve = ve;
  309. packet.vd = vd;
  310. packet.speed_accuracy = speed_accuracy;
  311. packet.horiz_accuracy = horiz_accuracy;
  312. packet.vert_accuracy = vert_accuracy;
  313. packet.ignore_flags = ignore_flags;
  314. packet.time_week = time_week;
  315. packet.gps_id = gps_id;
  316. packet.fix_type = fix_type;
  317. packet.satellites_visible = satellites_visible;
  318. packet.yaw = yaw;
  319. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  320. #endif
  321. msg->msgid = MAVLINK_MSG_ID_GPS_INPUT;
  322. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  323. }
  324. /**
  325. * @brief Encode a gps_input struct
  326. *
  327. * @param system_id ID of this system
  328. * @param component_id ID of this component (e.g. 200 for IMU)
  329. * @param msg The MAVLink message to compress the data into
  330. * @param gps_input C-struct to read the message contents from
  331. */
  332. static inline uint16_t mavlink_msg_gps_input_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_input_t* gps_input)
  333. {
  334. return mavlink_msg_gps_input_pack(system_id, component_id, msg, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible, gps_input->yaw);
  335. }
  336. /**
  337. * @brief Encode a gps_input struct on a channel
  338. *
  339. * @param system_id ID of this system
  340. * @param component_id ID of this component (e.g. 200 for IMU)
  341. * @param chan The MAVLink channel this message will be sent over
  342. * @param msg The MAVLink message to compress the data into
  343. * @param gps_input C-struct to read the message contents from
  344. */
  345. static inline uint16_t mavlink_msg_gps_input_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_input_t* gps_input)
  346. {
  347. return mavlink_msg_gps_input_pack_chan(system_id, component_id, chan, msg, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible, gps_input->yaw);
  348. }
  349. /**
  350. * @brief Encode a gps_input struct with provided status structure
  351. *
  352. * @param system_id ID of this system
  353. * @param component_id ID of this component (e.g. 200 for IMU)
  354. * @param status MAVLink status structure
  355. * @param msg The MAVLink message to compress the data into
  356. * @param gps_input C-struct to read the message contents from
  357. */
  358. static inline uint16_t mavlink_msg_gps_input_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_gps_input_t* gps_input)
  359. {
  360. return mavlink_msg_gps_input_pack_status(system_id, component_id, _status, msg, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible, gps_input->yaw);
  361. }
  362. /**
  363. * @brief Send a gps_input message
  364. * @param chan MAVLink channel to send the message
  365. *
  366. * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  367. * @param gps_id ID of the GPS for multiple GPS inputs
  368. * @param ignore_flags Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
  369. * @param time_week_ms [ms] GPS time (from start of GPS week)
  370. * @param time_week GPS week number
  371. * @param fix_type 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
  372. * @param lat [degE7] Latitude (WGS84)
  373. * @param lon [degE7] Longitude (WGS84)
  374. * @param alt [m] Altitude (MSL). Positive for up.
  375. * @param hdop GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
  376. * @param vdop GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
  377. * @param vn [m/s] GPS velocity in north direction in earth-fixed NED frame
  378. * @param ve [m/s] GPS velocity in east direction in earth-fixed NED frame
  379. * @param vd [m/s] GPS velocity in down direction in earth-fixed NED frame
  380. * @param speed_accuracy [m/s] GPS speed accuracy
  381. * @param horiz_accuracy [m] GPS horizontal accuracy
  382. * @param vert_accuracy [m] GPS vertical accuracy
  383. * @param satellites_visible Number of satellites visible.
  384. * @param yaw [cdeg] Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north
  385. */
  386. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  387. static inline void mavlink_msg_gps_input_send(mavlink_channel_t chan, uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible, uint16_t yaw)
  388. {
  389. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  390. char buf[MAVLINK_MSG_ID_GPS_INPUT_LEN];
  391. _mav_put_uint64_t(buf, 0, time_usec);
  392. _mav_put_uint32_t(buf, 8, time_week_ms);
  393. _mav_put_int32_t(buf, 12, lat);
  394. _mav_put_int32_t(buf, 16, lon);
  395. _mav_put_float(buf, 20, alt);
  396. _mav_put_float(buf, 24, hdop);
  397. _mav_put_float(buf, 28, vdop);
  398. _mav_put_float(buf, 32, vn);
  399. _mav_put_float(buf, 36, ve);
  400. _mav_put_float(buf, 40, vd);
  401. _mav_put_float(buf, 44, speed_accuracy);
  402. _mav_put_float(buf, 48, horiz_accuracy);
  403. _mav_put_float(buf, 52, vert_accuracy);
  404. _mav_put_uint16_t(buf, 56, ignore_flags);
  405. _mav_put_uint16_t(buf, 58, time_week);
  406. _mav_put_uint8_t(buf, 60, gps_id);
  407. _mav_put_uint8_t(buf, 61, fix_type);
  408. _mav_put_uint8_t(buf, 62, satellites_visible);
  409. _mav_put_uint16_t(buf, 63, yaw);
  410. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, buf, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  411. #else
  412. mavlink_gps_input_t packet;
  413. packet.time_usec = time_usec;
  414. packet.time_week_ms = time_week_ms;
  415. packet.lat = lat;
  416. packet.lon = lon;
  417. packet.alt = alt;
  418. packet.hdop = hdop;
  419. packet.vdop = vdop;
  420. packet.vn = vn;
  421. packet.ve = ve;
  422. packet.vd = vd;
  423. packet.speed_accuracy = speed_accuracy;
  424. packet.horiz_accuracy = horiz_accuracy;
  425. packet.vert_accuracy = vert_accuracy;
  426. packet.ignore_flags = ignore_flags;
  427. packet.time_week = time_week;
  428. packet.gps_id = gps_id;
  429. packet.fix_type = fix_type;
  430. packet.satellites_visible = satellites_visible;
  431. packet.yaw = yaw;
  432. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)&packet, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  433. #endif
  434. }
  435. /**
  436. * @brief Send a gps_input message
  437. * @param chan MAVLink channel to send the message
  438. * @param struct The MAVLink struct to serialize
  439. */
  440. static inline void mavlink_msg_gps_input_send_struct(mavlink_channel_t chan, const mavlink_gps_input_t* gps_input)
  441. {
  442. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  443. mavlink_msg_gps_input_send(chan, gps_input->time_usec, gps_input->gps_id, gps_input->ignore_flags, gps_input->time_week_ms, gps_input->time_week, gps_input->fix_type, gps_input->lat, gps_input->lon, gps_input->alt, gps_input->hdop, gps_input->vdop, gps_input->vn, gps_input->ve, gps_input->vd, gps_input->speed_accuracy, gps_input->horiz_accuracy, gps_input->vert_accuracy, gps_input->satellites_visible, gps_input->yaw);
  444. #else
  445. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)gps_input, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  446. #endif
  447. }
  448. #if MAVLINK_MSG_ID_GPS_INPUT_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  449. /*
  450. This variant of _send() can be used to save stack space by re-using
  451. memory from the receive buffer. The caller provides a
  452. mavlink_message_t which is the size of a full mavlink message. This
  453. is usually the receive buffer for the channel, and allows a reply to an
  454. incoming message with minimum stack space usage.
  455. */
  456. static inline void mavlink_msg_gps_input_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint8_t gps_id, uint16_t ignore_flags, uint32_t time_week_ms, uint16_t time_week, uint8_t fix_type, int32_t lat, int32_t lon, float alt, float hdop, float vdop, float vn, float ve, float vd, float speed_accuracy, float horiz_accuracy, float vert_accuracy, uint8_t satellites_visible, uint16_t yaw)
  457. {
  458. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  459. char *buf = (char *)msgbuf;
  460. _mav_put_uint64_t(buf, 0, time_usec);
  461. _mav_put_uint32_t(buf, 8, time_week_ms);
  462. _mav_put_int32_t(buf, 12, lat);
  463. _mav_put_int32_t(buf, 16, lon);
  464. _mav_put_float(buf, 20, alt);
  465. _mav_put_float(buf, 24, hdop);
  466. _mav_put_float(buf, 28, vdop);
  467. _mav_put_float(buf, 32, vn);
  468. _mav_put_float(buf, 36, ve);
  469. _mav_put_float(buf, 40, vd);
  470. _mav_put_float(buf, 44, speed_accuracy);
  471. _mav_put_float(buf, 48, horiz_accuracy);
  472. _mav_put_float(buf, 52, vert_accuracy);
  473. _mav_put_uint16_t(buf, 56, ignore_flags);
  474. _mav_put_uint16_t(buf, 58, time_week);
  475. _mav_put_uint8_t(buf, 60, gps_id);
  476. _mav_put_uint8_t(buf, 61, fix_type);
  477. _mav_put_uint8_t(buf, 62, satellites_visible);
  478. _mav_put_uint16_t(buf, 63, yaw);
  479. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, buf, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  480. #else
  481. mavlink_gps_input_t *packet = (mavlink_gps_input_t *)msgbuf;
  482. packet->time_usec = time_usec;
  483. packet->time_week_ms = time_week_ms;
  484. packet->lat = lat;
  485. packet->lon = lon;
  486. packet->alt = alt;
  487. packet->hdop = hdop;
  488. packet->vdop = vdop;
  489. packet->vn = vn;
  490. packet->ve = ve;
  491. packet->vd = vd;
  492. packet->speed_accuracy = speed_accuracy;
  493. packet->horiz_accuracy = horiz_accuracy;
  494. packet->vert_accuracy = vert_accuracy;
  495. packet->ignore_flags = ignore_flags;
  496. packet->time_week = time_week;
  497. packet->gps_id = gps_id;
  498. packet->fix_type = fix_type;
  499. packet->satellites_visible = satellites_visible;
  500. packet->yaw = yaw;
  501. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_INPUT, (const char *)packet, MAVLINK_MSG_ID_GPS_INPUT_MIN_LEN, MAVLINK_MSG_ID_GPS_INPUT_LEN, MAVLINK_MSG_ID_GPS_INPUT_CRC);
  502. #endif
  503. }
  504. #endif
  505. #endif
  506. // MESSAGE GPS_INPUT UNPACKING
  507. /**
  508. * @brief Get field time_usec from gps_input message
  509. *
  510. * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
  511. */
  512. static inline uint64_t mavlink_msg_gps_input_get_time_usec(const mavlink_message_t* msg)
  513. {
  514. return _MAV_RETURN_uint64_t(msg, 0);
  515. }
  516. /**
  517. * @brief Get field gps_id from gps_input message
  518. *
  519. * @return ID of the GPS for multiple GPS inputs
  520. */
  521. static inline uint8_t mavlink_msg_gps_input_get_gps_id(const mavlink_message_t* msg)
  522. {
  523. return _MAV_RETURN_uint8_t(msg, 60);
  524. }
  525. /**
  526. * @brief Get field ignore_flags from gps_input message
  527. *
  528. * @return Bitmap indicating which GPS input flags fields to ignore. All other fields must be provided.
  529. */
  530. static inline uint16_t mavlink_msg_gps_input_get_ignore_flags(const mavlink_message_t* msg)
  531. {
  532. return _MAV_RETURN_uint16_t(msg, 56);
  533. }
  534. /**
  535. * @brief Get field time_week_ms from gps_input message
  536. *
  537. * @return [ms] GPS time (from start of GPS week)
  538. */
  539. static inline uint32_t mavlink_msg_gps_input_get_time_week_ms(const mavlink_message_t* msg)
  540. {
  541. return _MAV_RETURN_uint32_t(msg, 8);
  542. }
  543. /**
  544. * @brief Get field time_week from gps_input message
  545. *
  546. * @return GPS week number
  547. */
  548. static inline uint16_t mavlink_msg_gps_input_get_time_week(const mavlink_message_t* msg)
  549. {
  550. return _MAV_RETURN_uint16_t(msg, 58);
  551. }
  552. /**
  553. * @brief Get field fix_type from gps_input message
  554. *
  555. * @return 0-1: no fix, 2: 2D fix, 3: 3D fix. 4: 3D with DGPS. 5: 3D with RTK
  556. */
  557. static inline uint8_t mavlink_msg_gps_input_get_fix_type(const mavlink_message_t* msg)
  558. {
  559. return _MAV_RETURN_uint8_t(msg, 61);
  560. }
  561. /**
  562. * @brief Get field lat from gps_input message
  563. *
  564. * @return [degE7] Latitude (WGS84)
  565. */
  566. static inline int32_t mavlink_msg_gps_input_get_lat(const mavlink_message_t* msg)
  567. {
  568. return _MAV_RETURN_int32_t(msg, 12);
  569. }
  570. /**
  571. * @brief Get field lon from gps_input message
  572. *
  573. * @return [degE7] Longitude (WGS84)
  574. */
  575. static inline int32_t mavlink_msg_gps_input_get_lon(const mavlink_message_t* msg)
  576. {
  577. return _MAV_RETURN_int32_t(msg, 16);
  578. }
  579. /**
  580. * @brief Get field alt from gps_input message
  581. *
  582. * @return [m] Altitude (MSL). Positive for up.
  583. */
  584. static inline float mavlink_msg_gps_input_get_alt(const mavlink_message_t* msg)
  585. {
  586. return _MAV_RETURN_float(msg, 20);
  587. }
  588. /**
  589. * @brief Get field hdop from gps_input message
  590. *
  591. * @return GPS HDOP horizontal dilution of position (unitless). If unknown, set to: UINT16_MAX
  592. */
  593. static inline float mavlink_msg_gps_input_get_hdop(const mavlink_message_t* msg)
  594. {
  595. return _MAV_RETURN_float(msg, 24);
  596. }
  597. /**
  598. * @brief Get field vdop from gps_input message
  599. *
  600. * @return GPS VDOP vertical dilution of position (unitless). If unknown, set to: UINT16_MAX
  601. */
  602. static inline float mavlink_msg_gps_input_get_vdop(const mavlink_message_t* msg)
  603. {
  604. return _MAV_RETURN_float(msg, 28);
  605. }
  606. /**
  607. * @brief Get field vn from gps_input message
  608. *
  609. * @return [m/s] GPS velocity in north direction in earth-fixed NED frame
  610. */
  611. static inline float mavlink_msg_gps_input_get_vn(const mavlink_message_t* msg)
  612. {
  613. return _MAV_RETURN_float(msg, 32);
  614. }
  615. /**
  616. * @brief Get field ve from gps_input message
  617. *
  618. * @return [m/s] GPS velocity in east direction in earth-fixed NED frame
  619. */
  620. static inline float mavlink_msg_gps_input_get_ve(const mavlink_message_t* msg)
  621. {
  622. return _MAV_RETURN_float(msg, 36);
  623. }
  624. /**
  625. * @brief Get field vd from gps_input message
  626. *
  627. * @return [m/s] GPS velocity in down direction in earth-fixed NED frame
  628. */
  629. static inline float mavlink_msg_gps_input_get_vd(const mavlink_message_t* msg)
  630. {
  631. return _MAV_RETURN_float(msg, 40);
  632. }
  633. /**
  634. * @brief Get field speed_accuracy from gps_input message
  635. *
  636. * @return [m/s] GPS speed accuracy
  637. */
  638. static inline float mavlink_msg_gps_input_get_speed_accuracy(const mavlink_message_t* msg)
  639. {
  640. return _MAV_RETURN_float(msg, 44);
  641. }
  642. /**
  643. * @brief Get field horiz_accuracy from gps_input message
  644. *
  645. * @return [m] GPS horizontal accuracy
  646. */
  647. static inline float mavlink_msg_gps_input_get_horiz_accuracy(const mavlink_message_t* msg)
  648. {
  649. return _MAV_RETURN_float(msg, 48);
  650. }
  651. /**
  652. * @brief Get field vert_accuracy from gps_input message
  653. *
  654. * @return [m] GPS vertical accuracy
  655. */
  656. static inline float mavlink_msg_gps_input_get_vert_accuracy(const mavlink_message_t* msg)
  657. {
  658. return _MAV_RETURN_float(msg, 52);
  659. }
  660. /**
  661. * @brief Get field satellites_visible from gps_input message
  662. *
  663. * @return Number of satellites visible.
  664. */
  665. static inline uint8_t mavlink_msg_gps_input_get_satellites_visible(const mavlink_message_t* msg)
  666. {
  667. return _MAV_RETURN_uint8_t(msg, 62);
  668. }
  669. /**
  670. * @brief Get field yaw from gps_input message
  671. *
  672. * @return [cdeg] Yaw of vehicle relative to Earth's North, zero means not available, use 36000 for north
  673. */
  674. static inline uint16_t mavlink_msg_gps_input_get_yaw(const mavlink_message_t* msg)
  675. {
  676. return _MAV_RETURN_uint16_t(msg, 63);
  677. }
  678. /**
  679. * @brief Decode a gps_input message into a struct
  680. *
  681. * @param msg The message to decode
  682. * @param gps_input C-struct to decode the message contents into
  683. */
  684. static inline void mavlink_msg_gps_input_decode(const mavlink_message_t* msg, mavlink_gps_input_t* gps_input)
  685. {
  686. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  687. gps_input->time_usec = mavlink_msg_gps_input_get_time_usec(msg);
  688. gps_input->time_week_ms = mavlink_msg_gps_input_get_time_week_ms(msg);
  689. gps_input->lat = mavlink_msg_gps_input_get_lat(msg);
  690. gps_input->lon = mavlink_msg_gps_input_get_lon(msg);
  691. gps_input->alt = mavlink_msg_gps_input_get_alt(msg);
  692. gps_input->hdop = mavlink_msg_gps_input_get_hdop(msg);
  693. gps_input->vdop = mavlink_msg_gps_input_get_vdop(msg);
  694. gps_input->vn = mavlink_msg_gps_input_get_vn(msg);
  695. gps_input->ve = mavlink_msg_gps_input_get_ve(msg);
  696. gps_input->vd = mavlink_msg_gps_input_get_vd(msg);
  697. gps_input->speed_accuracy = mavlink_msg_gps_input_get_speed_accuracy(msg);
  698. gps_input->horiz_accuracy = mavlink_msg_gps_input_get_horiz_accuracy(msg);
  699. gps_input->vert_accuracy = mavlink_msg_gps_input_get_vert_accuracy(msg);
  700. gps_input->ignore_flags = mavlink_msg_gps_input_get_ignore_flags(msg);
  701. gps_input->time_week = mavlink_msg_gps_input_get_time_week(msg);
  702. gps_input->gps_id = mavlink_msg_gps_input_get_gps_id(msg);
  703. gps_input->fix_type = mavlink_msg_gps_input_get_fix_type(msg);
  704. gps_input->satellites_visible = mavlink_msg_gps_input_get_satellites_visible(msg);
  705. gps_input->yaw = mavlink_msg_gps_input_get_yaw(msg);
  706. #else
  707. uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_INPUT_LEN? msg->len : MAVLINK_MSG_ID_GPS_INPUT_LEN;
  708. memset(gps_input, 0, MAVLINK_MSG_ID_GPS_INPUT_LEN);
  709. memcpy(gps_input, _MAV_PAYLOAD(msg), len);
  710. #endif
  711. }