Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_v2_extension.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE V2_EXTENSION PACKING
3
4#define MAVLINK_MSG_ID_V2_EXTENSION 248
5
6
8 uint16_t message_type; /*< A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.*/
9 uint8_t target_network; /*< Network ID (0 for broadcast)*/
10 uint8_t target_system; /*< System ID (0 for broadcast)*/
11 uint8_t target_component; /*< Component ID (0 for broadcast)*/
12 uint8_t payload[249]; /*< Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.*/
13} mavlink_v2_extension_t;
14
15#define MAVLINK_MSG_ID_V2_EXTENSION_LEN 254
16#define MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN 254
17#define MAVLINK_MSG_ID_248_LEN 254
18#define MAVLINK_MSG_ID_248_MIN_LEN 254
19
20#define MAVLINK_MSG_ID_V2_EXTENSION_CRC 8
21#define MAVLINK_MSG_ID_248_CRC 8
22
23#define MAVLINK_MSG_V2_EXTENSION_FIELD_PAYLOAD_LEN 249
24
25#if MAVLINK_COMMAND_24BIT
26#define MAVLINK_MESSAGE_INFO_V2_EXTENSION {
27 248,
28 "V2_EXTENSION",
29 5,
30 { { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) },
31 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) },
32 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) },
33 { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) },
34 { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) },
35 } \
36}
37#else
38#define MAVLINK_MESSAGE_INFO_V2_EXTENSION {
39 "V2_EXTENSION",
40 5,
41 { { "target_network", NULL, MAVLINK_TYPE_UINT8_T, 0, 2, offsetof(mavlink_v2_extension_t, target_network) },
42 { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 3, offsetof(mavlink_v2_extension_t, target_system) },
43 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_v2_extension_t, target_component) },
44 { "message_type", NULL, MAVLINK_TYPE_UINT16_T, 0, 0, offsetof(mavlink_v2_extension_t, message_type) },
45 { "payload", NULL, MAVLINK_TYPE_UINT8_T, 249, 5, offsetof(mavlink_v2_extension_t, payload) },
46 } \
47}
48#endif
49
50/**
51 * @brief Pack a v2_extension message
52 * @param system_id ID of this system
53 * @param component_id ID of this component (e.g. 200 for IMU)
54 * @param msg The MAVLink message to compress the data into
55 *
56 * @param target_network Network ID (0 for broadcast)
57 * @param target_system System ID (0 for broadcast)
58 * @param target_component Component ID (0 for broadcast)
59 * @param message_type A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
60 * @param payload Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.
61 * @return length of the message in bytes (excluding serial stream start sign)
62 */
63static inline uint16_t mavlink_msg_v2_extension_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
64 uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload)
65{
66#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
68 _mav_put_uint16_t(buf, 0, message_type);
69 _mav_put_uint8_t(buf, 2, target_network);
70 _mav_put_uint8_t(buf, 3, target_system);
71 _mav_put_uint8_t(buf, 4, target_component);
72 _mav_put_uint8_t_array(buf, 5, payload, 249);
73 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
74#else
75 mavlink_v2_extension_t packet;
76 packet.message_type = message_type;
77 packet.target_network = target_network;
78 packet.target_system = target_system;
79 packet.target_component = target_component;
80 mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249);
81 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
82#endif
83
84 msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION;
85 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
86}
87
88/**
89 * @brief Pack a v2_extension message
90 * @param system_id ID of this system
91 * @param component_id ID of this component (e.g. 200 for IMU)
92 * @param status MAVLink status structure
93 * @param msg The MAVLink message to compress the data into
94 *
95 * @param target_network Network ID (0 for broadcast)
96 * @param target_system System ID (0 for broadcast)
97 * @param target_component Component ID (0 for broadcast)
98 * @param message_type A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
99 * @param payload Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.
100 * @return length of the message in bytes (excluding serial stream start sign)
101 */
102static inline uint16_t mavlink_msg_v2_extension_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
103 uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload)
104{
105#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
107 _mav_put_uint16_t(buf, 0, message_type);
108 _mav_put_uint8_t(buf, 2, target_network);
109 _mav_put_uint8_t(buf, 3, target_system);
110 _mav_put_uint8_t(buf, 4, target_component);
111 _mav_put_uint8_t_array(buf, 5, payload, 249);
112 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
113#else
114 mavlink_v2_extension_t packet;
115 packet.message_type = message_type;
116 packet.target_network = target_network;
117 packet.target_system = target_system;
118 packet.target_component = target_component;
119 mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249);
120 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
121#endif
122
123 msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION;
124#if MAVLINK_CRC_EXTRA
125 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
126#else
127 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
128#endif
129}
130
131/**
132 * @brief Pack a v2_extension message on a channel
133 * @param system_id ID of this system
134 * @param component_id ID of this component (e.g. 200 for IMU)
135 * @param chan The MAVLink channel this message will be sent over
136 * @param msg The MAVLink message to compress the data into
137 * @param target_network Network ID (0 for broadcast)
138 * @param target_system System ID (0 for broadcast)
139 * @param target_component Component ID (0 for broadcast)
140 * @param message_type A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
141 * @param payload Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.
142 * @return length of the message in bytes (excluding serial stream start sign)
143 */
144static inline uint16_t mavlink_msg_v2_extension_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
145 mavlink_message_t* msg,
146 uint8_t target_network,uint8_t target_system,uint8_t target_component,uint16_t message_type,const uint8_t *payload)
147{
148#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
150 _mav_put_uint16_t(buf, 0, message_type);
151 _mav_put_uint8_t(buf, 2, target_network);
152 _mav_put_uint8_t(buf, 3, target_system);
153 _mav_put_uint8_t(buf, 4, target_component);
154 _mav_put_uint8_t_array(buf, 5, payload, 249);
155 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
156#else
157 mavlink_v2_extension_t packet;
158 packet.message_type = message_type;
159 packet.target_network = target_network;
160 packet.target_system = target_system;
161 packet.target_component = target_component;
162 mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249);
163 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
164#endif
165
166 msg->msgid = MAVLINK_MSG_ID_V2_EXTENSION;
167 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
168}
169
170/**
171 * @brief Encode a v2_extension struct
172 *
173 * @param system_id ID of this system
174 * @param component_id ID of this component (e.g. 200 for IMU)
175 * @param msg The MAVLink message to compress the data into
176 * @param v2_extension C-struct to read the message contents from
177 */
178static inline uint16_t mavlink_msg_v2_extension_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_v2_extension_t* v2_extension)
179{
180 return mavlink_msg_v2_extension_pack(system_id, component_id, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload);
181}
182
183/**
184 * @brief Encode a v2_extension struct on a channel
185 *
186 * @param system_id ID of this system
187 * @param component_id ID of this component (e.g. 200 for IMU)
188 * @param chan The MAVLink channel this message will be sent over
189 * @param msg The MAVLink message to compress the data into
190 * @param v2_extension C-struct to read the message contents from
191 */
192static inline uint16_t mavlink_msg_v2_extension_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_v2_extension_t* v2_extension)
193{
194 return mavlink_msg_v2_extension_pack_chan(system_id, component_id, chan, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload);
195}
196
197/**
198 * @brief Encode a v2_extension struct with provided status structure
199 *
200 * @param system_id ID of this system
201 * @param component_id ID of this component (e.g. 200 for IMU)
202 * @param status MAVLink status structure
203 * @param msg The MAVLink message to compress the data into
204 * @param v2_extension C-struct to read the message contents from
205 */
206static inline uint16_t mavlink_msg_v2_extension_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_v2_extension_t* v2_extension)
207{
208 return mavlink_msg_v2_extension_pack_status(system_id, component_id, _status, msg, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload);
209}
210
211/**
212 * @brief Send a v2_extension message
213 * @param chan MAVLink channel to send the message
214 *
215 * @param target_network Network ID (0 for broadcast)
216 * @param target_system System ID (0 for broadcast)
217 * @param target_component Component ID (0 for broadcast)
218 * @param message_type A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
219 * @param payload Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.
220 */
221#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
222
223static inline void mavlink_msg_v2_extension_send(mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload)
224{
225#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
226 char buf[MAVLINK_MSG_ID_V2_EXTENSION_LEN];
227 _mav_put_uint16_t(buf, 0, message_type);
228 _mav_put_uint8_t(buf, 2, target_network);
229 _mav_put_uint8_t(buf, 3, target_system);
230 _mav_put_uint8_t(buf, 4, target_component);
231 _mav_put_uint8_t_array(buf, 5, payload, 249);
232 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
233#else
234 mavlink_v2_extension_t packet;
235 packet.message_type = message_type;
236 packet.target_network = target_network;
237 packet.target_system = target_system;
238 packet.target_component = target_component;
239 mav_array_memcpy(packet.payload, payload, sizeof(uint8_t)*249);
240 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)&packet, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
241#endif
242}
243
244/**
245 * @brief Send a v2_extension message
246 * @param chan MAVLink channel to send the message
247 * @param struct The MAVLink struct to serialize
248 */
249static inline void mavlink_msg_v2_extension_send_struct(mavlink_channel_t chan, const mavlink_v2_extension_t* v2_extension)
250{
251#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
252 mavlink_msg_v2_extension_send(chan, v2_extension->target_network, v2_extension->target_system, v2_extension->target_component, v2_extension->message_type, v2_extension->payload);
253#else
254 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)v2_extension, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
255#endif
256}
257
258#if MAVLINK_MSG_ID_V2_EXTENSION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
259/*
260 This variant of _send() can be used to save stack space by reusing
261 memory from the receive buffer. The caller provides a
262 mavlink_message_t which is the size of a full mavlink message. This
263 is usually the receive buffer for the channel, and allows a reply to an
264 incoming message with minimum stack space usage.
265 */
266static inline void mavlink_msg_v2_extension_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_network, uint8_t target_system, uint8_t target_component, uint16_t message_type, const uint8_t *payload)
267{
268#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
269 char *buf = (char *)msgbuf;
270 _mav_put_uint16_t(buf, 0, message_type);
271 _mav_put_uint8_t(buf, 2, target_network);
272 _mav_put_uint8_t(buf, 3, target_system);
273 _mav_put_uint8_t(buf, 4, target_component);
274 _mav_put_uint8_t_array(buf, 5, payload, 249);
275 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, buf, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
276#else
277 mavlink_v2_extension_t *packet = (mavlink_v2_extension_t *)msgbuf;
278 packet->message_type = message_type;
279 packet->target_network = target_network;
280 packet->target_system = target_system;
281 packet->target_component = target_component;
282 mav_array_memcpy(packet->payload, payload, sizeof(uint8_t)*249);
283 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_V2_EXTENSION, (const char *)packet, MAVLINK_MSG_ID_V2_EXTENSION_MIN_LEN, MAVLINK_MSG_ID_V2_EXTENSION_LEN, MAVLINK_MSG_ID_V2_EXTENSION_CRC);
284#endif
285}
286#endif
287
288#endif
289
290// MESSAGE V2_EXTENSION UNPACKING
291
292
293/**
294 * @brief Get field target_network from v2_extension message
295 *
296 * @return Network ID (0 for broadcast)
297 */
298static inline uint8_t mavlink_msg_v2_extension_get_target_network(const mavlink_message_t* msg)
299{
300 return _MAV_RETURN_uint8_t(msg, 2);
301}
302
303/**
304 * @brief Get field target_system from v2_extension message
305 *
306 * @return System ID (0 for broadcast)
307 */
308static inline uint8_t mavlink_msg_v2_extension_get_target_system(const mavlink_message_t* msg)
309{
310 return _MAV_RETURN_uint8_t(msg, 3);
311}
312
313/**
314 * @brief Get field target_component from v2_extension message
315 *
316 * @return Component ID (0 for broadcast)
317 */
318static inline uint8_t mavlink_msg_v2_extension_get_target_component(const mavlink_message_t* msg)
319{
320 return _MAV_RETURN_uint8_t(msg, 4);
321}
322
323/**
324 * @brief Get field message_type from v2_extension message
325 *
326 * @return A code that identifies the software component that understands this message (analogous to USB device classes or mime type strings). If this code is less than 32768, it is considered a 'registered' protocol extension and the corresponding entry should be added to https://github.com/mavlink/mavlink/definition_files/extension_message_ids.xml. Software creators can register blocks of message IDs as needed (useful for GCS specific metadata, etc...). Message_types greater than 32767 are considered local experiments and should not be checked in to any widely distributed codebase.
327 */
328static inline uint16_t mavlink_msg_v2_extension_get_message_type(const mavlink_message_t* msg)
329{
330 return _MAV_RETURN_uint16_t(msg, 0);
331}
332
333/**
334 * @brief Get field payload from v2_extension message
335 *
336 * @return Variable length payload. The length must be encoded in the payload as part of the message_type protocol, e.g. by including the length as payload data, or by terminating the payload data with a non-zero marker. This is required in order to reconstruct zero-terminated payloads that are (or otherwise would be) trimmed by MAVLink 2 empty-byte truncation. The entire content of the payload block is opaque unless you understand the encoding message_type. The particular encoding used can be extension specific and might not always be documented as part of the MAVLink specification.
337 */
338static inline uint16_t mavlink_msg_v2_extension_get_payload(const mavlink_message_t* msg, uint8_t *payload)
339{
340 return _MAV_RETURN_uint8_t_array(msg, payload, 249, 5);
341}
342
343/**
344 * @brief Decode a v2_extension message into a struct
345 *
346 * @param msg The message to decode
347 * @param v2_extension C-struct to decode the message contents into
348 */
349static inline void mavlink_msg_v2_extension_decode(const mavlink_message_t* msg, mavlink_v2_extension_t* v2_extension)
350{
351#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
352 v2_extension->message_type = mavlink_msg_v2_extension_get_message_type(msg);
353 v2_extension->target_network = mavlink_msg_v2_extension_get_target_network(msg);
354 v2_extension->target_system = mavlink_msg_v2_extension_get_target_system(msg);
355 v2_extension->target_component = mavlink_msg_v2_extension_get_target_component(msg);
356 mavlink_msg_v2_extension_get_payload(msg, v2_extension->payload);
357#else
358 uint8_t len = msg->len < MAVLINK_MSG_ID_V2_EXTENSION_LEN? msg->len : MAVLINK_MSG_ID_V2_EXTENSION_LEN;
359 memset(v2_extension, 0, MAVLINK_MSG_ID_V2_EXTENSION_LEN);
360 memcpy(v2_extension, _MAV_PAYLOAD(msg), len);
361#endif
362}