2 // MESSAGE AUTOPILOT_VERSION PACKING
4 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148
7 typedef struct __mavlink_autopilot_version_t
{
8 uint64_t capabilities
; /*< bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)*/
9 uint64_t uid
; /*< UID if provided by hardware*/
10 uint32_t flight_sw_version
; /*< Firmware version number*/
11 uint32_t middleware_sw_version
; /*< Middleware version number*/
12 uint32_t os_sw_version
; /*< Operating system version number*/
13 uint32_t board_version
; /*< HW / board version (last 8 bytes should be silicon ID, if any)*/
14 uint16_t vendor_id
; /*< ID of the board vendor*/
15 uint16_t product_id
; /*< ID of the product*/
16 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.*/
17 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.*/
18 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.*/
19 }) mavlink_autopilot_version_t
;
21 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 60
22 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60
23 #define MAVLINK_MSG_ID_148_LEN 60
24 #define MAVLINK_MSG_ID_148_MIN_LEN 60
26 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178
27 #define MAVLINK_MSG_ID_148_CRC 178
29 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_FLIGHT_CUSTOM_VERSION_LEN 8
30 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8
31 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8
33 #if MAVLINK_COMMAND_24BIT
34 #define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
36 "AUTOPILOT_VERSION", \
38 { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
39 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
40 { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
41 { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
42 { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
43 { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
44 { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
45 { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
46 { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
47 { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
48 { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
52 #define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
53 "AUTOPILOT_VERSION", \
55 { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
56 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
57 { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
58 { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
59 { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
60 { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
61 { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
62 { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
63 { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
64 { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
65 { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
71 * @brief Pack a autopilot_version message
72 * @param system_id ID of this system
73 * @param component_id ID of this component (e.g. 200 for IMU)
74 * @param msg The MAVLink message to compress the data into
76 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
77 * @param flight_sw_version Firmware version number
78 * @param middleware_sw_version Middleware version number
79 * @param os_sw_version Operating system version number
80 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
81 * @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.
82 * @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.
83 * @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.
84 * @param vendor_id ID of the board vendor
85 * @param product_id ID of the product
86 * @param uid UID if provided by hardware
87 * @return length of the message in bytes (excluding serial stream start sign)
89 static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
90 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
)
92 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
93 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
94 _mav_put_uint64_t(buf
, 0, capabilities
);
95 _mav_put_uint64_t(buf
, 8, uid
);
96 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
97 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
98 _mav_put_uint32_t(buf
, 24, os_sw_version
);
99 _mav_put_uint32_t(buf
, 28, board_version
);
100 _mav_put_uint16_t(buf
, 32, vendor_id
);
101 _mav_put_uint16_t(buf
, 34, product_id
);
102 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
103 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
104 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
105 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
107 mavlink_autopilot_version_t packet
;
108 packet
.capabilities
= capabilities
;
110 packet
.flight_sw_version
= flight_sw_version
;
111 packet
.middleware_sw_version
= middleware_sw_version
;
112 packet
.os_sw_version
= os_sw_version
;
113 packet
.board_version
= board_version
;
114 packet
.vendor_id
= vendor_id
;
115 packet
.product_id
= product_id
;
116 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
117 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
118 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
119 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
122 msg
->msgid
= MAVLINK_MSG_ID_AUTOPILOT_VERSION
;
123 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
127 * @brief Pack a autopilot_version message on a channel
128 * @param system_id ID of this system
129 * @param component_id ID of this component (e.g. 200 for IMU)
130 * @param chan The MAVLink channel this message will be sent over
131 * @param msg The MAVLink message to compress the data into
132 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
133 * @param flight_sw_version Firmware version number
134 * @param middleware_sw_version Middleware version number
135 * @param os_sw_version Operating system version number
136 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
137 * @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.
138 * @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.
139 * @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.
140 * @param vendor_id ID of the board vendor
141 * @param product_id ID of the product
142 * @param uid UID if provided by hardware
143 * @return length of the message in bytes (excluding serial stream start sign)
145 static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
146 mavlink_message_t
* msg
,
147 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
)
149 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
150 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
151 _mav_put_uint64_t(buf
, 0, capabilities
);
152 _mav_put_uint64_t(buf
, 8, uid
);
153 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
154 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
155 _mav_put_uint32_t(buf
, 24, os_sw_version
);
156 _mav_put_uint32_t(buf
, 28, board_version
);
157 _mav_put_uint16_t(buf
, 32, vendor_id
);
158 _mav_put_uint16_t(buf
, 34, product_id
);
159 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
160 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
161 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
162 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
164 mavlink_autopilot_version_t packet
;
165 packet
.capabilities
= capabilities
;
167 packet
.flight_sw_version
= flight_sw_version
;
168 packet
.middleware_sw_version
= middleware_sw_version
;
169 packet
.os_sw_version
= os_sw_version
;
170 packet
.board_version
= board_version
;
171 packet
.vendor_id
= vendor_id
;
172 packet
.product_id
= product_id
;
173 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
174 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
175 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
176 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
179 msg
->msgid
= MAVLINK_MSG_ID_AUTOPILOT_VERSION
;
180 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
184 * @brief Encode a autopilot_version struct
186 * @param system_id ID of this system
187 * @param component_id ID of this component (e.g. 200 for IMU)
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(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_autopilot_version_t
* autopilot_version
)
193 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
);
197 * @brief Encode a autopilot_version struct on a channel
199 * @param system_id ID of this system
200 * @param component_id ID of this component (e.g. 200 for IMU)
201 * @param chan The MAVLink channel this message will be sent over
202 * @param msg The MAVLink message to compress the data into
203 * @param autopilot_version C-struct to read the message contents from
205 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
)
207 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
);
211 * @brief Send a autopilot_version message
212 * @param chan MAVLink channel to send the message
214 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
215 * @param flight_sw_version Firmware version number
216 * @param middleware_sw_version Middleware version number
217 * @param os_sw_version Operating system version number
218 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
219 * @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.
220 * @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.
221 * @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.
222 * @param vendor_id ID of the board vendor
223 * @param product_id ID of the product
224 * @param uid UID if provided by hardware
226 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
228 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
)
230 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
231 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
232 _mav_put_uint64_t(buf
, 0, capabilities
);
233 _mav_put_uint64_t(buf
, 8, uid
);
234 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
235 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
236 _mav_put_uint32_t(buf
, 24, os_sw_version
);
237 _mav_put_uint32_t(buf
, 28, board_version
);
238 _mav_put_uint16_t(buf
, 32, vendor_id
);
239 _mav_put_uint16_t(buf
, 34, product_id
);
240 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
241 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
242 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
243 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
245 mavlink_autopilot_version_t packet
;
246 packet
.capabilities
= capabilities
;
248 packet
.flight_sw_version
= flight_sw_version
;
249 packet
.middleware_sw_version
= middleware_sw_version
;
250 packet
.os_sw_version
= os_sw_version
;
251 packet
.board_version
= board_version
;
252 packet
.vendor_id
= vendor_id
;
253 packet
.product_id
= product_id
;
254 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
255 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
256 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
257 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, (const char *)&packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
262 * @brief Send a autopilot_version message
263 * @param chan MAVLink channel to send the message
264 * @param struct The MAVLink struct to serialize
266 static inline void mavlink_msg_autopilot_version_send_struct(mavlink_channel_t chan
, const mavlink_autopilot_version_t
* autopilot_version
)
268 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
269 mavlink_msg_autopilot_version_send(chan
, 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
);
271 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, (const char *)autopilot_version
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
275 #if MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
277 This varient of _send() can be used to save stack space by re-using
278 memory from the receive buffer. The caller provides a
279 mavlink_message_t which is the size of a full mavlink message. This
280 is usually the receive buffer for the channel, and allows a reply to an
281 incoming message with minimum stack space usage.
283 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
)
285 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
286 char *buf
= (char *)msgbuf
;
287 _mav_put_uint64_t(buf
, 0, capabilities
);
288 _mav_put_uint64_t(buf
, 8, uid
);
289 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
290 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
291 _mav_put_uint32_t(buf
, 24, os_sw_version
);
292 _mav_put_uint32_t(buf
, 28, board_version
);
293 _mav_put_uint16_t(buf
, 32, vendor_id
);
294 _mav_put_uint16_t(buf
, 34, product_id
);
295 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
296 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
297 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
298 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
300 mavlink_autopilot_version_t
*packet
= (mavlink_autopilot_version_t
*)msgbuf
;
301 packet
->capabilities
= capabilities
;
303 packet
->flight_sw_version
= flight_sw_version
;
304 packet
->middleware_sw_version
= middleware_sw_version
;
305 packet
->os_sw_version
= os_sw_version
;
306 packet
->board_version
= board_version
;
307 packet
->vendor_id
= vendor_id
;
308 packet
->product_id
= product_id
;
309 mav_array_memcpy(packet
->flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
310 mav_array_memcpy(packet
->middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
311 mav_array_memcpy(packet
->os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
312 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_AUTOPILOT_VERSION
, (const char *)packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC
);
319 // MESSAGE AUTOPILOT_VERSION UNPACKING
323 * @brief Get field capabilities from autopilot_version message
325 * @return bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
327 static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t
* msg
)
329 return _MAV_RETURN_uint64_t(msg
, 0);
333 * @brief Get field flight_sw_version from autopilot_version message
335 * @return Firmware version number
337 static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t
* msg
)
339 return _MAV_RETURN_uint32_t(msg
, 16);
343 * @brief Get field middleware_sw_version from autopilot_version message
345 * @return Middleware version number
347 static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t
* msg
)
349 return _MAV_RETURN_uint32_t(msg
, 20);
353 * @brief Get field os_sw_version from autopilot_version message
355 * @return Operating system version number
357 static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t
* msg
)
359 return _MAV_RETURN_uint32_t(msg
, 24);
363 * @brief Get field board_version from autopilot_version message
365 * @return HW / board version (last 8 bytes should be silicon ID, if any)
367 static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t
* msg
)
369 return _MAV_RETURN_uint32_t(msg
, 28);
373 * @brief Get field flight_custom_version from autopilot_version message
375 * @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.
377 static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t
* msg
, uint8_t *flight_custom_version
)
379 return _MAV_RETURN_uint8_t_array(msg
, flight_custom_version
, 8, 36);
383 * @brief Get field middleware_custom_version from autopilot_version message
385 * @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.
387 static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t
* msg
, uint8_t *middleware_custom_version
)
389 return _MAV_RETURN_uint8_t_array(msg
, middleware_custom_version
, 8, 44);
393 * @brief Get field os_custom_version from autopilot_version message
395 * @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.
397 static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t
* msg
, uint8_t *os_custom_version
)
399 return _MAV_RETURN_uint8_t_array(msg
, os_custom_version
, 8, 52);
403 * @brief Get field vendor_id from autopilot_version message
405 * @return ID of the board vendor
407 static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t
* msg
)
409 return _MAV_RETURN_uint16_t(msg
, 32);
413 * @brief Get field product_id from autopilot_version message
415 * @return ID of the product
417 static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t
* msg
)
419 return _MAV_RETURN_uint16_t(msg
, 34);
423 * @brief Get field uid from autopilot_version message
425 * @return UID if provided by hardware
427 static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t
* msg
)
429 return _MAV_RETURN_uint64_t(msg
, 8);
433 * @brief Decode a autopilot_version message into a struct
435 * @param msg The message to decode
436 * @param autopilot_version C-struct to decode the message contents into
438 static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t
* msg
, mavlink_autopilot_version_t
* autopilot_version
)
440 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
441 autopilot_version
->capabilities
= mavlink_msg_autopilot_version_get_capabilities(msg
);
442 autopilot_version
->uid
= mavlink_msg_autopilot_version_get_uid(msg
);
443 autopilot_version
->flight_sw_version
= mavlink_msg_autopilot_version_get_flight_sw_version(msg
);
444 autopilot_version
->middleware_sw_version
= mavlink_msg_autopilot_version_get_middleware_sw_version(msg
);
445 autopilot_version
->os_sw_version
= mavlink_msg_autopilot_version_get_os_sw_version(msg
);
446 autopilot_version
->board_version
= mavlink_msg_autopilot_version_get_board_version(msg
);
447 autopilot_version
->vendor_id
= mavlink_msg_autopilot_version_get_vendor_id(msg
);
448 autopilot_version
->product_id
= mavlink_msg_autopilot_version_get_product_id(msg
);
449 mavlink_msg_autopilot_version_get_flight_custom_version(msg
, autopilot_version
->flight_custom_version
);
450 mavlink_msg_autopilot_version_get_middleware_custom_version(msg
, autopilot_version
->middleware_custom_version
);
451 mavlink_msg_autopilot_version_get_os_custom_version(msg
, autopilot_version
->os_custom_version
);
453 uint8_t len
= msg
->len
< MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
? msg
->len
: MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
;
454 memset(autopilot_version
, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
455 memcpy(autopilot_version
, _MAV_PAYLOAD(msg
), len
);