mavlink_msg_protocol_version.h 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376
  1. #pragma once
  2. // MESSAGE PROTOCOL_VERSION PACKING
  3. #define MAVLINK_MSG_ID_PROTOCOL_VERSION 300
  4. typedef struct __mavlink_protocol_version_t {
  5. uint16_t version; /*< Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc.*/
  6. uint16_t min_version; /*< Minimum MAVLink version supported*/
  7. uint16_t max_version; /*< Maximum MAVLink version supported (set to the same value as version by default)*/
  8. uint8_t spec_version_hash[8]; /*< The first 8 bytes (not characters printed in hex!) of the git hash.*/
  9. uint8_t library_version_hash[8]; /*< The first 8 bytes (not characters printed in hex!) of the git hash.*/
  10. } mavlink_protocol_version_t;
  11. #define MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN 22
  12. #define MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN 22
  13. #define MAVLINK_MSG_ID_300_LEN 22
  14. #define MAVLINK_MSG_ID_300_MIN_LEN 22
  15. #define MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC 217
  16. #define MAVLINK_MSG_ID_300_CRC 217
  17. #define MAVLINK_MSG_PROTOCOL_VERSION_FIELD_SPEC_VERSION_HASH_LEN 8
  18. #define MAVLINK_MSG_PROTOCOL_VERSION_FIELD_LIBRARY_VERSION_HASH_LEN 8
  19. #if MAVLINK_COMMAND_24BIT
  20. #define MAVLINK_MESSAGE_INFO_PROTOCOL_VERSION { \
  21. 300, \
  22. "PROTOCOL_VERSION", \
  23. 5, \
  24. { { "version", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_protocol_version_t, version) }, \
  25. { "min_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_protocol_version_t, min_version) }, \
  26. { "max_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_protocol_version_t, max_version) }, \
  27. { "spec_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8, 6, offsetof(mavlink_protocol_version_t, spec_version_hash) }, \
  28. { "library_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8, 14, offsetof(mavlink_protocol_version_t, library_version_hash) }, \
  29. } \
  30. }
  31. #else
  32. #define MAVLINK_MESSAGE_INFO_PROTOCOL_VERSION { \
  33. "PROTOCOL_VERSION", \
  34. 5, \
  35. { { "version", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_protocol_version_t, version) }, \
  36. { "min_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 2, offsetof(mavlink_protocol_version_t, min_version) }, \
  37. { "max_version", NULL, MAVLINK_TYPE_UINT16_T, 0, 4, offsetof(mavlink_protocol_version_t, max_version) }, \
  38. { "spec_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8, 6, offsetof(mavlink_protocol_version_t, spec_version_hash) }, \
  39. { "library_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8, 14, offsetof(mavlink_protocol_version_t, library_version_hash) }, \
  40. } \
  41. }
  42. #endif
  43. /**
  44. * @brief Pack a protocol_version message
  45. * @param system_id ID of this system
  46. * @param component_id ID of this component (e.g. 200 for IMU)
  47. * @param msg The MAVLink message to compress the data into
  48. *
  49. * @param version Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc.
  50. * @param min_version Minimum MAVLink version supported
  51. * @param max_version Maximum MAVLink version supported (set to the same value as version by default)
  52. * @param spec_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  53. * @param library_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  54. * @return length of the message in bytes (excluding serial stream start sign)
  55. */
  56. MAVLINK_WIP
  57. static inline uint16_t mavlink_msg_protocol_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  58. uint16_t version, uint16_t min_version, uint16_t max_version, const uint8_t *spec_version_hash, const uint8_t *library_version_hash)
  59. {
  60. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  61. char buf[MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN];
  62. _mav_put_uint16_t(buf, 0, version);
  63. _mav_put_uint16_t(buf, 2, min_version);
  64. _mav_put_uint16_t(buf, 4, max_version);
  65. _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
  66. _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
  67. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  68. #else
  69. mavlink_protocol_version_t packet;
  70. packet.version = version;
  71. packet.min_version = min_version;
  72. packet.max_version = max_version;
  73. mav_array_assign_uint8_t(packet.spec_version_hash, spec_version_hash, 8);
  74. mav_array_assign_uint8_t(packet.library_version_hash, library_version_hash, 8);
  75. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  76. #endif
  77. msg->msgid = MAVLINK_MSG_ID_PROTOCOL_VERSION;
  78. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  79. }
  80. /**
  81. * @brief Pack a protocol_version message
  82. * @param system_id ID of this system
  83. * @param component_id ID of this component (e.g. 200 for IMU)
  84. * @param status MAVLink status structure
  85. * @param msg The MAVLink message to compress the data into
  86. *
  87. * @param version Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc.
  88. * @param min_version Minimum MAVLink version supported
  89. * @param max_version Maximum MAVLink version supported (set to the same value as version by default)
  90. * @param spec_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  91. * @param library_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  92. * @return length of the message in bytes (excluding serial stream start sign)
  93. */
  94. static inline uint16_t mavlink_msg_protocol_version_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  95. uint16_t version, uint16_t min_version, uint16_t max_version, const uint8_t *spec_version_hash, const uint8_t *library_version_hash)
  96. {
  97. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  98. char buf[MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN];
  99. _mav_put_uint16_t(buf, 0, version);
  100. _mav_put_uint16_t(buf, 2, min_version);
  101. _mav_put_uint16_t(buf, 4, max_version);
  102. _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
  103. _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
  104. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  105. #else
  106. mavlink_protocol_version_t packet;
  107. packet.version = version;
  108. packet.min_version = min_version;
  109. packet.max_version = max_version;
  110. mav_array_memcpy(packet.spec_version_hash, spec_version_hash, sizeof(uint8_t)*8);
  111. mav_array_memcpy(packet.library_version_hash, library_version_hash, sizeof(uint8_t)*8);
  112. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  113. #endif
  114. msg->msgid = MAVLINK_MSG_ID_PROTOCOL_VERSION;
  115. #if MAVLINK_CRC_EXTRA
  116. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  117. #else
  118. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  119. #endif
  120. }
  121. /**
  122. * @brief Pack a protocol_version message on a channel
  123. * @param system_id ID of this system
  124. * @param component_id ID of this component (e.g. 200 for IMU)
  125. * @param chan The MAVLink channel this message will be sent over
  126. * @param msg The MAVLink message to compress the data into
  127. * @param version Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc.
  128. * @param min_version Minimum MAVLink version supported
  129. * @param max_version Maximum MAVLink version supported (set to the same value as version by default)
  130. * @param spec_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  131. * @param library_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  132. * @return length of the message in bytes (excluding serial stream start sign)
  133. */
  134. MAVLINK_WIP
  135. static inline uint16_t mavlink_msg_protocol_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  136. mavlink_message_t* msg,
  137. uint16_t version,uint16_t min_version,uint16_t max_version,const uint8_t *spec_version_hash,const uint8_t *library_version_hash)
  138. {
  139. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  140. char buf[MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN];
  141. _mav_put_uint16_t(buf, 0, version);
  142. _mav_put_uint16_t(buf, 2, min_version);
  143. _mav_put_uint16_t(buf, 4, max_version);
  144. _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
  145. _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
  146. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  147. #else
  148. mavlink_protocol_version_t packet;
  149. packet.version = version;
  150. packet.min_version = min_version;
  151. packet.max_version = max_version;
  152. mav_array_assign_uint8_t(packet.spec_version_hash, spec_version_hash, 8);
  153. mav_array_assign_uint8_t(packet.library_version_hash, library_version_hash, 8);
  154. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  155. #endif
  156. msg->msgid = MAVLINK_MSG_ID_PROTOCOL_VERSION;
  157. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  158. }
  159. /**
  160. * @brief Encode a protocol_version struct
  161. *
  162. * @param system_id ID of this system
  163. * @param component_id ID of this component (e.g. 200 for IMU)
  164. * @param msg The MAVLink message to compress the data into
  165. * @param protocol_version C-struct to read the message contents from
  166. */
  167. MAVLINK_WIP
  168. static inline uint16_t mavlink_msg_protocol_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_protocol_version_t* protocol_version)
  169. {
  170. return mavlink_msg_protocol_version_pack(system_id, component_id, msg, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
  171. }
  172. /**
  173. * @brief Encode a protocol_version struct on a channel
  174. *
  175. * @param system_id ID of this system
  176. * @param component_id ID of this component (e.g. 200 for IMU)
  177. * @param chan The MAVLink channel this message will be sent over
  178. * @param msg The MAVLink message to compress the data into
  179. * @param protocol_version C-struct to read the message contents from
  180. */
  181. MAVLINK_WIP
  182. static inline uint16_t mavlink_msg_protocol_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_protocol_version_t* protocol_version)
  183. {
  184. return mavlink_msg_protocol_version_pack_chan(system_id, component_id, chan, msg, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
  185. }
  186. /**
  187. * @brief Encode a protocol_version struct with provided status structure
  188. *
  189. * @param system_id ID of this system
  190. * @param component_id ID of this component (e.g. 200 for IMU)
  191. * @param status MAVLink status structure
  192. * @param msg The MAVLink message to compress the data into
  193. * @param protocol_version C-struct to read the message contents from
  194. */
  195. static inline uint16_t mavlink_msg_protocol_version_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_protocol_version_t* protocol_version)
  196. {
  197. return mavlink_msg_protocol_version_pack_status(system_id, component_id, _status, msg, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
  198. }
  199. /**
  200. * @brief Send a protocol_version message
  201. * @param chan MAVLink channel to send the message
  202. *
  203. * @param version Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc.
  204. * @param min_version Minimum MAVLink version supported
  205. * @param max_version Maximum MAVLink version supported (set to the same value as version by default)
  206. * @param spec_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  207. * @param library_version_hash The first 8 bytes (not characters printed in hex!) of the git hash.
  208. */
  209. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  210. MAVLINK_WIP
  211. static inline void mavlink_msg_protocol_version_send(mavlink_channel_t chan, uint16_t version, uint16_t min_version, uint16_t max_version, const uint8_t *spec_version_hash, const uint8_t *library_version_hash)
  212. {
  213. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  214. char buf[MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN];
  215. _mav_put_uint16_t(buf, 0, version);
  216. _mav_put_uint16_t(buf, 2, min_version);
  217. _mav_put_uint16_t(buf, 4, max_version);
  218. _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
  219. _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
  220. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, buf, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  221. #else
  222. mavlink_protocol_version_t packet;
  223. packet.version = version;
  224. packet.min_version = min_version;
  225. packet.max_version = max_version;
  226. mav_array_assign_uint8_t(packet.spec_version_hash, spec_version_hash, 8);
  227. mav_array_assign_uint8_t(packet.library_version_hash, library_version_hash, 8);
  228. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, (const char *)&packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  229. #endif
  230. }
  231. /**
  232. * @brief Send a protocol_version message
  233. * @param chan MAVLink channel to send the message
  234. * @param struct The MAVLink struct to serialize
  235. */
  236. MAVLINK_WIP
  237. static inline void mavlink_msg_protocol_version_send_struct(mavlink_channel_t chan, const mavlink_protocol_version_t* protocol_version)
  238. {
  239. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  240. mavlink_msg_protocol_version_send(chan, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
  241. #else
  242. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, (const char *)protocol_version, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  243. #endif
  244. }
  245. #if MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  246. /*
  247. This variant of _send() can be used to save stack space by reusing
  248. memory from the receive buffer. The caller provides a
  249. mavlink_message_t which is the size of a full mavlink message. This
  250. is usually the receive buffer for the channel, and allows a reply to an
  251. incoming message with minimum stack space usage.
  252. */
  253. MAVLINK_WIP
  254. static inline void mavlink_msg_protocol_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t version, uint16_t min_version, uint16_t max_version, const uint8_t *spec_version_hash, const uint8_t *library_version_hash)
  255. {
  256. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  257. char *buf = (char *)msgbuf;
  258. _mav_put_uint16_t(buf, 0, version);
  259. _mav_put_uint16_t(buf, 2, min_version);
  260. _mav_put_uint16_t(buf, 4, max_version);
  261. _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
  262. _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
  263. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, buf, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  264. #else
  265. mavlink_protocol_version_t *packet = (mavlink_protocol_version_t *)msgbuf;
  266. packet->version = version;
  267. packet->min_version = min_version;
  268. packet->max_version = max_version;
  269. mav_array_assign_uint8_t(packet->spec_version_hash, spec_version_hash, 8);
  270. mav_array_assign_uint8_t(packet->library_version_hash, library_version_hash, 8);
  271. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, (const char *)packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
  272. #endif
  273. }
  274. #endif
  275. #endif
  276. // MESSAGE PROTOCOL_VERSION UNPACKING
  277. /**
  278. * @brief Get field version from protocol_version message
  279. *
  280. * @return Currently active MAVLink version number * 100: v1.0 is 100, v2.0 is 200, etc.
  281. */
  282. MAVLINK_WIP
  283. static inline uint16_t mavlink_msg_protocol_version_get_version(const mavlink_message_t* msg)
  284. {
  285. return _MAV_RETURN_uint16_t(msg, 0);
  286. }
  287. /**
  288. * @brief Get field min_version from protocol_version message
  289. *
  290. * @return Minimum MAVLink version supported
  291. */
  292. MAVLINK_WIP
  293. static inline uint16_t mavlink_msg_protocol_version_get_min_version(const mavlink_message_t* msg)
  294. {
  295. return _MAV_RETURN_uint16_t(msg, 2);
  296. }
  297. /**
  298. * @brief Get field max_version from protocol_version message
  299. *
  300. * @return Maximum MAVLink version supported (set to the same value as version by default)
  301. */
  302. MAVLINK_WIP
  303. static inline uint16_t mavlink_msg_protocol_version_get_max_version(const mavlink_message_t* msg)
  304. {
  305. return _MAV_RETURN_uint16_t(msg, 4);
  306. }
  307. /**
  308. * @brief Get field spec_version_hash from protocol_version message
  309. *
  310. * @return The first 8 bytes (not characters printed in hex!) of the git hash.
  311. */
  312. MAVLINK_WIP
  313. static inline uint16_t mavlink_msg_protocol_version_get_spec_version_hash(const mavlink_message_t* msg, uint8_t *spec_version_hash)
  314. {
  315. return _MAV_RETURN_uint8_t_array(msg, spec_version_hash, 8, 6);
  316. }
  317. /**
  318. * @brief Get field library_version_hash from protocol_version message
  319. *
  320. * @return The first 8 bytes (not characters printed in hex!) of the git hash.
  321. */
  322. MAVLINK_WIP
  323. static inline uint16_t mavlink_msg_protocol_version_get_library_version_hash(const mavlink_message_t* msg, uint8_t *library_version_hash)
  324. {
  325. return _MAV_RETURN_uint8_t_array(msg, library_version_hash, 8, 14);
  326. }
  327. /**
  328. * @brief Decode a protocol_version message into a struct
  329. *
  330. * @param msg The message to decode
  331. * @param protocol_version C-struct to decode the message contents into
  332. */
  333. MAVLINK_WIP
  334. static inline void mavlink_msg_protocol_version_decode(const mavlink_message_t* msg, mavlink_protocol_version_t* protocol_version)
  335. {
  336. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  337. protocol_version->version = mavlink_msg_protocol_version_get_version(msg);
  338. protocol_version->min_version = mavlink_msg_protocol_version_get_min_version(msg);
  339. protocol_version->max_version = mavlink_msg_protocol_version_get_max_version(msg);
  340. mavlink_msg_protocol_version_get_spec_version_hash(msg, protocol_version->spec_version_hash);
  341. mavlink_msg_protocol_version_get_library_version_hash(msg, protocol_version->library_version_hash);
  342. #else
  343. uint8_t len = msg->len < MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN? msg->len : MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN;
  344. memset(protocol_version, 0, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
  345. memcpy(protocol_version, _MAV_PAYLOAD(msg), len);
  346. #endif
  347. }