4#define MAVLINK_MSG_ID_PROTOCOL_VERSION 300
13} mavlink_protocol_version_t;
15#define MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN 22
16#define MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN 22
17#define MAVLINK_MSG_ID_300_LEN 22
18#define MAVLINK_MSG_ID_300_MIN_LEN 22
20#define MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC 217
21#define MAVLINK_MSG_ID_300_CRC 217
23#define MAVLINK_MSG_PROTOCOL_VERSION_FIELD_SPEC_VERSION_HASH_LEN 8
24#define MAVLINK_MSG_PROTOCOL_VERSION_FIELD_LIBRARY_VERSION_HASH_LEN 8
26#if MAVLINK_COMMAND_24BIT
27#define MAVLINK_MESSAGE_INFO_PROTOCOL_VERSION {
31 { { "version", NULL, MAVLINK_TYPE_UINT16_T, 0
, 0
, offsetof(mavlink_protocol_version_t, version) },
32 { "min_version", NULL, MAVLINK_TYPE_UINT16_T, 0
, 2
, offsetof(mavlink_protocol_version_t, min_version) },
33 { "max_version", NULL, MAVLINK_TYPE_UINT16_T, 0
, 4
, offsetof(mavlink_protocol_version_t, max_version) },
34 { "spec_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8
, 6
, offsetof(mavlink_protocol_version_t, spec_version_hash) },
35 { "library_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8
, 14
, offsetof(mavlink_protocol_version_t, library_version_hash) },
37}
39#define MAVLINK_MESSAGE_INFO_PROTOCOL_VERSION {
42 { { "version", NULL, MAVLINK_TYPE_UINT16_T, 0
, 0
, offsetof(mavlink_protocol_version_t, version) },
43 { "min_version", NULL, MAVLINK_TYPE_UINT16_T, 0
, 2
, offsetof(mavlink_protocol_version_t, min_version) },
44 { "max_version", NULL, MAVLINK_TYPE_UINT16_T, 0
, 4
, offsetof(mavlink_protocol_version_t, max_version) },
45 { "spec_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8
, 6
, offsetof(mavlink_protocol_version_t, spec_version_hash) },
46 { "library_version_hash", NULL, MAVLINK_TYPE_UINT8_T, 8
, 14
, offsetof(mavlink_protocol_version_t, library_version_hash) },
48}
52
53
54
55
56
57
58
59
60
61
62
63
64static inline uint16_t mavlink_msg_protocol_version_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
65 uint16_t version, uint16_t min_version, uint16_t max_version,
const uint8_t *spec_version_hash,
const uint8_t *library_version_hash)
67#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
69 _mav_put_uint16_t(buf, 0, version);
70 _mav_put_uint16_t(buf, 2, min_version);
71 _mav_put_uint16_t(buf, 4, max_version);
72 _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
73 _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
76 mavlink_protocol_version_t packet;
77 packet.version = version;
78 packet.min_version = min_version;
79 packet.max_version = max_version;
80 mav_array_memcpy(packet.spec_version_hash, spec_version_hash,
sizeof(uint8_t)*8);
81 mav_array_memcpy(packet.library_version_hash, library_version_hash,
sizeof(uint8_t)*8);
82 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
90
91
92
93
94
95
96
97
98
99
100
101
102
103static inline uint16_t mavlink_msg_protocol_version_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
104 uint16_t version, uint16_t min_version, uint16_t max_version,
const uint8_t *spec_version_hash,
const uint8_t *library_version_hash)
106#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
108 _mav_put_uint16_t(buf, 0, version);
109 _mav_put_uint16_t(buf, 2, min_version);
110 _mav_put_uint16_t(buf, 4, max_version);
111 _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
112 _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
115 mavlink_protocol_version_t packet;
116 packet.version = version;
117 packet.min_version = min_version;
118 packet.max_version = max_version;
119 mav_array_memcpy(packet.spec_version_hash, spec_version_hash,
sizeof(uint8_t)*8);
120 mav_array_memcpy(packet.library_version_hash, library_version_hash,
sizeof(uint8_t)*8);
121 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
126 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
133
134
135
136
137
138
139
140
141
142
143
144
145static inline uint16_t mavlink_msg_protocol_version_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
146 mavlink_message_t* msg,
147 uint16_t version,uint16_t min_version,uint16_t max_version,
const uint8_t *spec_version_hash,
const uint8_t *library_version_hash)
149#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
151 _mav_put_uint16_t(buf, 0, version);
152 _mav_put_uint16_t(buf, 2, min_version);
153 _mav_put_uint16_t(buf, 4, max_version);
154 _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
155 _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
158 mavlink_protocol_version_t packet;
159 packet.version = version;
160 packet.min_version = min_version;
161 packet.max_version = max_version;
162 mav_array_memcpy(packet.spec_version_hash, spec_version_hash,
sizeof(uint8_t)*8);
163 mav_array_memcpy(packet.library_version_hash, library_version_hash,
sizeof(uint8_t)*8);
164 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
172
173
174
175
176
177
178
179static inline uint16_t mavlink_msg_protocol_version_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_protocol_version_t* protocol_version)
181 return mavlink_msg_protocol_version_pack(system_id, component_id, msg, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
185
186
187
188
189
190
191
192
193static inline uint16_t mavlink_msg_protocol_version_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_protocol_version_t* protocol_version)
195 return mavlink_msg_protocol_version_pack_chan(system_id, component_id, chan, msg, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
199
200
201
202
203
204
205
206
207static inline uint16_t mavlink_msg_protocol_version_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_protocol_version_t* protocol_version)
209 return mavlink_msg_protocol_version_pack_status(system_id, component_id, _status, msg, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
213
214
215
216
217
218
219
220
221
222#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
224static inline void mavlink_msg_protocol_version_send(mavlink_channel_t chan, uint16_t version, uint16_t min_version, uint16_t max_version,
const uint8_t *spec_version_hash,
const uint8_t *library_version_hash)
226#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
227 char buf[MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN];
228 _mav_put_uint16_t(buf, 0, version);
229 _mav_put_uint16_t(buf, 2, min_version);
230 _mav_put_uint16_t(buf, 4, max_version);
231 _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
232 _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
233 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, buf, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
235 mavlink_protocol_version_t packet;
236 packet.version = version;
237 packet.min_version = min_version;
238 packet.max_version = max_version;
239 mav_array_memcpy(packet.spec_version_hash, spec_version_hash,
sizeof(uint8_t)*8);
240 mav_array_memcpy(packet.library_version_hash, library_version_hash,
sizeof(uint8_t)*8);
241 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, (
const char *)&packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
246
247
248
249
250static inline void mavlink_msg_protocol_version_send_struct(mavlink_channel_t chan,
const mavlink_protocol_version_t* protocol_version)
252#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
253 mavlink_msg_protocol_version_send(chan, protocol_version->version, protocol_version->min_version, protocol_version->max_version, protocol_version->spec_version_hash, protocol_version->library_version_hash);
255 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, (
const char *)protocol_version, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
259#if MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
261
262
263
264
265
266
267static inline void mavlink_msg_protocol_version_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint16_t version, uint16_t min_version, uint16_t max_version,
const uint8_t *spec_version_hash,
const uint8_t *library_version_hash)
269#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
270 char *buf = (
char *)msgbuf;
271 _mav_put_uint16_t(buf, 0, version);
272 _mav_put_uint16_t(buf, 2, min_version);
273 _mav_put_uint16_t(buf, 4, max_version);
274 _mav_put_uint8_t_array(buf, 6, spec_version_hash, 8);
275 _mav_put_uint8_t_array(buf, 14, library_version_hash, 8);
276 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, buf, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
278 mavlink_protocol_version_t *packet = (mavlink_protocol_version_t *)msgbuf;
279 packet->version = version;
280 packet->min_version = min_version;
281 packet->max_version = max_version;
282 mav_array_memcpy(packet->spec_version_hash, spec_version_hash,
sizeof(uint8_t)*8);
283 mav_array_memcpy(packet->library_version_hash, library_version_hash,
sizeof(uint8_t)*8);
284 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_PROTOCOL_VERSION, (
const char *)packet, MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN, MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC);
295
296
297
298
299static inline uint16_t mavlink_msg_protocol_version_get_version(
const mavlink_message_t* msg)
301 return _MAV_RETURN_uint16_t(msg, 0);
305
306
307
308
309static inline uint16_t mavlink_msg_protocol_version_get_min_version(
const mavlink_message_t* msg)
311 return _MAV_RETURN_uint16_t(msg, 2);
315
316
317
318
319static inline uint16_t mavlink_msg_protocol_version_get_max_version(
const mavlink_message_t* msg)
321 return _MAV_RETURN_uint16_t(msg, 4);
325
326
327
328
329static inline uint16_t mavlink_msg_protocol_version_get_spec_version_hash(
const mavlink_message_t* msg, uint8_t *spec_version_hash)
331 return _MAV_RETURN_uint8_t_array(msg, spec_version_hash, 8, 6);
335
336
337
338
339static inline uint16_t mavlink_msg_protocol_version_get_library_version_hash(
const mavlink_message_t* msg, uint8_t *library_version_hash)
341 return _MAV_RETURN_uint8_t_array(msg, library_version_hash, 8, 14);
345
346
347
348
349
350static inline void mavlink_msg_protocol_version_decode(
const mavlink_message_t* msg, mavlink_protocol_version_t* protocol_version)
352#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
353 protocol_version->version = mavlink_msg_protocol_version_get_version(msg);
354 protocol_version->min_version = mavlink_msg_protocol_version_get_min_version(msg);
355 protocol_version->max_version = mavlink_msg_protocol_version_get_max_version(msg);
356 mavlink_msg_protocol_version_get_spec_version_hash(msg, protocol_version->spec_version_hash);
357 mavlink_msg_protocol_version_get_library_version_hash(msg, protocol_version->library_version_hash);
359 uint8_t len = msg->len < MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN? msg->len : MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN;
360 memset(protocol_version, 0, MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN);
361 memcpy(protocol_version, _MAV_PAYLOAD(msg), len);
#define MAVLINK_MSG_ID_PROTOCOL_VERSION_LEN
Definition: mavlink_msg_protocol_version.h:15
#define MAVLINK_MSG_ID_PROTOCOL_VERSION_MIN_LEN
Definition: mavlink_msg_protocol_version.h:16
#define MAVLINK_MSG_ID_PROTOCOL_VERSION_CRC
Definition: mavlink_msg_protocol_version.h:20
#define MAVLINK_MSG_ID_PROTOCOL_VERSION
Definition: mavlink_msg_protocol_version.h:4
Definition: mavlink_msg_protocol_version.h:7
uint16_t max_version
Definition: mavlink_msg_protocol_version.h:10
uint16_t min_version
Definition: mavlink_msg_protocol_version.h:9
uint16_t version
Definition: mavlink_msg_protocol_version.h:8