mavlink_msg_vkfly_edu_status_ack.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288
  1. #pragma once
  2. // MESSAGE VKFLY_EDU_STATUS_ACK PACKING
  3. #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK 53026
  4. typedef struct __mavlink_vkfly_edu_status_ack_t {
  5. uint64_t unix_timestamp; /*< [ms] Unix timestamp in ms, from 1 Jan 1970.*/
  6. uint32_t seq; /*< Sequence number in the received VKFLY_EDU_STATUS.*/
  7. } mavlink_vkfly_edu_status_ack_t;
  8. #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN 12
  9. #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN 12
  10. #define MAVLINK_MSG_ID_53026_LEN 12
  11. #define MAVLINK_MSG_ID_53026_MIN_LEN 12
  12. #define MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC 148
  13. #define MAVLINK_MSG_ID_53026_CRC 148
  14. #if MAVLINK_COMMAND_24BIT
  15. #define MAVLINK_MESSAGE_INFO_VKFLY_EDU_STATUS_ACK { \
  16. 53026, \
  17. "VKFLY_EDU_STATUS_ACK", \
  18. 2, \
  19. { { "unix_timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vkfly_edu_status_ack_t, unix_timestamp) }, \
  20. { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_vkfly_edu_status_ack_t, seq) }, \
  21. } \
  22. }
  23. #else
  24. #define MAVLINK_MESSAGE_INFO_VKFLY_EDU_STATUS_ACK { \
  25. "VKFLY_EDU_STATUS_ACK", \
  26. 2, \
  27. { { "unix_timestamp", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_vkfly_edu_status_ack_t, unix_timestamp) }, \
  28. { "seq", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_vkfly_edu_status_ack_t, seq) }, \
  29. } \
  30. }
  31. #endif
  32. /**
  33. * @brief Pack a vkfly_edu_status_ack message
  34. * @param system_id ID of this system
  35. * @param component_id ID of this component (e.g. 200 for IMU)
  36. * @param msg The MAVLink message to compress the data into
  37. *
  38. * @param unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970.
  39. * @param seq Sequence number in the received VKFLY_EDU_STATUS.
  40. * @return length of the message in bytes (excluding serial stream start sign)
  41. */
  42. static inline uint16_t mavlink_msg_vkfly_edu_status_ack_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  43. uint64_t unix_timestamp, uint32_t seq)
  44. {
  45. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  46. char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN];
  47. _mav_put_uint64_t(buf, 0, unix_timestamp);
  48. _mav_put_uint32_t(buf, 8, seq);
  49. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  50. #else
  51. mavlink_vkfly_edu_status_ack_t packet;
  52. packet.unix_timestamp = unix_timestamp;
  53. packet.seq = seq;
  54. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  55. #endif
  56. msg->msgid = MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK;
  57. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  58. }
  59. /**
  60. * @brief Pack a vkfly_edu_status_ack message
  61. * @param system_id ID of this system
  62. * @param component_id ID of this component (e.g. 200 for IMU)
  63. * @param status MAVLink status structure
  64. * @param msg The MAVLink message to compress the data into
  65. *
  66. * @param unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970.
  67. * @param seq Sequence number in the received VKFLY_EDU_STATUS.
  68. * @return length of the message in bytes (excluding serial stream start sign)
  69. */
  70. static inline uint16_t mavlink_msg_vkfly_edu_status_ack_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  71. uint64_t unix_timestamp, uint32_t seq)
  72. {
  73. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  74. char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN];
  75. _mav_put_uint64_t(buf, 0, unix_timestamp);
  76. _mav_put_uint32_t(buf, 8, seq);
  77. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  78. #else
  79. mavlink_vkfly_edu_status_ack_t packet;
  80. packet.unix_timestamp = unix_timestamp;
  81. packet.seq = seq;
  82. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  83. #endif
  84. msg->msgid = MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK;
  85. #if MAVLINK_CRC_EXTRA
  86. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  87. #else
  88. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  89. #endif
  90. }
  91. /**
  92. * @brief Pack a vkfly_edu_status_ack message on a channel
  93. * @param system_id ID of this system
  94. * @param component_id ID of this component (e.g. 200 for IMU)
  95. * @param chan The MAVLink channel this message will be sent over
  96. * @param msg The MAVLink message to compress the data into
  97. * @param unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970.
  98. * @param seq Sequence number in the received VKFLY_EDU_STATUS.
  99. * @return length of the message in bytes (excluding serial stream start sign)
  100. */
  101. static inline uint16_t mavlink_msg_vkfly_edu_status_ack_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  102. mavlink_message_t* msg,
  103. uint64_t unix_timestamp,uint32_t seq)
  104. {
  105. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  106. char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN];
  107. _mav_put_uint64_t(buf, 0, unix_timestamp);
  108. _mav_put_uint32_t(buf, 8, seq);
  109. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  110. #else
  111. mavlink_vkfly_edu_status_ack_t packet;
  112. packet.unix_timestamp = unix_timestamp;
  113. packet.seq = seq;
  114. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  115. #endif
  116. msg->msgid = MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK;
  117. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  118. }
  119. /**
  120. * @brief Encode a vkfly_edu_status_ack struct
  121. *
  122. * @param system_id ID of this system
  123. * @param component_id ID of this component (e.g. 200 for IMU)
  124. * @param msg The MAVLink message to compress the data into
  125. * @param vkfly_edu_status_ack C-struct to read the message contents from
  126. */
  127. static inline uint16_t mavlink_msg_vkfly_edu_status_ack_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_vkfly_edu_status_ack_t* vkfly_edu_status_ack)
  128. {
  129. return mavlink_msg_vkfly_edu_status_ack_pack(system_id, component_id, msg, vkfly_edu_status_ack->unix_timestamp, vkfly_edu_status_ack->seq);
  130. }
  131. /**
  132. * @brief Encode a vkfly_edu_status_ack struct on a channel
  133. *
  134. * @param system_id ID of this system
  135. * @param component_id ID of this component (e.g. 200 for IMU)
  136. * @param chan The MAVLink channel this message will be sent over
  137. * @param msg The MAVLink message to compress the data into
  138. * @param vkfly_edu_status_ack C-struct to read the message contents from
  139. */
  140. static inline uint16_t mavlink_msg_vkfly_edu_status_ack_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_vkfly_edu_status_ack_t* vkfly_edu_status_ack)
  141. {
  142. return mavlink_msg_vkfly_edu_status_ack_pack_chan(system_id, component_id, chan, msg, vkfly_edu_status_ack->unix_timestamp, vkfly_edu_status_ack->seq);
  143. }
  144. /**
  145. * @brief Encode a vkfly_edu_status_ack struct with provided status structure
  146. *
  147. * @param system_id ID of this system
  148. * @param component_id ID of this component (e.g. 200 for IMU)
  149. * @param status MAVLink status structure
  150. * @param msg The MAVLink message to compress the data into
  151. * @param vkfly_edu_status_ack C-struct to read the message contents from
  152. */
  153. static inline uint16_t mavlink_msg_vkfly_edu_status_ack_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_vkfly_edu_status_ack_t* vkfly_edu_status_ack)
  154. {
  155. return mavlink_msg_vkfly_edu_status_ack_pack_status(system_id, component_id, _status, msg, vkfly_edu_status_ack->unix_timestamp, vkfly_edu_status_ack->seq);
  156. }
  157. /**
  158. * @brief Send a vkfly_edu_status_ack message
  159. * @param chan MAVLink channel to send the message
  160. *
  161. * @param unix_timestamp [ms] Unix timestamp in ms, from 1 Jan 1970.
  162. * @param seq Sequence number in the received VKFLY_EDU_STATUS.
  163. */
  164. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  165. static inline void mavlink_msg_vkfly_edu_status_ack_send(mavlink_channel_t chan, uint64_t unix_timestamp, uint32_t seq)
  166. {
  167. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  168. char buf[MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN];
  169. _mav_put_uint64_t(buf, 0, unix_timestamp);
  170. _mav_put_uint32_t(buf, 8, seq);
  171. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK, buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  172. #else
  173. mavlink_vkfly_edu_status_ack_t packet;
  174. packet.unix_timestamp = unix_timestamp;
  175. packet.seq = seq;
  176. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK, (const char *)&packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  177. #endif
  178. }
  179. /**
  180. * @brief Send a vkfly_edu_status_ack message
  181. * @param chan MAVLink channel to send the message
  182. * @param struct The MAVLink struct to serialize
  183. */
  184. static inline void mavlink_msg_vkfly_edu_status_ack_send_struct(mavlink_channel_t chan, const mavlink_vkfly_edu_status_ack_t* vkfly_edu_status_ack)
  185. {
  186. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  187. mavlink_msg_vkfly_edu_status_ack_send(chan, vkfly_edu_status_ack->unix_timestamp, vkfly_edu_status_ack->seq);
  188. #else
  189. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK, (const char *)vkfly_edu_status_ack, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  190. #endif
  191. }
  192. #if MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  193. /*
  194. This variant of _send() can be used to save stack space by re-using
  195. memory from the receive buffer. The caller provides a
  196. mavlink_message_t which is the size of a full mavlink message. This
  197. is usually the receive buffer for the channel, and allows a reply to an
  198. incoming message with minimum stack space usage.
  199. */
  200. static inline void mavlink_msg_vkfly_edu_status_ack_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t unix_timestamp, uint32_t seq)
  201. {
  202. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  203. char *buf = (char *)msgbuf;
  204. _mav_put_uint64_t(buf, 0, unix_timestamp);
  205. _mav_put_uint32_t(buf, 8, seq);
  206. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK, buf, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  207. #else
  208. mavlink_vkfly_edu_status_ack_t *packet = (mavlink_vkfly_edu_status_ack_t *)msgbuf;
  209. packet->unix_timestamp = unix_timestamp;
  210. packet->seq = seq;
  211. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK, (const char *)packet, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_MIN_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_CRC);
  212. #endif
  213. }
  214. #endif
  215. #endif
  216. // MESSAGE VKFLY_EDU_STATUS_ACK UNPACKING
  217. /**
  218. * @brief Get field unix_timestamp from vkfly_edu_status_ack message
  219. *
  220. * @return [ms] Unix timestamp in ms, from 1 Jan 1970.
  221. */
  222. static inline uint64_t mavlink_msg_vkfly_edu_status_ack_get_unix_timestamp(const mavlink_message_t* msg)
  223. {
  224. return _MAV_RETURN_uint64_t(msg, 0);
  225. }
  226. /**
  227. * @brief Get field seq from vkfly_edu_status_ack message
  228. *
  229. * @return Sequence number in the received VKFLY_EDU_STATUS.
  230. */
  231. static inline uint32_t mavlink_msg_vkfly_edu_status_ack_get_seq(const mavlink_message_t* msg)
  232. {
  233. return _MAV_RETURN_uint32_t(msg, 8);
  234. }
  235. /**
  236. * @brief Decode a vkfly_edu_status_ack message into a struct
  237. *
  238. * @param msg The message to decode
  239. * @param vkfly_edu_status_ack C-struct to decode the message contents into
  240. */
  241. static inline void mavlink_msg_vkfly_edu_status_ack_decode(const mavlink_message_t* msg, mavlink_vkfly_edu_status_ack_t* vkfly_edu_status_ack)
  242. {
  243. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  244. vkfly_edu_status_ack->unix_timestamp = mavlink_msg_vkfly_edu_status_ack_get_unix_timestamp(msg);
  245. vkfly_edu_status_ack->seq = mavlink_msg_vkfly_edu_status_ack_get_seq(msg);
  246. #else
  247. uint8_t len = msg->len < MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN? msg->len : MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN;
  248. memset(vkfly_edu_status_ack, 0, MAVLINK_MSG_ID_VKFLY_EDU_STATUS_ACK_LEN);
  249. memcpy(vkfly_edu_status_ack, _MAV_PAYLOAD(msg), len);
  250. #endif
  251. }