2 // MESSAGE AUTOPILOT_VERSION PACKING
4 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148
7 typedef struct __mavlink_autopilot_version_t
{
8 uint64_t capabilities
; /*< Bitmap of capabilities*/
9 uint64_t uid
; /*< UID if provided by hardware (see uid2)*/
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 uint8_t uid2
[18]; /*< UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)*/
20 } mavlink_autopilot_version_t
;
22 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 78
23 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60
24 #define MAVLINK_MSG_ID_148_LEN 78
25 #define MAVLINK_MSG_ID_148_MIN_LEN 60
27 #define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178
28 #define MAVLINK_MSG_ID_148_CRC 178
30 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_FLIGHT_CUSTOM_VERSION_LEN 8
31 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8
32 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8
33 #define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_UID2_LEN 18
35 #if MAVLINK_COMMAND_24BIT
36 #define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
38 "AUTOPILOT_VERSION", \
40 { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
41 { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
42 { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
43 { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
44 { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
45 { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
46 { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
47 { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
48 { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
49 { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
50 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
51 { "uid2", NULL, MAVLINK_TYPE_UINT8_T, 18, 60, offsetof(mavlink_autopilot_version_t, uid2) }, \
55 #define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
56 "AUTOPILOT_VERSION", \
58 { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
59 { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
60 { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
61 { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
62 { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
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) }, \
66 { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
67 { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
68 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
69 { "uid2", NULL, MAVLINK_TYPE_UINT8_T, 18, 60, offsetof(mavlink_autopilot_version_t, uid2) }, \
75 * @brief Pack a autopilot_version message
76 * @param system_id ID of this system
77 * @param component_id ID of this component (e.g. 200 for IMU)
78 * @param msg The MAVLink message to compress the data into
80 * @param capabilities Bitmap of capabilities
81 * @param flight_sw_version Firmware version number
82 * @param middleware_sw_version Middleware version number
83 * @param os_sw_version Operating system version number
84 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
85 * @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.
86 * @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.
87 * @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.
88 * @param vendor_id ID of the board vendor
89 * @param product_id ID of the product
90 * @param uid UID if provided by hardware (see uid2)
91 * @param uid2 UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
92 * @return length of the message in bytes (excluding serial stream start sign)
94 static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
95 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
, const uint8_t *uid2
)
97 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
98 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
99 _mav_put_uint64_t(buf
, 0, capabilities
);
100 _mav_put_uint64_t(buf
, 8, uid
);
101 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
102 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
103 _mav_put_uint32_t(buf
, 24, os_sw_version
);
104 _mav_put_uint32_t(buf
, 28, board_version
);
105 _mav_put_uint16_t(buf
, 32, vendor_id
);
106 _mav_put_uint16_t(buf
, 34, product_id
);
107 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
108 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
109 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
110 _mav_put_uint8_t_array(buf
, 60, uid2
, 18);
111 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
113 mavlink_autopilot_version_t packet
;
114 packet
.capabilities
= capabilities
;
116 packet
.flight_sw_version
= flight_sw_version
;
117 packet
.middleware_sw_version
= middleware_sw_version
;
118 packet
.os_sw_version
= os_sw_version
;
119 packet
.board_version
= board_version
;
120 packet
.vendor_id
= vendor_id
;
121 packet
.product_id
= product_id
;
122 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
123 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
124 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
125 mav_array_memcpy(packet
.uid2
, uid2
, sizeof(uint8_t)*18);
126 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
129 msg
->msgid
= MAVLINK_MSG_ID_AUTOPILOT_VERSION
;
130 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
);
134 * @brief Pack a autopilot_version message on a channel
135 * @param system_id ID of this system
136 * @param component_id ID of this component (e.g. 200 for IMU)
137 * @param chan The MAVLink channel this message will be sent over
138 * @param msg The MAVLink message to compress the data into
139 * @param capabilities Bitmap of capabilities
140 * @param flight_sw_version Firmware version number
141 * @param middleware_sw_version Middleware version number
142 * @param os_sw_version Operating system version number
143 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
144 * @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.
145 * @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.
146 * @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.
147 * @param vendor_id ID of the board vendor
148 * @param product_id ID of the product
149 * @param uid UID if provided by hardware (see uid2)
150 * @param uid2 UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
151 * @return length of the message in bytes (excluding serial stream start sign)
153 static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
154 mavlink_message_t
* msg
,
155 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
,const uint8_t *uid2
)
157 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
158 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
159 _mav_put_uint64_t(buf
, 0, capabilities
);
160 _mav_put_uint64_t(buf
, 8, uid
);
161 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
162 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
163 _mav_put_uint32_t(buf
, 24, os_sw_version
);
164 _mav_put_uint32_t(buf
, 28, board_version
);
165 _mav_put_uint16_t(buf
, 32, vendor_id
);
166 _mav_put_uint16_t(buf
, 34, product_id
);
167 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
168 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
169 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
170 _mav_put_uint8_t_array(buf
, 60, uid2
, 18);
171 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
173 mavlink_autopilot_version_t packet
;
174 packet
.capabilities
= capabilities
;
176 packet
.flight_sw_version
= flight_sw_version
;
177 packet
.middleware_sw_version
= middleware_sw_version
;
178 packet
.os_sw_version
= os_sw_version
;
179 packet
.board_version
= board_version
;
180 packet
.vendor_id
= vendor_id
;
181 packet
.product_id
= product_id
;
182 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
183 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
184 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
185 mav_array_memcpy(packet
.uid2
, uid2
, sizeof(uint8_t)*18);
186 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
189 msg
->msgid
= MAVLINK_MSG_ID_AUTOPILOT_VERSION
;
190 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
);
194 * @brief Encode a autopilot_version struct
196 * @param system_id ID of this system
197 * @param component_id ID of this component (e.g. 200 for IMU)
198 * @param msg The MAVLink message to compress the data into
199 * @param autopilot_version C-struct to read the message contents from
201 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
)
203 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
, autopilot_version
->uid2
);
207 * @brief Encode a autopilot_version struct on a channel
209 * @param system_id ID of this system
210 * @param component_id ID of this component (e.g. 200 for IMU)
211 * @param chan The MAVLink channel this message will be sent over
212 * @param msg The MAVLink message to compress the data into
213 * @param autopilot_version C-struct to read the message contents from
215 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
)
217 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
, autopilot_version
->uid2
);
221 * @brief Send a autopilot_version message
222 * @param chan MAVLink channel to send the message
224 * @param capabilities Bitmap of capabilities
225 * @param flight_sw_version Firmware version number
226 * @param middleware_sw_version Middleware version number
227 * @param os_sw_version Operating system version number
228 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
229 * @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.
230 * @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.
231 * @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.
232 * @param vendor_id ID of the board vendor
233 * @param product_id ID of the product
234 * @param uid UID if provided by hardware (see uid2)
235 * @param uid2 UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
237 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
239 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
, const uint8_t *uid2
)
241 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
242 char buf
[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
];
243 _mav_put_uint64_t(buf
, 0, capabilities
);
244 _mav_put_uint64_t(buf
, 8, uid
);
245 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
246 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
247 _mav_put_uint32_t(buf
, 24, os_sw_version
);
248 _mav_put_uint32_t(buf
, 28, board_version
);
249 _mav_put_uint16_t(buf
, 32, vendor_id
);
250 _mav_put_uint16_t(buf
, 34, product_id
);
251 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
252 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
253 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
254 _mav_put_uint8_t_array(buf
, 60, uid2
, 18);
255 _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
);
257 mavlink_autopilot_version_t packet
;
258 packet
.capabilities
= capabilities
;
260 packet
.flight_sw_version
= flight_sw_version
;
261 packet
.middleware_sw_version
= middleware_sw_version
;
262 packet
.os_sw_version
= os_sw_version
;
263 packet
.board_version
= board_version
;
264 packet
.vendor_id
= vendor_id
;
265 packet
.product_id
= product_id
;
266 mav_array_memcpy(packet
.flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
267 mav_array_memcpy(packet
.middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
268 mav_array_memcpy(packet
.os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
269 mav_array_memcpy(packet
.uid2
, uid2
, sizeof(uint8_t)*18);
270 _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
);
275 * @brief Send a autopilot_version message
276 * @param chan MAVLink channel to send the message
277 * @param struct The MAVLink struct to serialize
279 static inline void mavlink_msg_autopilot_version_send_struct(mavlink_channel_t chan
, const mavlink_autopilot_version_t
* autopilot_version
)
281 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
282 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
, autopilot_version
->uid2
);
284 _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
);
288 #if MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
290 This varient of _send() can be used to save stack space by re-using
291 memory from the receive buffer. The caller provides a
292 mavlink_message_t which is the size of a full mavlink message. This
293 is usually the receive buffer for the channel, and allows a reply to an
294 incoming message with minimum stack space usage.
296 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
, const uint8_t *uid2
)
298 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
299 char *buf
= (char *)msgbuf
;
300 _mav_put_uint64_t(buf
, 0, capabilities
);
301 _mav_put_uint64_t(buf
, 8, uid
);
302 _mav_put_uint32_t(buf
, 16, flight_sw_version
);
303 _mav_put_uint32_t(buf
, 20, middleware_sw_version
);
304 _mav_put_uint32_t(buf
, 24, os_sw_version
);
305 _mav_put_uint32_t(buf
, 28, board_version
);
306 _mav_put_uint16_t(buf
, 32, vendor_id
);
307 _mav_put_uint16_t(buf
, 34, product_id
);
308 _mav_put_uint8_t_array(buf
, 36, flight_custom_version
, 8);
309 _mav_put_uint8_t_array(buf
, 44, middleware_custom_version
, 8);
310 _mav_put_uint8_t_array(buf
, 52, os_custom_version
, 8);
311 _mav_put_uint8_t_array(buf
, 60, uid2
, 18);
312 _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
);
314 mavlink_autopilot_version_t
*packet
= (mavlink_autopilot_version_t
*)msgbuf
;
315 packet
->capabilities
= capabilities
;
317 packet
->flight_sw_version
= flight_sw_version
;
318 packet
->middleware_sw_version
= middleware_sw_version
;
319 packet
->os_sw_version
= os_sw_version
;
320 packet
->board_version
= board_version
;
321 packet
->vendor_id
= vendor_id
;
322 packet
->product_id
= product_id
;
323 mav_array_memcpy(packet
->flight_custom_version
, flight_custom_version
, sizeof(uint8_t)*8);
324 mav_array_memcpy(packet
->middleware_custom_version
, middleware_custom_version
, sizeof(uint8_t)*8);
325 mav_array_memcpy(packet
->os_custom_version
, os_custom_version
, sizeof(uint8_t)*8);
326 mav_array_memcpy(packet
->uid2
, uid2
, sizeof(uint8_t)*18);
327 _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
);
334 // MESSAGE AUTOPILOT_VERSION UNPACKING
338 * @brief Get field capabilities from autopilot_version message
340 * @return Bitmap of capabilities
342 static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t
* msg
)
344 return _MAV_RETURN_uint64_t(msg
, 0);
348 * @brief Get field flight_sw_version from autopilot_version message
350 * @return Firmware version number
352 static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t
* msg
)
354 return _MAV_RETURN_uint32_t(msg
, 16);
358 * @brief Get field middleware_sw_version from autopilot_version message
360 * @return Middleware version number
362 static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t
* msg
)
364 return _MAV_RETURN_uint32_t(msg
, 20);
368 * @brief Get field os_sw_version from autopilot_version message
370 * @return Operating system version number
372 static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t
* msg
)
374 return _MAV_RETURN_uint32_t(msg
, 24);
378 * @brief Get field board_version from autopilot_version message
380 * @return HW / board version (last 8 bytes should be silicon ID, if any)
382 static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t
* msg
)
384 return _MAV_RETURN_uint32_t(msg
, 28);
388 * @brief Get field flight_custom_version from autopilot_version message
390 * @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.
392 static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t
* msg
, uint8_t *flight_custom_version
)
394 return _MAV_RETURN_uint8_t_array(msg
, flight_custom_version
, 8, 36);
398 * @brief Get field middleware_custom_version from autopilot_version message
400 * @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.
402 static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t
* msg
, uint8_t *middleware_custom_version
)
404 return _MAV_RETURN_uint8_t_array(msg
, middleware_custom_version
, 8, 44);
408 * @brief Get field os_custom_version from autopilot_version message
410 * @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.
412 static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t
* msg
, uint8_t *os_custom_version
)
414 return _MAV_RETURN_uint8_t_array(msg
, os_custom_version
, 8, 52);
418 * @brief Get field vendor_id from autopilot_version message
420 * @return ID of the board vendor
422 static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t
* msg
)
424 return _MAV_RETURN_uint16_t(msg
, 32);
428 * @brief Get field product_id from autopilot_version message
430 * @return ID of the product
432 static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t
* msg
)
434 return _MAV_RETURN_uint16_t(msg
, 34);
438 * @brief Get field uid from autopilot_version message
440 * @return UID if provided by hardware (see uid2)
442 static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t
* msg
)
444 return _MAV_RETURN_uint64_t(msg
, 8);
448 * @brief Get field uid2 from autopilot_version message
450 * @return UID if provided by hardware (supersedes the uid field. If this is non-zero, use this field, otherwise use uid)
452 static inline uint16_t mavlink_msg_autopilot_version_get_uid2(const mavlink_message_t
* msg
, uint8_t *uid2
)
454 return _MAV_RETURN_uint8_t_array(msg
, uid2
, 18, 60);
458 * @brief Decode a autopilot_version message into a struct
460 * @param msg The message to decode
461 * @param autopilot_version C-struct to decode the message contents into
463 static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t
* msg
, mavlink_autopilot_version_t
* autopilot_version
)
465 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
466 autopilot_version
->capabilities
= mavlink_msg_autopilot_version_get_capabilities(msg
);
467 autopilot_version
->uid
= mavlink_msg_autopilot_version_get_uid(msg
);
468 autopilot_version
->flight_sw_version
= mavlink_msg_autopilot_version_get_flight_sw_version(msg
);
469 autopilot_version
->middleware_sw_version
= mavlink_msg_autopilot_version_get_middleware_sw_version(msg
);
470 autopilot_version
->os_sw_version
= mavlink_msg_autopilot_version_get_os_sw_version(msg
);
471 autopilot_version
->board_version
= mavlink_msg_autopilot_version_get_board_version(msg
);
472 autopilot_version
->vendor_id
= mavlink_msg_autopilot_version_get_vendor_id(msg
);
473 autopilot_version
->product_id
= mavlink_msg_autopilot_version_get_product_id(msg
);
474 mavlink_msg_autopilot_version_get_flight_custom_version(msg
, autopilot_version
->flight_custom_version
);
475 mavlink_msg_autopilot_version_get_middleware_custom_version(msg
, autopilot_version
->middleware_custom_version
);
476 mavlink_msg_autopilot_version_get_os_custom_version(msg
, autopilot_version
->os_custom_version
);
477 mavlink_msg_autopilot_version_get_uid2(msg
, autopilot_version
->uid2
);
479 uint8_t len
= msg
->len
< MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
? msg
->len
: MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
;
480 memset(autopilot_version
, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN
);
481 memcpy(autopilot_version
, _MAV_PAYLOAD(msg
), len
);