close Warning: Can't use blame annotator:
svn blame failed on trunk/tools/Controller/Mavlink/src/include/common/mavlink_msg_autopilot_version.h: 200029 - Couldn't perform atomic initialization

source: flair-src/trunk/tools/Controller/Mavlink/src/include/common/mavlink_msg_autopilot_version.h@ 88

Last change on this file since 88 was 88, checked in by Sanahuja Guillaume, 8 years ago

m

File size: 25.7 KB
RevLine 
1// MESSAGE AUTOPILOT_VERSION PACKING
2
3#define MAVLINK_MSG_ID_AUTOPILOT_VERSION 148
4
5typedef struct MAVLINK_PACKED __mavlink_autopilot_version_t
6{
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;
19
20#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN 60
21#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_MIN_LEN 60
22#define MAVLINK_MSG_ID_148_LEN 60
23#define MAVLINK_MSG_ID_148_MIN_LEN 60
24
25#define MAVLINK_MSG_ID_AUTOPILOT_VERSION_CRC 178
26#define MAVLINK_MSG_ID_148_CRC 178
27
28#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_FLIGHT_CUSTOM_VERSION_LEN 8
29#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_MIDDLEWARE_CUSTOM_VERSION_LEN 8
30#define MAVLINK_MSG_AUTOPILOT_VERSION_FIELD_OS_CUSTOM_VERSION_LEN 8
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
34 148, \
35 "AUTOPILOT_VERSION", \
36 11, \
37 { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
38 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
39 { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
40 { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
41 { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
42 { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
43 { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
44 { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
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 } \
49}
50#else
51#define MAVLINK_MESSAGE_INFO_AUTOPILOT_VERSION { \
52 "AUTOPILOT_VERSION", \
53 11, \
54 { { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_autopilot_version_t, capabilities) }, \
55 { "uid", NULL, MAVLINK_TYPE_UINT64_T, 0, 8, offsetof(mavlink_autopilot_version_t, uid) }, \
56 { "flight_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_autopilot_version_t, flight_sw_version) }, \
57 { "middleware_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_autopilot_version_t, middleware_sw_version) }, \
58 { "os_sw_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_autopilot_version_t, os_sw_version) }, \
59 { "board_version", NULL, MAVLINK_TYPE_UINT32_T, 0, 28, offsetof(mavlink_autopilot_version_t, board_version) }, \
60 { "vendor_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 32, offsetof(mavlink_autopilot_version_t, vendor_id) }, \
61 { "product_id", NULL, MAVLINK_TYPE_UINT16_T, 0, 34, offsetof(mavlink_autopilot_version_t, product_id) }, \
62 { "flight_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 36, offsetof(mavlink_autopilot_version_t, flight_custom_version) }, \
63 { "middleware_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 44, offsetof(mavlink_autopilot_version_t, middleware_custom_version) }, \
64 { "os_custom_version", NULL, MAVLINK_TYPE_UINT8_T, 8, 52, offsetof(mavlink_autopilot_version_t, os_custom_version) }, \
65 } \
66}
67#endif
68
69/**
70 * @brief Pack a autopilot_version message
71 * @param system_id ID of this system
72 * @param component_id ID of this component (e.g. 200 for IMU)
73 * @param msg The MAVLink message to compress the data into
74 *
75 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
76 * @param flight_sw_version Firmware version number
77 * @param middleware_sw_version Middleware version number
78 * @param os_sw_version Operating system version number
79 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
80 * @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.
81 * @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.
82 * @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.
83 * @param vendor_id ID of the board vendor
84 * @param product_id ID of the product
85 * @param uid UID if provided by hardware
86 * @return length of the message in bytes (excluding serial stream start sign)
87 */
88static inline uint16_t mavlink_msg_autopilot_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
89 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)
90{
91#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
92 char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
93 _mav_put_uint64_t(buf, 0, capabilities);
94 _mav_put_uint64_t(buf, 8, uid);
95 _mav_put_uint32_t(buf, 16, flight_sw_version);
96 _mav_put_uint32_t(buf, 20, middleware_sw_version);
97 _mav_put_uint32_t(buf, 24, os_sw_version);
98 _mav_put_uint32_t(buf, 28, board_version);
99 _mav_put_uint16_t(buf, 32, vendor_id);
100 _mav_put_uint16_t(buf, 34, product_id);
101 _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
102 _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
103 _mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
104 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
105#else
106 mavlink_autopilot_version_t packet;
107 packet.capabilities = capabilities;
108 packet.uid = uid;
109 packet.flight_sw_version = flight_sw_version;
110 packet.middleware_sw_version = middleware_sw_version;
111 packet.os_sw_version = os_sw_version;
112 packet.board_version = board_version;
113 packet.vendor_id = vendor_id;
114 packet.product_id = product_id;
115 mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
116 mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
117 mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
118 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
119#endif
120
121 msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
122 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);
123}
124
125/**
126 * @brief Pack a autopilot_version message on a channel
127 * @param system_id ID of this system
128 * @param component_id ID of this component (e.g. 200 for IMU)
129 * @param chan The MAVLink channel this message will be sent over
130 * @param msg The MAVLink message to compress the data into
131 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
132 * @param flight_sw_version Firmware version number
133 * @param middleware_sw_version Middleware version number
134 * @param os_sw_version Operating system version number
135 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
136 * @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.
137 * @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.
138 * @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.
139 * @param vendor_id ID of the board vendor
140 * @param product_id ID of the product
141 * @param uid UID if provided by hardware
142 * @return length of the message in bytes (excluding serial stream start sign)
143 */
144static inline uint16_t mavlink_msg_autopilot_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
145 mavlink_message_t* msg,
146 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)
147{
148#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
149 char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
150 _mav_put_uint64_t(buf, 0, capabilities);
151 _mav_put_uint64_t(buf, 8, uid);
152 _mav_put_uint32_t(buf, 16, flight_sw_version);
153 _mav_put_uint32_t(buf, 20, middleware_sw_version);
154 _mav_put_uint32_t(buf, 24, os_sw_version);
155 _mav_put_uint32_t(buf, 28, board_version);
156 _mav_put_uint16_t(buf, 32, vendor_id);
157 _mav_put_uint16_t(buf, 34, product_id);
158 _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
159 _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
160 _mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
161 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
162#else
163 mavlink_autopilot_version_t packet;
164 packet.capabilities = capabilities;
165 packet.uid = uid;
166 packet.flight_sw_version = flight_sw_version;
167 packet.middleware_sw_version = middleware_sw_version;
168 packet.os_sw_version = os_sw_version;
169 packet.board_version = board_version;
170 packet.vendor_id = vendor_id;
171 packet.product_id = product_id;
172 mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
173 mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
174 mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
175 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
176#endif
177
178 msg->msgid = MAVLINK_MSG_ID_AUTOPILOT_VERSION;
179 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);
180}
181
182/**
183 * @brief Encode a autopilot_version struct
184 *
185 * @param system_id ID of this system
186 * @param component_id ID of this component (e.g. 200 for IMU)
187 * @param msg The MAVLink message to compress the data into
188 * @param autopilot_version C-struct to read the message contents from
189 */
190static 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)
191{
192 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);
193}
194
195/**
196 * @brief Encode a autopilot_version struct on a channel
197 *
198 * @param system_id ID of this system
199 * @param component_id ID of this component (e.g. 200 for IMU)
200 * @param chan The MAVLink channel this message will be sent over
201 * @param msg The MAVLink message to compress the data into
202 * @param autopilot_version C-struct to read the message contents from
203 */
204static 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)
205{
206 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);
207}
208
209/**
210 * @brief Send a autopilot_version message
211 * @param chan MAVLink channel to send the message
212 *
213 * @param capabilities bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
214 * @param flight_sw_version Firmware version number
215 * @param middleware_sw_version Middleware version number
216 * @param os_sw_version Operating system version number
217 * @param board_version HW / board version (last 8 bytes should be silicon ID, if any)
218 * @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.
219 * @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.
220 * @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.
221 * @param vendor_id ID of the board vendor
222 * @param product_id ID of the product
223 * @param uid UID if provided by hardware
224 */
225#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
226
227static 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)
228{
229#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
230 char buf[MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN];
231 _mav_put_uint64_t(buf, 0, capabilities);
232 _mav_put_uint64_t(buf, 8, uid);
233 _mav_put_uint32_t(buf, 16, flight_sw_version);
234 _mav_put_uint32_t(buf, 20, middleware_sw_version);
235 _mav_put_uint32_t(buf, 24, os_sw_version);
236 _mav_put_uint32_t(buf, 28, board_version);
237 _mav_put_uint16_t(buf, 32, vendor_id);
238 _mav_put_uint16_t(buf, 34, product_id);
239 _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
240 _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
241 _mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
242 _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);
243#else
244 mavlink_autopilot_version_t packet;
245 packet.capabilities = capabilities;
246 packet.uid = uid;
247 packet.flight_sw_version = flight_sw_version;
248 packet.middleware_sw_version = middleware_sw_version;
249 packet.os_sw_version = os_sw_version;
250 packet.board_version = board_version;
251 packet.vendor_id = vendor_id;
252 packet.product_id = product_id;
253 mav_array_memcpy(packet.flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
254 mav_array_memcpy(packet.middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
255 mav_array_memcpy(packet.os_custom_version, os_custom_version, sizeof(uint8_t)*8);
256 _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);
257#endif
258}
259
260/**
261 * @brief Send a autopilot_version message
262 * @param chan MAVLink channel to send the message
263 * @param struct The MAVLink struct to serialize
264 */
265static inline void mavlink_msg_autopilot_version_send_struct(mavlink_channel_t chan, const mavlink_autopilot_version_t* autopilot_version)
266{
267#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
268 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);
269#else
270 _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);
271#endif
272}
273
274#if MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
275/*
276 This varient of _send() can be used to save stack space by re-using
277 memory from the receive buffer. The caller provides a
278 mavlink_message_t which is the size of a full mavlink message. This
279 is usually the receive buffer for the channel, and allows a reply to an
280 incoming message with minimum stack space usage.
281 */
282static 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)
283{
284#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 char *buf = (char *)msgbuf;
286 _mav_put_uint64_t(buf, 0, capabilities);
287 _mav_put_uint64_t(buf, 8, uid);
288 _mav_put_uint32_t(buf, 16, flight_sw_version);
289 _mav_put_uint32_t(buf, 20, middleware_sw_version);
290 _mav_put_uint32_t(buf, 24, os_sw_version);
291 _mav_put_uint32_t(buf, 28, board_version);
292 _mav_put_uint16_t(buf, 32, vendor_id);
293 _mav_put_uint16_t(buf, 34, product_id);
294 _mav_put_uint8_t_array(buf, 36, flight_custom_version, 8);
295 _mav_put_uint8_t_array(buf, 44, middleware_custom_version, 8);
296 _mav_put_uint8_t_array(buf, 52, os_custom_version, 8);
297 _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);
298#else
299 mavlink_autopilot_version_t *packet = (mavlink_autopilot_version_t *)msgbuf;
300 packet->capabilities = capabilities;
301 packet->uid = uid;
302 packet->flight_sw_version = flight_sw_version;
303 packet->middleware_sw_version = middleware_sw_version;
304 packet->os_sw_version = os_sw_version;
305 packet->board_version = board_version;
306 packet->vendor_id = vendor_id;
307 packet->product_id = product_id;
308 mav_array_memcpy(packet->flight_custom_version, flight_custom_version, sizeof(uint8_t)*8);
309 mav_array_memcpy(packet->middleware_custom_version, middleware_custom_version, sizeof(uint8_t)*8);
310 mav_array_memcpy(packet->os_custom_version, os_custom_version, sizeof(uint8_t)*8);
311 _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);
312#endif
313}
314#endif
315
316#endif
317
318// MESSAGE AUTOPILOT_VERSION UNPACKING
319
320
321/**
322 * @brief Get field capabilities from autopilot_version message
323 *
324 * @return bitmask of capabilities (see MAV_PROTOCOL_CAPABILITY enum)
325 */
326static inline uint64_t mavlink_msg_autopilot_version_get_capabilities(const mavlink_message_t* msg)
327{
328 return _MAV_RETURN_uint64_t(msg, 0);
329}
330
331/**
332 * @brief Get field flight_sw_version from autopilot_version message
333 *
334 * @return Firmware version number
335 */
336static inline uint32_t mavlink_msg_autopilot_version_get_flight_sw_version(const mavlink_message_t* msg)
337{
338 return _MAV_RETURN_uint32_t(msg, 16);
339}
340
341/**
342 * @brief Get field middleware_sw_version from autopilot_version message
343 *
344 * @return Middleware version number
345 */
346static inline uint32_t mavlink_msg_autopilot_version_get_middleware_sw_version(const mavlink_message_t* msg)
347{
348 return _MAV_RETURN_uint32_t(msg, 20);
349}
350
351/**
352 * @brief Get field os_sw_version from autopilot_version message
353 *
354 * @return Operating system version number
355 */
356static inline uint32_t mavlink_msg_autopilot_version_get_os_sw_version(const mavlink_message_t* msg)
357{
358 return _MAV_RETURN_uint32_t(msg, 24);
359}
360
361/**
362 * @brief Get field board_version from autopilot_version message
363 *
364 * @return HW / board version (last 8 bytes should be silicon ID, if any)
365 */
366static inline uint32_t mavlink_msg_autopilot_version_get_board_version(const mavlink_message_t* msg)
367{
368 return _MAV_RETURN_uint32_t(msg, 28);
369}
370
371/**
372 * @brief Get field flight_custom_version from autopilot_version message
373 *
374 * @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 */
376static inline uint16_t mavlink_msg_autopilot_version_get_flight_custom_version(const mavlink_message_t* msg, uint8_t *flight_custom_version)
377{
378 return _MAV_RETURN_uint8_t_array(msg, flight_custom_version, 8, 36);
379}
380
381/**
382 * @brief Get field middleware_custom_version from autopilot_version message
383 *
384 * @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 */
386static inline uint16_t mavlink_msg_autopilot_version_get_middleware_custom_version(const mavlink_message_t* msg, uint8_t *middleware_custom_version)
387{
388 return _MAV_RETURN_uint8_t_array(msg, middleware_custom_version, 8, 44);
389}
390
391/**
392 * @brief Get field os_custom_version from autopilot_version message
393 *
394 * @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.
395 */
396static inline uint16_t mavlink_msg_autopilot_version_get_os_custom_version(const mavlink_message_t* msg, uint8_t *os_custom_version)
397{
398 return _MAV_RETURN_uint8_t_array(msg, os_custom_version, 8, 52);
399}
400
401/**
402 * @brief Get field vendor_id from autopilot_version message
403 *
404 * @return ID of the board vendor
405 */
406static inline uint16_t mavlink_msg_autopilot_version_get_vendor_id(const mavlink_message_t* msg)
407{
408 return _MAV_RETURN_uint16_t(msg, 32);
409}
410
411/**
412 * @brief Get field product_id from autopilot_version message
413 *
414 * @return ID of the product
415 */
416static inline uint16_t mavlink_msg_autopilot_version_get_product_id(const mavlink_message_t* msg)
417{
418 return _MAV_RETURN_uint16_t(msg, 34);
419}
420
421/**
422 * @brief Get field uid from autopilot_version message
423 *
424 * @return UID if provided by hardware
425 */
426static inline uint64_t mavlink_msg_autopilot_version_get_uid(const mavlink_message_t* msg)
427{
428 return _MAV_RETURN_uint64_t(msg, 8);
429}
430
431/**
432 * @brief Decode a autopilot_version message into a struct
433 *
434 * @param msg The message to decode
435 * @param autopilot_version C-struct to decode the message contents into
436 */
437static inline void mavlink_msg_autopilot_version_decode(const mavlink_message_t* msg, mavlink_autopilot_version_t* autopilot_version)
438{
439#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
440 autopilot_version->capabilities = mavlink_msg_autopilot_version_get_capabilities(msg);
441 autopilot_version->uid = mavlink_msg_autopilot_version_get_uid(msg);
442 autopilot_version->flight_sw_version = mavlink_msg_autopilot_version_get_flight_sw_version(msg);
443 autopilot_version->middleware_sw_version = mavlink_msg_autopilot_version_get_middleware_sw_version(msg);
444 autopilot_version->os_sw_version = mavlink_msg_autopilot_version_get_os_sw_version(msg);
445 autopilot_version->board_version = mavlink_msg_autopilot_version_get_board_version(msg);
446 autopilot_version->vendor_id = mavlink_msg_autopilot_version_get_vendor_id(msg);
447 autopilot_version->product_id = mavlink_msg_autopilot_version_get_product_id(msg);
448 mavlink_msg_autopilot_version_get_flight_custom_version(msg, autopilot_version->flight_custom_version);
449 mavlink_msg_autopilot_version_get_middleware_custom_version(msg, autopilot_version->middleware_custom_version);
450 mavlink_msg_autopilot_version_get_os_custom_version(msg, autopilot_version->os_custom_version);
451#else
452 uint8_t len = msg->len < MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN? msg->len : MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN;
453 memset(autopilot_version, 0, MAVLINK_MSG_ID_AUTOPILOT_VERSION_LEN);
454 memcpy(autopilot_version, _MAV_PAYLOAD(msg), len);
455#endif
456}
Note: See TracBrowser for help on using the repository browser.