1 // MESSAGE AUTOPILOT_VERSION PACKING
3 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148
5 typedef struct __mavlink_autopilot_version_t
7 uint64_t capabilities
; ///< bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
8 uint64_t uid
; ///< UID if provided by hardware
9 uint32_t flight_sw_version
; ///< Firmware version number
10 uint32_t middleware_sw_version
; ///< Middleware version number
11 uint32_t os_sw_version
; ///< Operating system version number
12 uint32_t board_version
; ///< HW / board version (last 8 bytes should be silicon ID, if any)
13 uint16_t vendor_id
; ///< ID of the board vendor
14 uint16_t product_id
; ///< ID of the product
15 uint8_t flight_custom_version
[8]; ///< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
16 uint8_t middleware_custom_version
[8]; ///< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
17 uint8_t os_custom_version
[8]; ///< Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
18 } mavlink_autopilot_version_t
;
20 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 60
21 #define MAVLINK_MSG_ID_148_LEN 60
23 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178
24 #define MAVLINK_MSG_ID_148_CRC 178
26 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_FLIGHT_CUSTOM_VERSION_LEN 8
27 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8
28 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8
30 #define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
31 "AUTOPILOT_VERSION", \
33 { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
34 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
35 { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
36 { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
37 { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
38 { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
39 { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
40 { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
41 { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
42 { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
43 { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
49 * @brief Pack a autopilot_version message
50 * @param system_id ID of this system
51 * @param component_id ID of this component (e.g. 200 for IMU)
52 * @param msg The MAVLink message to compress the data into
54 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
55 * @param flight_sw_version Firmware version number
56 * @param middleware_sw_version Middleware version number
57 * @param os_sw_version Operating system version number
58 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
59 * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
60 * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
61 * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
62 * @param vendor_id ID of the board vendor
63 * @param product_id ID of the product
64 * @param uid UID if provided by hardware
65 * @return length of the message in bytes (excluding serial stream start sign)
67 static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
68 uint64_t capabilities
, uint32_t flight_sw_version
, uint32_t middleware_sw_version
, uint32_t os_sw_version
, uint32_t board_version
, const uint8_t *flight_custom_version
, const uint8_t *middleware_custom_version
, const uint8_t *os_custom_version
, uint16_t vendor_id
, uint16_t product_id
, uint64_t uid
)
70 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
71 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
72 _mav_put_uint64_t(buf
, 0, capabilities
);
73 _mav_put_uint64_t(buf
, 8, uid
);
74 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
75 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
76 _mav_put_uint32_t(buf
, 24, os_sw_version
);
77 _mav_put_uint32_t(buf
, 28, board_version
);
78 _mav_put_uint16_t(buf
, 32, vendor_id
);
79 _mav_put_uint16_t(buf
, 34, product_id
);
80 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
81 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
82 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
83 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
85 mavlink_autopilot_version_t packet
;
86 packet
.capabilities
= capabilities
;
88 packet
.flight_sw_version
= flight_sw_version
;
89 packet
.middleware_sw_version
= middleware_sw_version
;
90 packet
.os_sw_version
= os_sw_version
;
91 packet
.board_version
= board_version
;
92 packet
.vendor_id
= vendor_id
;
93 packet
.product_id
= product_id
;
94 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
95 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
96 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
97 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
100 msg
->msgid
= MAVLINK_MSG_ID_AUTOPILOT_VERSION
;
101 #if MAVLINK_CRC_EXTRA
102 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
104 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
109 * @brief Pack a autopilot_version message on a channel
110 * @param system_id ID of this system
111 * @param component_id ID of this component (e.g. 200 for IMU)
112 * @param chan The MAVLink channel this message will be sent over
113 * @param msg The MAVLink message to compress the data into
114 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
115 * @param flight_sw_version Firmware version number
116 * @param middleware_sw_version Middleware version number
117 * @param os_sw_version Operating system version number
118 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
119 * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
120 * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
121 * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
122 * @param vendor_id ID of the board vendor
123 * @param product_id ID of the product
124 * @param uid UID if provided by hardware
125 * @return length of the message in bytes (excluding serial stream start sign)
127 static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
128 mavlink_message_t
* msg
,
129 uint64_t capabilities
,uint32_t flight_sw_version
,uint32_t middleware_sw_version
,uint32_t os_sw_version
,uint32_t board_version
,const uint8_t *flight_custom_version
,const uint8_t *middleware_custom_version
,const uint8_t *os_custom_version
,uint16_t vendor_id
,uint16_t product_id
,uint64_t uid
)
131 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
132 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
133 _mav_put_uint64_t(buf
, 0, capabilities
);
134 _mav_put_uint64_t(buf
, 8, uid
);
135 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
136 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
137 _mav_put_uint32_t(buf
, 24, os_sw_version
);
138 _mav_put_uint32_t(buf
, 28, board_version
);
139 _mav_put_uint16_t(buf
, 32, vendor_id
);
140 _mav_put_uint16_t(buf
, 34, product_id
);
141 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
142 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
143 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
144 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
146 mavlink_autopilot_version_t packet
;
147 packet
.capabilities
= capabilities
;
149 packet
.flight_sw_version
= flight_sw_version
;
150 packet
.middleware_sw_version
= middleware_sw_version
;
151 packet
.os_sw_version
= os_sw_version
;
152 packet
.board_version
= board_version
;
153 packet
.vendor_id
= vendor_id
;
154 packet
.product_id
= product_id
;
155 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
156 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
157 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
158 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
161 msg
->msgid
= MAVLINK_MSG_ID_AUTOPILOT_VERSION
;
162 #if MAVLINK_CRC_EXTRA
163 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
165 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
170 * @brief Encode a autopilot_version struct
172 * @param system_id ID of this system
173 * @param component_id ID of this component (e.g. 200 for IMU)
174 * @param msg The MAVLink message to compress the data into
175 * @param autopilot_version C-struct to read the message contents from
177 static inline uint16_t mavlink_msg_autopilot_version_encode(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_autopilot_version_t
* autopilot_version
)
179 return mavlink_msg_autopilot_version_pack(system_id
, component_id
, msg
, autopilot_version
->capabilities
, autopilot_version
->flight_sw_version
, autopilot_version
->middleware_sw_version
, autopilot_version
->os_sw_version
, autopilot_version
->board_version
, autopilot_version
->flight_custom_version
, autopilot_version
->middleware_custom_version
, autopilot_version
->os_custom_version
, autopilot_version
->vendor_id
, autopilot_version
->product_id
, autopilot_version
->uid
);
183 * @brief Encode a autopilot_version struct on a channel
185 * @param system_id ID of this system
186 * @param component_id ID of this component (e.g. 200 for IMU)
187 * @param chan The MAVLink channel this message will be sent over
188 * @param msg The MAVLink message to compress the data into
189 * @param autopilot_version C-struct to read the message contents from
191 static inline uint16_t mavlink_msg_autopilot_version_encode_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
, mavlink_message_t
* msg
, const mavlink_autopilot_version_t
* autopilot_version
)
193 return mavlink_msg_autopilot_version_pack_chan(system_id
, component_id
, chan
, msg
, autopilot_version
->capabilities
, autopilot_version
->flight_sw_version
, autopilot_version
->middleware_sw_version
, autopilot_version
->os_sw_version
, autopilot_version
->board_version
, autopilot_version
->flight_custom_version
, autopilot_version
->middleware_custom_version
, autopilot_version
->os_custom_version
, autopilot_version
->vendor_id
, autopilot_version
->product_id
, autopilot_version
->uid
);
197 * @brief Send a autopilot_version message
198 * @param chan MAVLink channel to send the message
200 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
201 * @param flight_sw_version Firmware version number
202 * @param middleware_sw_version Middleware version number
203 * @param os_sw_version Operating system version number
204 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
205 * @param flight_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
206 * @param middleware_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
207 * @param os_custom_version Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
208 * @param vendor_id ID of the board vendor
209 * @param product_id ID of the product
210 * @param uid UID if provided by hardware
212 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
214 static inline void mavlink_msg_autopilot_version_send(mavlink_channel_t chan
, uint64_t capabilities
, uint32_t flight_sw_version
, uint32_t middleware_sw_version
, uint32_t os_sw_version
, uint32_t board_version
, const uint8_t *flight_custom_version
, const uint8_t *middleware_custom_version
, const uint8_t *os_custom_version
, uint16_t vendor_id
, uint16_t product_id
, uint64_t uid
)
216 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
217 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
218 _mav_put_uint64_t(buf
, 0, capabilities
);
219 _mav_put_uint64_t(buf
, 8, uid
);
220 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
221 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
222 _mav_put_uint32_t(buf
, 24, os_sw_version
);
223 _mav_put_uint32_t(buf
, 28, board_version
);
224 _mav_put_uint16_t(buf
, 32, vendor_id
);
225 _mav_put_uint16_t(buf
, 34, product_id
);
226 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
227 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
228 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
229 #if MAVLINK_CRC_EXTRA
230 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
232 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
235 mavlink_autopilot_version_t packet
;
236 packet
.capabilities
= capabilities
;
238 packet
.flight_sw_version
= flight_sw_version
;
239 packet
.middleware_sw_version
= middleware_sw_version
;
240 packet
.os_sw_version
= os_sw_version
;
241 packet
.board_version
= board_version
;
242 packet
.vendor_id
= vendor_id
;
243 packet
.product_id
= product_id
;
244 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
245 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
246 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
247 #if MAVLINK_CRC_EXTRA
248 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, (const char *)&packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
250 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, (const char *)&packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
255 #if MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
257 This varient of _send() can be used to save stack space by re-using
258 memory from the receive buffer. The caller provides a
259 mavlink_message_t which is the size of a full mavlink message. This
260 is usually the receive buffer for the channel, and allows a reply to an
261 incoming message with minimum stack space usage.
263 static inline void mavlink_msg_autopilot_version_send_buf(mavlink_message_t
*msgbuf
, mavlink_channel_t chan
, uint64_t capabilities
, uint32_t flight_sw_version
, uint32_t middleware_sw_version
, uint32_t os_sw_version
, uint32_t board_version
, const uint8_t *flight_custom_version
, const uint8_t *middleware_custom_version
, const uint8_t *os_custom_version
, uint16_t vendor_id
, uint16_t product_id
, uint64_t uid
)
265 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
266 char *buf
= (char *)msgbuf
;
267 _mav_put_uint64_t(buf
, 0, capabilities
);
268 _mav_put_uint64_t(buf
, 8, uid
);
269 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
270 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
271 _mav_put_uint32_t(buf
, 24, os_sw_version
);
272 _mav_put_uint32_t(buf
, 28, board_version
);
273 _mav_put_uint16_t(buf
, 32, vendor_id
);
274 _mav_put_uint16_t(buf
, 34, product_id
);
275 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
276 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
277 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
278 #if MAVLINK_CRC_EXTRA
279 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
281 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
284 mavlink_autopilot_version_t
*packet
= (mavlink_autopilot_version_t
*)msgbuf
;
285 packet
->capabilities
= capabilities
;
287 packet
->flight_sw_version
= flight_sw_version
;
288 packet
->middleware_sw_version
= middleware_sw_version
;
289 packet
->os_sw_version
= os_sw_version
;
290 packet
->board_version
= board_version
;
291 packet
->vendor_id
= vendor_id
;
292 packet
->product_id
= product_id
;
293 mav_array_memcpy(packet
->flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
294 mav_array_memcpy(packet
->middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
295 mav_array_memcpy(packet
->os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
296 #if MAVLINK_CRC_EXTRA
297 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, (const char *)packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
299 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, (const char *)packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
307 // MESSAGE AUTOPILOT_VERSION UNPACKING
311 * @brief Get field capabilities from autopilot_version message
313 * @return bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
315 static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t
* msg
)
317 return _MAV_RETURN_uint64_t(msg
, 0);
321 * @brief Get field flight_sw_version from autopilot_version message
323 * @return Firmware version number
325 static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t
* msg
)
327 return _MAV_RETURN_uint32_t(msg
, 16);
331 * @brief Get field middleware_sw_version from autopilot_version message
333 * @return Middleware version number
335 static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t
* msg
)
337 return _MAV_RETURN_uint32_t(msg
, 20);
341 * @brief Get field os_sw_version from autopilot_version message
343 * @return Operating system version number
345 static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t
* msg
)
347 return _MAV_RETURN_uint32_t(msg
, 24);
351 * @brief Get field board_version from autopilot_version message
353 * @return HW / board version (last 8 bytes should be silicon ID, if any)
355 static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t
* msg
)
357 return _MAV_RETURN_uint32_t(msg
, 28);
361 * @brief Get field flight_custom_version from autopilot_version message
363 * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
365 static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t
* msg
, uint8_t *flight_custom_version
)
367 return _MAV_RETURN_uint8_t_array(msg
, flight_custom_version
, 8, 36);
371 * @brief Get field middleware_custom_version from autopilot_version message
373 * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
375 static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t
* msg
, uint8_t *middleware_custom_version
)
377 return _MAV_RETURN_uint8_t_array(msg
, middleware_custom_version
, 8, 44);
381 * @brief Get field os_custom_version from autopilot_version message
383 * @return Custom version field, commonly the first 8 bytes of the git hash. This is not an unique identifier, but should allow to identify the commit using the main version number even for very large code bases.
385 static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t
* msg
, uint8_t *os_custom_version
)
387 return _MAV_RETURN_uint8_t_array(msg
, os_custom_version
, 8, 52);
391 * @brief Get field vendor_id from autopilot_version message
393 * @return ID of the board vendor
395 static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t
* msg
)
397 return _MAV_RETURN_uint16_t(msg
, 32);
401 * @brief Get field product_id from autopilot_version message
403 * @return ID of the product
405 static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t
* msg
)
407 return _MAV_RETURN_uint16_t(msg
, 34);
411 * @brief Get field uid from autopilot_version message
413 * @return UID if provided by hardware
415 static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t
* msg
)
417 return _MAV_RETURN_uint64_t(msg
, 8);
421 * @brief Decode a autopilot_version message into a struct
423 * @param msg The message to decode
424 * @param autopilot_version C-struct to decode the message contents into
426 static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t
* msg
, mavlink_autopilot_version_t
* autopilot_version
)
428 #if MAVLINK_NEED_BYTE_SWAP
429 autopilot_version
->capabilities
= mavlink_msg_autopilot_version_get_capabilities(msg
);
430 autopilot_version
->uid
= mavlink_msg_autopilot_version_get_uid(msg
);
431 autopilot_version
->flight_sw_version
= mavlink_msg_autopilot_version_get_flight_sw_version(msg
);
432 autopilot_version
->middleware_sw_version
= mavlink_msg_autopilot_version_get_middleware_sw_version(msg
);
433 autopilot_version
->os_sw_version
= mavlink_msg_autopilot_version_get_os_sw_version(msg
);
434 autopilot_version
->board_version
= mavlink_msg_autopilot_version_get_board_version(msg
);
435 autopilot_version
->vendor_id
= mavlink_msg_autopilot_version_get_vendor_id(msg
);
436 autopilot_version
->product_id
= mavlink_msg_autopilot_version_get_product_id(msg
);
437 mavlink_msg_autopilot_version_get_flight_custom_version(msg
, autopilot_version
->flight_custom_version
);
438 mavlink_msg_autopilot_version_get_middleware_custom_version(msg
, autopilot_version
->middleware_custom_version
);
439 mavlink_msg_autopilot_version_get_os_custom_version(msg
, autopilot_version
->os_custom_version
);
441 memcpy(autopilot_version
, _MAV_PAYLOAD(msg
), MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);