mavlink_msg_time_estimate_to_target.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385
  1. #pragma once
  2. // MESSAGE TIME_ESTIMATE_TO_TARGET PACKING
  3. #define MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET 380
  4. typedef struct __mavlink_time_estimate_to_target_t {
  5. int32_t safe_return; /*< [s] Estimated time to complete the vehicle's configured "safe return" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available.*/
  6. int32_t land; /*< [s] Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available.*/
  7. int32_t mission_next_item; /*< [s] Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available.*/
  8. int32_t mission_end; /*< [s] Estimated time for completing the current mission. -1 means no mission active and/or no estimate available.*/
  9. int32_t commanded_action; /*< [s] Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available.*/
  10. } mavlink_time_estimate_to_target_t;
  11. #define MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN 20
  12. #define MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN 20
  13. #define MAVLINK_MSG_ID_380_LEN 20
  14. #define MAVLINK_MSG_ID_380_MIN_LEN 20
  15. #define MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC 232
  16. #define MAVLINK_MSG_ID_380_CRC 232
  17. #if MAVLINK_COMMAND_24BIT
  18. #define MAVLINK_MESSAGE_INFO_TIME_ESTIMATE_TO_TARGET { \
  19. 380, \
  20. "TIME_ESTIMATE_TO_TARGET", \
  21. 5, \
  22. { { "safe_return", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_time_estimate_to_target_t, safe_return) }, \
  23. { "land", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_time_estimate_to_target_t, land) }, \
  24. { "mission_next_item", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_time_estimate_to_target_t, mission_next_item) }, \
  25. { "mission_end", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_time_estimate_to_target_t, mission_end) }, \
  26. { "commanded_action", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_time_estimate_to_target_t, commanded_action) }, \
  27. } \
  28. }
  29. #else
  30. #define MAVLINK_MESSAGE_INFO_TIME_ESTIMATE_TO_TARGET { \
  31. "TIME_ESTIMATE_TO_TARGET", \
  32. 5, \
  33. { { "safe_return", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_time_estimate_to_target_t, safe_return) }, \
  34. { "land", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_time_estimate_to_target_t, land) }, \
  35. { "mission_next_item", NULL, MAVLINK_TYPE_INT32_T, 0, 8, offsetof(mavlink_time_estimate_to_target_t, mission_next_item) }, \
  36. { "mission_end", NULL, MAVLINK_TYPE_INT32_T, 0, 12, offsetof(mavlink_time_estimate_to_target_t, mission_end) }, \
  37. { "commanded_action", NULL, MAVLINK_TYPE_INT32_T, 0, 16, offsetof(mavlink_time_estimate_to_target_t, commanded_action) }, \
  38. } \
  39. }
  40. #endif
  41. /**
  42. * @brief Pack a time_estimate_to_target message
  43. * @param system_id ID of this system
  44. * @param component_id ID of this component (e.g. 200 for IMU)
  45. * @param msg The MAVLink message to compress the data into
  46. *
  47. * @param safe_return [s] Estimated time to complete the vehicle's configured "safe return" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available.
  48. * @param land [s] Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available.
  49. * @param mission_next_item [s] Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available.
  50. * @param mission_end [s] Estimated time for completing the current mission. -1 means no mission active and/or no estimate available.
  51. * @param commanded_action [s] Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available.
  52. * @return length of the message in bytes (excluding serial stream start sign)
  53. */
  54. MAVLINK_WIP
  55. static inline uint16_t mavlink_msg_time_estimate_to_target_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  56. int32_t safe_return, int32_t land, int32_t mission_next_item, int32_t mission_end, int32_t commanded_action)
  57. {
  58. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  59. char buf[MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN];
  60. _mav_put_int32_t(buf, 0, safe_return);
  61. _mav_put_int32_t(buf, 4, land);
  62. _mav_put_int32_t(buf, 8, mission_next_item);
  63. _mav_put_int32_t(buf, 12, mission_end);
  64. _mav_put_int32_t(buf, 16, commanded_action);
  65. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  66. #else
  67. mavlink_time_estimate_to_target_t packet;
  68. packet.safe_return = safe_return;
  69. packet.land = land;
  70. packet.mission_next_item = mission_next_item;
  71. packet.mission_end = mission_end;
  72. packet.commanded_action = commanded_action;
  73. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  74. #endif
  75. msg->msgid = MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET;
  76. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  77. }
  78. /**
  79. * @brief Pack a time_estimate_to_target message
  80. * @param system_id ID of this system
  81. * @param component_id ID of this component (e.g. 200 for IMU)
  82. * @param status MAVLink status structure
  83. * @param msg The MAVLink message to compress the data into
  84. *
  85. * @param safe_return [s] Estimated time to complete the vehicle's configured "safe return" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available.
  86. * @param land [s] Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available.
  87. * @param mission_next_item [s] Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available.
  88. * @param mission_end [s] Estimated time for completing the current mission. -1 means no mission active and/or no estimate available.
  89. * @param commanded_action [s] Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available.
  90. * @return length of the message in bytes (excluding serial stream start sign)
  91. */
  92. static inline uint16_t mavlink_msg_time_estimate_to_target_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  93. int32_t safe_return, int32_t land, int32_t mission_next_item, int32_t mission_end, int32_t commanded_action)
  94. {
  95. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  96. char buf[MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN];
  97. _mav_put_int32_t(buf, 0, safe_return);
  98. _mav_put_int32_t(buf, 4, land);
  99. _mav_put_int32_t(buf, 8, mission_next_item);
  100. _mav_put_int32_t(buf, 12, mission_end);
  101. _mav_put_int32_t(buf, 16, commanded_action);
  102. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  103. #else
  104. mavlink_time_estimate_to_target_t packet;
  105. packet.safe_return = safe_return;
  106. packet.land = land;
  107. packet.mission_next_item = mission_next_item;
  108. packet.mission_end = mission_end;
  109. packet.commanded_action = commanded_action;
  110. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  111. #endif
  112. msg->msgid = MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET;
  113. #if MAVLINK_CRC_EXTRA
  114. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  115. #else
  116. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  117. #endif
  118. }
  119. /**
  120. * @brief Pack a time_estimate_to_target message on a channel
  121. * @param system_id ID of this system
  122. * @param component_id ID of this component (e.g. 200 for IMU)
  123. * @param chan The MAVLink channel this message will be sent over
  124. * @param msg The MAVLink message to compress the data into
  125. * @param safe_return [s] Estimated time to complete the vehicle's configured "safe return" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available.
  126. * @param land [s] Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available.
  127. * @param mission_next_item [s] Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available.
  128. * @param mission_end [s] Estimated time for completing the current mission. -1 means no mission active and/or no estimate available.
  129. * @param commanded_action [s] Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available.
  130. * @return length of the message in bytes (excluding serial stream start sign)
  131. */
  132. MAVLINK_WIP
  133. static inline uint16_t mavlink_msg_time_estimate_to_target_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  134. mavlink_message_t* msg,
  135. int32_t safe_return,int32_t land,int32_t mission_next_item,int32_t mission_end,int32_t commanded_action)
  136. {
  137. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  138. char buf[MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN];
  139. _mav_put_int32_t(buf, 0, safe_return);
  140. _mav_put_int32_t(buf, 4, land);
  141. _mav_put_int32_t(buf, 8, mission_next_item);
  142. _mav_put_int32_t(buf, 12, mission_end);
  143. _mav_put_int32_t(buf, 16, commanded_action);
  144. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  145. #else
  146. mavlink_time_estimate_to_target_t packet;
  147. packet.safe_return = safe_return;
  148. packet.land = land;
  149. packet.mission_next_item = mission_next_item;
  150. packet.mission_end = mission_end;
  151. packet.commanded_action = commanded_action;
  152. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  153. #endif
  154. msg->msgid = MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET;
  155. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  156. }
  157. /**
  158. * @brief Encode a time_estimate_to_target struct
  159. *
  160. * @param system_id ID of this system
  161. * @param component_id ID of this component (e.g. 200 for IMU)
  162. * @param msg The MAVLink message to compress the data into
  163. * @param time_estimate_to_target C-struct to read the message contents from
  164. */
  165. MAVLINK_WIP
  166. static inline uint16_t mavlink_msg_time_estimate_to_target_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_time_estimate_to_target_t* time_estimate_to_target)
  167. {
  168. return mavlink_msg_time_estimate_to_target_pack(system_id, component_id, msg, time_estimate_to_target->safe_return, time_estimate_to_target->land, time_estimate_to_target->mission_next_item, time_estimate_to_target->mission_end, time_estimate_to_target->commanded_action);
  169. }
  170. /**
  171. * @brief Encode a time_estimate_to_target struct on a channel
  172. *
  173. * @param system_id ID of this system
  174. * @param component_id ID of this component (e.g. 200 for IMU)
  175. * @param chan The MAVLink channel this message will be sent over
  176. * @param msg The MAVLink message to compress the data into
  177. * @param time_estimate_to_target C-struct to read the message contents from
  178. */
  179. MAVLINK_WIP
  180. static inline uint16_t mavlink_msg_time_estimate_to_target_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_time_estimate_to_target_t* time_estimate_to_target)
  181. {
  182. return mavlink_msg_time_estimate_to_target_pack_chan(system_id, component_id, chan, msg, time_estimate_to_target->safe_return, time_estimate_to_target->land, time_estimate_to_target->mission_next_item, time_estimate_to_target->mission_end, time_estimate_to_target->commanded_action);
  183. }
  184. /**
  185. * @brief Encode a time_estimate_to_target struct with provided status structure
  186. *
  187. * @param system_id ID of this system
  188. * @param component_id ID of this component (e.g. 200 for IMU)
  189. * @param status MAVLink status structure
  190. * @param msg The MAVLink message to compress the data into
  191. * @param time_estimate_to_target C-struct to read the message contents from
  192. */
  193. static inline uint16_t mavlink_msg_time_estimate_to_target_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_time_estimate_to_target_t* time_estimate_to_target)
  194. {
  195. return mavlink_msg_time_estimate_to_target_pack_status(system_id, component_id, _status, msg, time_estimate_to_target->safe_return, time_estimate_to_target->land, time_estimate_to_target->mission_next_item, time_estimate_to_target->mission_end, time_estimate_to_target->commanded_action);
  196. }
  197. /**
  198. * @brief Send a time_estimate_to_target message
  199. * @param chan MAVLink channel to send the message
  200. *
  201. * @param safe_return [s] Estimated time to complete the vehicle's configured "safe return" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available.
  202. * @param land [s] Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available.
  203. * @param mission_next_item [s] Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available.
  204. * @param mission_end [s] Estimated time for completing the current mission. -1 means no mission active and/or no estimate available.
  205. * @param commanded_action [s] Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available.
  206. */
  207. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  208. MAVLINK_WIP
  209. static inline void mavlink_msg_time_estimate_to_target_send(mavlink_channel_t chan, int32_t safe_return, int32_t land, int32_t mission_next_item, int32_t mission_end, int32_t commanded_action)
  210. {
  211. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  212. char buf[MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN];
  213. _mav_put_int32_t(buf, 0, safe_return);
  214. _mav_put_int32_t(buf, 4, land);
  215. _mav_put_int32_t(buf, 8, mission_next_item);
  216. _mav_put_int32_t(buf, 12, mission_end);
  217. _mav_put_int32_t(buf, 16, commanded_action);
  218. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET, buf, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  219. #else
  220. mavlink_time_estimate_to_target_t packet;
  221. packet.safe_return = safe_return;
  222. packet.land = land;
  223. packet.mission_next_item = mission_next_item;
  224. packet.mission_end = mission_end;
  225. packet.commanded_action = commanded_action;
  226. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET, (const char *)&packet, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  227. #endif
  228. }
  229. /**
  230. * @brief Send a time_estimate_to_target message
  231. * @param chan MAVLink channel to send the message
  232. * @param struct The MAVLink struct to serialize
  233. */
  234. MAVLINK_WIP
  235. static inline void mavlink_msg_time_estimate_to_target_send_struct(mavlink_channel_t chan, const mavlink_time_estimate_to_target_t* time_estimate_to_target)
  236. {
  237. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  238. mavlink_msg_time_estimate_to_target_send(chan, time_estimate_to_target->safe_return, time_estimate_to_target->land, time_estimate_to_target->mission_next_item, time_estimate_to_target->mission_end, time_estimate_to_target->commanded_action);
  239. #else
  240. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET, (const char *)time_estimate_to_target, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  241. #endif
  242. }
  243. #if MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  244. /*
  245. This variant of _send() can be used to save stack space by reusing
  246. memory from the receive buffer. The caller provides a
  247. mavlink_message_t which is the size of a full mavlink message. This
  248. is usually the receive buffer for the channel, and allows a reply to an
  249. incoming message with minimum stack space usage.
  250. */
  251. MAVLINK_WIP
  252. static inline void mavlink_msg_time_estimate_to_target_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, int32_t safe_return, int32_t land, int32_t mission_next_item, int32_t mission_end, int32_t commanded_action)
  253. {
  254. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  255. char *buf = (char *)msgbuf;
  256. _mav_put_int32_t(buf, 0, safe_return);
  257. _mav_put_int32_t(buf, 4, land);
  258. _mav_put_int32_t(buf, 8, mission_next_item);
  259. _mav_put_int32_t(buf, 12, mission_end);
  260. _mav_put_int32_t(buf, 16, commanded_action);
  261. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET, buf, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  262. #else
  263. mavlink_time_estimate_to_target_t *packet = (mavlink_time_estimate_to_target_t *)msgbuf;
  264. packet->safe_return = safe_return;
  265. packet->land = land;
  266. packet->mission_next_item = mission_next_item;
  267. packet->mission_end = mission_end;
  268. packet->commanded_action = commanded_action;
  269. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET, (const char *)packet, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_MIN_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_CRC);
  270. #endif
  271. }
  272. #endif
  273. #endif
  274. // MESSAGE TIME_ESTIMATE_TO_TARGET UNPACKING
  275. /**
  276. * @brief Get field safe_return from time_estimate_to_target message
  277. *
  278. * @return [s] Estimated time to complete the vehicle's configured "safe return" action from its current position (e.g. RTL, Smart RTL, etc.). -1 indicates that the vehicle is landed, or that no time estimate available.
  279. */
  280. MAVLINK_WIP
  281. static inline int32_t mavlink_msg_time_estimate_to_target_get_safe_return(const mavlink_message_t* msg)
  282. {
  283. return _MAV_RETURN_int32_t(msg, 0);
  284. }
  285. /**
  286. * @brief Get field land from time_estimate_to_target message
  287. *
  288. * @return [s] Estimated time for vehicle to complete the LAND action from its current position. -1 indicates that the vehicle is landed, or that no time estimate available.
  289. */
  290. MAVLINK_WIP
  291. static inline int32_t mavlink_msg_time_estimate_to_target_get_land(const mavlink_message_t* msg)
  292. {
  293. return _MAV_RETURN_int32_t(msg, 4);
  294. }
  295. /**
  296. * @brief Get field mission_next_item from time_estimate_to_target message
  297. *
  298. * @return [s] Estimated time for reaching/completing the currently active mission item. -1 means no time estimate available.
  299. */
  300. MAVLINK_WIP
  301. static inline int32_t mavlink_msg_time_estimate_to_target_get_mission_next_item(const mavlink_message_t* msg)
  302. {
  303. return _MAV_RETURN_int32_t(msg, 8);
  304. }
  305. /**
  306. * @brief Get field mission_end from time_estimate_to_target message
  307. *
  308. * @return [s] Estimated time for completing the current mission. -1 means no mission active and/or no estimate available.
  309. */
  310. MAVLINK_WIP
  311. static inline int32_t mavlink_msg_time_estimate_to_target_get_mission_end(const mavlink_message_t* msg)
  312. {
  313. return _MAV_RETURN_int32_t(msg, 12);
  314. }
  315. /**
  316. * @brief Get field commanded_action from time_estimate_to_target message
  317. *
  318. * @return [s] Estimated time for completing the current commanded action (i.e. Go To, Takeoff, Land, etc.). -1 means no action active and/or no estimate available.
  319. */
  320. MAVLINK_WIP
  321. static inline int32_t mavlink_msg_time_estimate_to_target_get_commanded_action(const mavlink_message_t* msg)
  322. {
  323. return _MAV_RETURN_int32_t(msg, 16);
  324. }
  325. /**
  326. * @brief Decode a time_estimate_to_target message into a struct
  327. *
  328. * @param msg The message to decode
  329. * @param time_estimate_to_target C-struct to decode the message contents into
  330. */
  331. MAVLINK_WIP
  332. static inline void mavlink_msg_time_estimate_to_target_decode(const mavlink_message_t* msg, mavlink_time_estimate_to_target_t* time_estimate_to_target)
  333. {
  334. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  335. time_estimate_to_target->safe_return = mavlink_msg_time_estimate_to_target_get_safe_return(msg);
  336. time_estimate_to_target->land = mavlink_msg_time_estimate_to_target_get_land(msg);
  337. time_estimate_to_target->mission_next_item = mavlink_msg_time_estimate_to_target_get_mission_next_item(msg);
  338. time_estimate_to_target->mission_end = mavlink_msg_time_estimate_to_target_get_mission_end(msg);
  339. time_estimate_to_target->commanded_action = mavlink_msg_time_estimate_to_target_get_commanded_action(msg);
  340. #else
  341. uint8_t len = msg->len < MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN? msg->len : MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN;
  342. memset(time_estimate_to_target, 0, MAVLINK_MSG_ID_TIME_ESTIMATE_TO_TARGET_LEN);
  343. memcpy(time_estimate_to_target, _MAV_PAYLOAD(msg), len);
  344. #endif
  345. }