You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

334 lines
17 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #pragma once
  2. // MESSAGE GPS_STATUS PACKING
  3. #define MAVLINK_MSG_ID_GPS_STATUS 25
  4. MAVPACKED(
  5. typedef struct __mavlink_gps_status_t {
  6. uint8_t satellites_visible; /*< Number of satellites visible*/
  7. uint8_t satellite_prn[20]; /*< Global satellite ID*/
  8. uint8_t satellite_used[20]; /*< 0: Satellite not used, 1: used for localization*/
  9. uint8_t satellite_elevation[20]; /*< [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite*/
  10. uint8_t satellite_azimuth[20]; /*< [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.*/
  11. uint8_t satellite_snr[20]; /*< [dB] Signal to noise ratio of satellite*/
  12. }) mavlink_gps_status_t;
  13. #define MAVLINK_MSG_ID_GPS_STATUS_LEN 101
  14. #define MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN 101
  15. #define MAVLINK_MSG_ID_25_LEN 101
  16. #define MAVLINK_MSG_ID_25_MIN_LEN 101
  17. #define MAVLINK_MSG_ID_GPS_STATUS_CRC 23
  18. #define MAVLINK_MSG_ID_25_CRC 23
  19. #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_PRN_LEN 20
  20. #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_USED_LEN 20
  21. #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_ELEVATION_LEN 20
  22. #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_AZIMUTH_LEN 20
  23. #define MAVLINK_MSG_GPS_STATUS_FIELD_SATELLITE_SNR_LEN 20
  24. #if MAVLINK_COMMAND_24BIT
  25. #define MAVLINK_MESSAGE_INFO_GPS_STATUS { \
  26. 25, \
  27. "GPS_STATUS", \
  28. 6, \
  29. { { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \
  30. { "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \
  31. { "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \
  32. { "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \
  33. { "satellite_azimuth", NULL, MAVLINK_TYPE_UINT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \
  34. { "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \
  35. } \
  36. }
  37. #else
  38. #define MAVLINK_MESSAGE_INFO_GPS_STATUS { \
  39. "GPS_STATUS", \
  40. 6, \
  41. { { "satellites_visible", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_gps_status_t, satellites_visible) }, \
  42. { "satellite_prn", NULL, MAVLINK_TYPE_UINT8_T, 20, 1, offsetof(mavlink_gps_status_t, satellite_prn) }, \
  43. { "satellite_used", NULL, MAVLINK_TYPE_UINT8_T, 20, 21, offsetof(mavlink_gps_status_t, satellite_used) }, \
  44. { "satellite_elevation", NULL, MAVLINK_TYPE_UINT8_T, 20, 41, offsetof(mavlink_gps_status_t, satellite_elevation) }, \
  45. { "satellite_azimuth", NULL, MAVLINK_TYPE_UINT8_T, 20, 61, offsetof(mavlink_gps_status_t, satellite_azimuth) }, \
  46. { "satellite_snr", NULL, MAVLINK_TYPE_UINT8_T, 20, 81, offsetof(mavlink_gps_status_t, satellite_snr) }, \
  47. } \
  48. }
  49. #endif
  50. /**
  51. * @brief Pack a gps_status message
  52. * @param system_id ID of this system
  53. * @param component_id ID of this component (e.g. 200 for IMU)
  54. * @param msg The MAVLink message to compress the data into
  55. *
  56. * @param satellites_visible Number of satellites visible
  57. * @param satellite_prn Global satellite ID
  58. * @param satellite_used 0: Satellite not used, 1: used for localization
  59. * @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
  60. * @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
  61. * @param satellite_snr [dB] Signal to noise ratio of satellite
  62. * @return length of the message in bytes (excluding serial stream start sign)
  63. */
  64. static inline uint16_t mavlink_msg_gps_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  65. uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
  66. {
  67. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  68. char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
  69. _mav_put_uint8_t(buf, 0, satellites_visible);
  70. _mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
  71. _mav_put_uint8_t_array(buf, 21, satellite_used, 20);
  72. _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
  73. _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
  74. _mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
  75. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN);
  76. #else
  77. mavlink_gps_status_t packet;
  78. packet.satellites_visible = satellites_visible;
  79. mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
  80. mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
  81. mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
  82. mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
  83. mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
  84. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN);
  85. #endif
  86. msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
  87. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
  88. }
  89. /**
  90. * @brief Pack a gps_status message on a channel
  91. * @param system_id ID of this system
  92. * @param component_id ID of this component (e.g. 200 for IMU)
  93. * @param chan The MAVLink channel this message will be sent over
  94. * @param msg The MAVLink message to compress the data into
  95. * @param satellites_visible Number of satellites visible
  96. * @param satellite_prn Global satellite ID
  97. * @param satellite_used 0: Satellite not used, 1: used for localization
  98. * @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
  99. * @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
  100. * @param satellite_snr [dB] Signal to noise ratio of satellite
  101. * @return length of the message in bytes (excluding serial stream start sign)
  102. */
  103. static inline uint16_t mavlink_msg_gps_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  104. mavlink_message_t* msg,
  105. uint8_t satellites_visible,const uint8_t *satellite_prn,const uint8_t *satellite_used,const uint8_t *satellite_elevation,const uint8_t *satellite_azimuth,const uint8_t *satellite_snr)
  106. {
  107. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  108. char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
  109. _mav_put_uint8_t(buf, 0, satellites_visible);
  110. _mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
  111. _mav_put_uint8_t_array(buf, 21, satellite_used, 20);
  112. _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
  113. _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
  114. _mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
  115. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_GPS_STATUS_LEN);
  116. #else
  117. mavlink_gps_status_t packet;
  118. packet.satellites_visible = satellites_visible;
  119. mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
  120. mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
  121. mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
  122. mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
  123. mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
  124. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_GPS_STATUS_LEN);
  125. #endif
  126. msg->msgid = MAVLINK_MSG_ID_GPS_STATUS;
  127. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
  128. }
  129. /**
  130. * @brief Encode a gps_status struct
  131. *
  132. * @param system_id ID of this system
  133. * @param component_id ID of this component (e.g. 200 for IMU)
  134. * @param msg The MAVLink message to compress the data into
  135. * @param gps_status C-struct to read the message contents from
  136. */
  137. static inline uint16_t mavlink_msg_gps_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status)
  138. {
  139. return mavlink_msg_gps_status_pack(system_id, component_id, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
  140. }
  141. /**
  142. * @brief Encode a gps_status struct on a channel
  143. *
  144. * @param system_id ID of this system
  145. * @param component_id ID of this component (e.g. 200 for IMU)
  146. * @param chan The MAVLink channel this message will be sent over
  147. * @param msg The MAVLink message to compress the data into
  148. * @param gps_status C-struct to read the message contents from
  149. */
  150. static inline uint16_t mavlink_msg_gps_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_gps_status_t* gps_status)
  151. {
  152. return mavlink_msg_gps_status_pack_chan(system_id, component_id, chan, msg, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
  153. }
  154. /**
  155. * @brief Send a gps_status message
  156. * @param chan MAVLink channel to send the message
  157. *
  158. * @param satellites_visible Number of satellites visible
  159. * @param satellite_prn Global satellite ID
  160. * @param satellite_used 0: Satellite not used, 1: used for localization
  161. * @param satellite_elevation [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
  162. * @param satellite_azimuth [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
  163. * @param satellite_snr [dB] Signal to noise ratio of satellite
  164. */
  165. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  166. static inline void mavlink_msg_gps_status_send(mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
  167. {
  168. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  169. char buf[MAVLINK_MSG_ID_GPS_STATUS_LEN];
  170. _mav_put_uint8_t(buf, 0, satellites_visible);
  171. _mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
  172. _mav_put_uint8_t_array(buf, 21, satellite_used, 20);
  173. _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
  174. _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
  175. _mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
  176. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
  177. #else
  178. mavlink_gps_status_t packet;
  179. packet.satellites_visible = satellites_visible;
  180. mav_array_memcpy(packet.satellite_prn, satellite_prn, sizeof(uint8_t)*20);
  181. mav_array_memcpy(packet.satellite_used, satellite_used, sizeof(uint8_t)*20);
  182. mav_array_memcpy(packet.satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
  183. mav_array_memcpy(packet.satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
  184. mav_array_memcpy(packet.satellite_snr, satellite_snr, sizeof(uint8_t)*20);
  185. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)&packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
  186. #endif
  187. }
  188. /**
  189. * @brief Send a gps_status message
  190. * @param chan MAVLink channel to send the message
  191. * @param struct The MAVLink struct to serialize
  192. */
  193. static inline void mavlink_msg_gps_status_send_struct(mavlink_channel_t chan, const mavlink_gps_status_t* gps_status)
  194. {
  195. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  196. mavlink_msg_gps_status_send(chan, gps_status->satellites_visible, gps_status->satellite_prn, gps_status->satellite_used, gps_status->satellite_elevation, gps_status->satellite_azimuth, gps_status->satellite_snr);
  197. #else
  198. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)gps_status, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
  199. #endif
  200. }
  201. #if MAVLINK_MSG_ID_GPS_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  202. /*
  203. This varient of _send() can be used to save stack space by re-using
  204. memory from the receive buffer. The caller provides a
  205. mavlink_message_t which is the size of a full mavlink message. This
  206. is usually the receive buffer for the channel, and allows a reply to an
  207. incoming message with minimum stack space usage.
  208. */
  209. static inline void mavlink_msg_gps_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t satellites_visible, const uint8_t *satellite_prn, const uint8_t *satellite_used, const uint8_t *satellite_elevation, const uint8_t *satellite_azimuth, const uint8_t *satellite_snr)
  210. {
  211. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  212. char *buf = (char *)msgbuf;
  213. _mav_put_uint8_t(buf, 0, satellites_visible);
  214. _mav_put_uint8_t_array(buf, 1, satellite_prn, 20);
  215. _mav_put_uint8_t_array(buf, 21, satellite_used, 20);
  216. _mav_put_uint8_t_array(buf, 41, satellite_elevation, 20);
  217. _mav_put_uint8_t_array(buf, 61, satellite_azimuth, 20);
  218. _mav_put_uint8_t_array(buf, 81, satellite_snr, 20);
  219. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, buf, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
  220. #else
  221. mavlink_gps_status_t *packet = (mavlink_gps_status_t *)msgbuf;
  222. packet->satellites_visible = satellites_visible;
  223. mav_array_memcpy(packet->satellite_prn, satellite_prn, sizeof(uint8_t)*20);
  224. mav_array_memcpy(packet->satellite_used, satellite_used, sizeof(uint8_t)*20);
  225. mav_array_memcpy(packet->satellite_elevation, satellite_elevation, sizeof(uint8_t)*20);
  226. mav_array_memcpy(packet->satellite_azimuth, satellite_azimuth, sizeof(uint8_t)*20);
  227. mav_array_memcpy(packet->satellite_snr, satellite_snr, sizeof(uint8_t)*20);
  228. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_GPS_STATUS, (const char *)packet, MAVLINK_MSG_ID_GPS_STATUS_MIN_LEN, MAVLINK_MSG_ID_GPS_STATUS_LEN, MAVLINK_MSG_ID_GPS_STATUS_CRC);
  229. #endif
  230. }
  231. #endif
  232. #endif
  233. // MESSAGE GPS_STATUS UNPACKING
  234. /**
  235. * @brief Get field satellites_visible from gps_status message
  236. *
  237. * @return Number of satellites visible
  238. */
  239. static inline uint8_t mavlink_msg_gps_status_get_satellites_visible(const mavlink_message_t* msg)
  240. {
  241. return _MAV_RETURN_uint8_t(msg, 0);
  242. }
  243. /**
  244. * @brief Get field satellite_prn from gps_status message
  245. *
  246. * @return Global satellite ID
  247. */
  248. static inline uint16_t mavlink_msg_gps_status_get_satellite_prn(const mavlink_message_t* msg, uint8_t *satellite_prn)
  249. {
  250. return _MAV_RETURN_uint8_t_array(msg, satellite_prn, 20, 1);
  251. }
  252. /**
  253. * @brief Get field satellite_used from gps_status message
  254. *
  255. * @return 0: Satellite not used, 1: used for localization
  256. */
  257. static inline uint16_t mavlink_msg_gps_status_get_satellite_used(const mavlink_message_t* msg, uint8_t *satellite_used)
  258. {
  259. return _MAV_RETURN_uint8_t_array(msg, satellite_used, 20, 21);
  260. }
  261. /**
  262. * @brief Get field satellite_elevation from gps_status message
  263. *
  264. * @return [deg] Elevation (0: right on top of receiver, 90: on the horizon) of satellite
  265. */
  266. static inline uint16_t mavlink_msg_gps_status_get_satellite_elevation(const mavlink_message_t* msg, uint8_t *satellite_elevation)
  267. {
  268. return _MAV_RETURN_uint8_t_array(msg, satellite_elevation, 20, 41);
  269. }
  270. /**
  271. * @brief Get field satellite_azimuth from gps_status message
  272. *
  273. * @return [deg] Direction of satellite, 0: 0 deg, 255: 360 deg.
  274. */
  275. static inline uint16_t mavlink_msg_gps_status_get_satellite_azimuth(const mavlink_message_t* msg, uint8_t *satellite_azimuth)
  276. {
  277. return _MAV_RETURN_uint8_t_array(msg, satellite_azimuth, 20, 61);
  278. }
  279. /**
  280. * @brief Get field satellite_snr from gps_status message
  281. *
  282. * @return [dB] Signal to noise ratio of satellite
  283. */
  284. static inline uint16_t mavlink_msg_gps_status_get_satellite_snr(const mavlink_message_t* msg, uint8_t *satellite_snr)
  285. {
  286. return _MAV_RETURN_uint8_t_array(msg, satellite_snr, 20, 81);
  287. }
  288. /**
  289. * @brief Decode a gps_status message into a struct
  290. *
  291. * @param msg The message to decode
  292. * @param gps_status C-struct to decode the message contents into
  293. */
  294. static inline void mavlink_msg_gps_status_decode(const mavlink_message_t* msg, mavlink_gps_status_t* gps_status)
  295. {
  296. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  297. gps_status->satellites_visible = mavlink_msg_gps_status_get_satellites_visible(msg);
  298. mavlink_msg_gps_status_get_satellite_prn(msg, gps_status->satellite_prn);
  299. mavlink_msg_gps_status_get_satellite_used(msg, gps_status->satellite_used);
  300. mavlink_msg_gps_status_get_satellite_elevation(msg, gps_status->satellite_elevation);
  301. mavlink_msg_gps_status_get_satellite_azimuth(msg, gps_status->satellite_azimuth);
  302. mavlink_msg_gps_status_get_satellite_snr(msg, gps_status->satellite_snr);
  303. #else
  304. uint8_t len = msg->len < MAVLINK_MSG_ID_GPS_STATUS_LEN? msg->len : MAVLINK_MSG_ID_GPS_STATUS_LEN;
  305. memset(gps_status, 0, MAVLINK_MSG_ID_GPS_STATUS_LEN);
  306. memcpy(gps_status, _MAV_PAYLOAD(msg), len);
  307. #endif
  308. }