Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_open_drone_id_basic_id.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE OPEN_DRONE_ID_BASIC_ID PACKING
3
4#define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID 12900
5
6
8 uint8_t target_system; /*< System ID (0 for broadcast).*/
9 uint8_t target_component; /*< Component ID (0 for broadcast).*/
10 uint8_t id_or_mac[20]; /*< Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html. */
11 uint8_t id_type; /*< Indicates the format for the uas_id field of this message.*/
12 uint8_t ua_type; /*< Indicates the type of UA (Unmanned Aircraft).*/
13 uint8_t uas_id[20]; /*< UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.*/
14} mavlink_open_drone_id_basic_id_t;
15
16#define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN 44
17#define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN 44
18#define MAVLINK_MSG_ID_12900_LEN 44
19#define MAVLINK_MSG_ID_12900_MIN_LEN 44
20
21#define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC 114
22#define MAVLINK_MSG_ID_12900_CRC 114
23
24#define MAVLINK_MSG_OPEN_DRONE_ID_BASIC_ID_FIELD_ID_OR_MAC_LEN 20
25#define MAVLINK_MSG_OPEN_DRONE_ID_BASIC_ID_FIELD_UAS_ID_LEN 20
26
27#if MAVLINK_COMMAND_24BIT
28#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_BASIC_ID {
29 12900,
30 "OPEN_DRONE_ID_BASIC_ID",
31 6,
32 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_open_drone_id_basic_id_t, target_system) },
33 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_open_drone_id_basic_id_t, target_component) },
34 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 2, offsetof(mavlink_open_drone_id_basic_id_t, id_or_mac) },
35 { "id_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_open_drone_id_basic_id_t, id_type) },
36 { "ua_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_open_drone_id_basic_id_t, ua_type) },
37 { "uas_id", NULL, MAVLINK_TYPE_UINT8_T, 20, 24, offsetof(mavlink_open_drone_id_basic_id_t, uas_id) },
38 } \
39}
40#else
41#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_BASIC_ID {
42 "OPEN_DRONE_ID_BASIC_ID",
43 6,
44 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_open_drone_id_basic_id_t, target_system) },
45 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_open_drone_id_basic_id_t, target_component) },
46 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 2, offsetof(mavlink_open_drone_id_basic_id_t, id_or_mac) },
47 { "id_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_open_drone_id_basic_id_t, id_type) },
48 { "ua_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_open_drone_id_basic_id_t, ua_type) },
49 { "uas_id", NULL, MAVLINK_TYPE_UINT8_T, 20, 24, offsetof(mavlink_open_drone_id_basic_id_t, uas_id) },
50 } \
51}
52#endif
53
54/**
55 * @brief Pack a open_drone_id_basic_id message
56 * @param system_id ID of this system
57 * @param component_id ID of this component (e.g. 200 for IMU)
58 * @param msg The MAVLink message to compress the data into
59 *
60 * @param target_system System ID (0 for broadcast).
61 * @param target_component Component ID (0 for broadcast).
62 * @param id_or_mac Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
63 * @param id_type Indicates the format for the uas_id field of this message.
64 * @param ua_type Indicates the type of UA (Unmanned Aircraft).
65 * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
66 * @return length of the message in bytes (excluding serial stream start sign)
67 */
68static inline uint16_t mavlink_msg_open_drone_id_basic_id_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
69 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t id_type, uint8_t ua_type, const uint8_t *uas_id)
70{
71#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
73 _mav_put_uint8_t(buf, 0, target_system);
74 _mav_put_uint8_t(buf, 1, target_component);
75 _mav_put_uint8_t(buf, 22, id_type);
76 _mav_put_uint8_t(buf, 23, ua_type);
77 _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
78 _mav_put_uint8_t_array(buf, 24, uas_id, 20);
79 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
80#else
81 mavlink_open_drone_id_basic_id_t packet;
82 packet.target_system = target_system;
83 packet.target_component = target_component;
84 packet.id_type = id_type;
85 packet.ua_type = ua_type;
86 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
87 mav_array_memcpy(packet.uas_id, uas_id, sizeof(uint8_t)*20);
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
89#endif
90
93}
94
95/**
96 * @brief Pack a open_drone_id_basic_id message
97 * @param system_id ID of this system
98 * @param component_id ID of this component (e.g. 200 for IMU)
99 * @param status MAVLink status structure
100 * @param msg The MAVLink message to compress the data into
101 *
102 * @param target_system System ID (0 for broadcast).
103 * @param target_component Component ID (0 for broadcast).
104 * @param id_or_mac Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
105 * @param id_type Indicates the format for the uas_id field of this message.
106 * @param ua_type Indicates the type of UA (Unmanned Aircraft).
107 * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
108 * @return length of the message in bytes (excluding serial stream start sign)
109 */
110static inline uint16_t mavlink_msg_open_drone_id_basic_id_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
111 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t id_type, uint8_t ua_type, const uint8_t *uas_id)
112{
113#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
115 _mav_put_uint8_t(buf, 0, target_system);
116 _mav_put_uint8_t(buf, 1, target_component);
117 _mav_put_uint8_t(buf, 22, id_type);
118 _mav_put_uint8_t(buf, 23, ua_type);
119 _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
120 _mav_put_uint8_t_array(buf, 24, uas_id, 20);
121 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
122#else
123 mavlink_open_drone_id_basic_id_t packet;
124 packet.target_system = target_system;
125 packet.target_component = target_component;
126 packet.id_type = id_type;
127 packet.ua_type = ua_type;
128 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
129 mav_array_memcpy(packet.uas_id, uas_id, sizeof(uint8_t)*20);
130 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
131#endif
132
134#if MAVLINK_CRC_EXTRA
135 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
136#else
137 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
138#endif
139}
140
141/**
142 * @brief Pack a open_drone_id_basic_id message on a channel
143 * @param system_id ID of this system
144 * @param component_id ID of this component (e.g. 200 for IMU)
145 * @param chan The MAVLink channel this message will be sent over
146 * @param msg The MAVLink message to compress the data into
147 * @param target_system System ID (0 for broadcast).
148 * @param target_component Component ID (0 for broadcast).
149 * @param id_or_mac Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
150 * @param id_type Indicates the format for the uas_id field of this message.
151 * @param ua_type Indicates the type of UA (Unmanned Aircraft).
152 * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
153 * @return length of the message in bytes (excluding serial stream start sign)
154 */
155static inline uint16_t mavlink_msg_open_drone_id_basic_id_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
156 mavlink_message_t* msg,
157 uint8_t target_system,uint8_t target_component,const uint8_t *id_or_mac,uint8_t id_type,uint8_t ua_type,const uint8_t *uas_id)
158{
159#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
161 _mav_put_uint8_t(buf, 0, target_system);
162 _mav_put_uint8_t(buf, 1, target_component);
163 _mav_put_uint8_t(buf, 22, id_type);
164 _mav_put_uint8_t(buf, 23, ua_type);
165 _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
166 _mav_put_uint8_t_array(buf, 24, uas_id, 20);
167 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
168#else
169 mavlink_open_drone_id_basic_id_t packet;
170 packet.target_system = target_system;
171 packet.target_component = target_component;
172 packet.id_type = id_type;
173 packet.ua_type = ua_type;
174 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
175 mav_array_memcpy(packet.uas_id, uas_id, sizeof(uint8_t)*20);
176 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
177#endif
178
181}
182
183/**
184 * @brief Encode a open_drone_id_basic_id struct
185 *
186 * @param system_id ID of this system
187 * @param component_id ID of this component (e.g. 200 for IMU)
188 * @param msg The MAVLink message to compress the data into
189 * @param open_drone_id_basic_id C-struct to read the message contents from
190 */
191static inline uint16_t mavlink_msg_open_drone_id_basic_id_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
192{
193 return mavlink_msg_open_drone_id_basic_id_pack(system_id, component_id, msg, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
194}
195
196/**
197 * @brief Encode a open_drone_id_basic_id struct on a channel
198 *
199 * @param system_id ID of this system
200 * @param component_id ID of this component (e.g. 200 for IMU)
201 * @param chan The MAVLink channel this message will be sent over
202 * @param msg The MAVLink message to compress the data into
203 * @param open_drone_id_basic_id C-struct to read the message contents from
204 */
205static inline uint16_t mavlink_msg_open_drone_id_basic_id_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
206{
207 return mavlink_msg_open_drone_id_basic_id_pack_chan(system_id, component_id, chan, msg, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
208}
209
210/**
211 * @brief Encode a open_drone_id_basic_id struct with provided status structure
212 *
213 * @param system_id ID of this system
214 * @param component_id ID of this component (e.g. 200 for IMU)
215 * @param status MAVLink status structure
216 * @param msg The MAVLink message to compress the data into
217 * @param open_drone_id_basic_id C-struct to read the message contents from
218 */
219static inline uint16_t mavlink_msg_open_drone_id_basic_id_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
220{
221 return mavlink_msg_open_drone_id_basic_id_pack_status(system_id, component_id, _status, msg, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
222}
223
224/**
225 * @brief Send a open_drone_id_basic_id message
226 * @param chan MAVLink channel to send the message
227 *
228 * @param target_system System ID (0 for broadcast).
229 * @param target_component Component ID (0 for broadcast).
230 * @param id_or_mac Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
231 * @param id_type Indicates the format for the uas_id field of this message.
232 * @param ua_type Indicates the type of UA (Unmanned Aircraft).
233 * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
234 */
235#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
236
237static inline void mavlink_msg_open_drone_id_basic_id_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t id_type, uint8_t ua_type, const uint8_t *uas_id)
238{
239#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
240 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN];
241 _mav_put_uint8_t(buf, 0, target_system);
242 _mav_put_uint8_t(buf, 1, target_component);
243 _mav_put_uint8_t(buf, 22, id_type);
244 _mav_put_uint8_t(buf, 23, ua_type);
245 _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
246 _mav_put_uint8_t_array(buf, 24, uas_id, 20);
247 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
248#else
249 mavlink_open_drone_id_basic_id_t packet;
250 packet.target_system = target_system;
251 packet.target_component = target_component;
252 packet.id_type = id_type;
253 packet.ua_type = ua_type;
254 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
255 mav_array_memcpy(packet.uas_id, uas_id, sizeof(uint8_t)*20);
256 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, (const char *)&packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
257#endif
258}
259
260/**
261 * @brief Send a open_drone_id_basic_id message
262 * @param chan MAVLink channel to send the message
263 * @param struct The MAVLink struct to serialize
264 */
265static inline void mavlink_msg_open_drone_id_basic_id_send_struct(mavlink_channel_t chan, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
266{
267#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
268 mavlink_msg_open_drone_id_basic_id_send(chan, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
269#else
270 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, (const char *)open_drone_id_basic_id, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
271#endif
272}
273
274#if MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN <= MAVLINK_MAX_PAYLOAD_LEN
275/*
276 This variant of _send() can be used to save stack space by reusing
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_open_drone_id_basic_id_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t id_type, uint8_t ua_type, const uint8_t *uas_id)
283{
284#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
285 char *buf = (char *)msgbuf;
286 _mav_put_uint8_t(buf, 0, target_system);
287 _mav_put_uint8_t(buf, 1, target_component);
288 _mav_put_uint8_t(buf, 22, id_type);
289 _mav_put_uint8_t(buf, 23, ua_type);
290 _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
291 _mav_put_uint8_t_array(buf, 24, uas_id, 20);
292 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
293#else
294 mavlink_open_drone_id_basic_id_t *packet = (mavlink_open_drone_id_basic_id_t *)msgbuf;
295 packet->target_system = target_system;
296 packet->target_component = target_component;
297 packet->id_type = id_type;
298 packet->ua_type = ua_type;
299 mav_array_memcpy(packet->id_or_mac, id_or_mac, sizeof(uint8_t)*20);
300 mav_array_memcpy(packet->uas_id, uas_id, sizeof(uint8_t)*20);
301 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, (const char *)packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
302#endif
303}
304#endif
305
306#endif
307
308// MESSAGE OPEN_DRONE_ID_BASIC_ID UNPACKING
309
310
311/**
312 * @brief Get field target_system from open_drone_id_basic_id message
313 *
314 * @return System ID (0 for broadcast).
315 */
316static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_target_system(const mavlink_message_t* msg)
317{
318 return _MAV_RETURN_uint8_t(msg, 0);
319}
320
321/**
322 * @brief Get field target_component from open_drone_id_basic_id message
323 *
324 * @return Component ID (0 for broadcast).
325 */
326static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_target_component(const mavlink_message_t* msg)
327{
328 return _MAV_RETURN_uint8_t(msg, 1);
329}
330
331/**
332 * @brief Get field id_or_mac from open_drone_id_basic_id message
333 *
334 * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
335 */
336static inline uint16_t mavlink_msg_open_drone_id_basic_id_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
337{
338 return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 2);
339}
340
341/**
342 * @brief Get field id_type from open_drone_id_basic_id message
343 *
344 * @return Indicates the format for the uas_id field of this message.
345 */
346static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_id_type(const mavlink_message_t* msg)
347{
348 return _MAV_RETURN_uint8_t(msg, 22);
349}
350
351/**
352 * @brief Get field ua_type from open_drone_id_basic_id message
353 *
354 * @return Indicates the type of UA (Unmanned Aircraft).
355 */
356static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_ua_type(const mavlink_message_t* msg)
357{
358 return _MAV_RETURN_uint8_t(msg, 23);
359}
360
361/**
362 * @brief Get field uas_id from open_drone_id_basic_id message
363 *
364 * @return UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
365 */
366static inline uint16_t mavlink_msg_open_drone_id_basic_id_get_uas_id(const mavlink_message_t* msg, uint8_t *uas_id)
367{
368 return _MAV_RETURN_uint8_t_array(msg, uas_id, 20, 24);
369}
370
371/**
372 * @brief Decode a open_drone_id_basic_id message into a struct
373 *
374 * @param msg The message to decode
375 * @param open_drone_id_basic_id C-struct to decode the message contents into
376 */
377static inline void mavlink_msg_open_drone_id_basic_id_decode(const mavlink_message_t* msg, mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
378{
379#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
380 open_drone_id_basic_id->target_system = mavlink_msg_open_drone_id_basic_id_get_target_system(msg);
381 open_drone_id_basic_id->target_component = mavlink_msg_open_drone_id_basic_id_get_target_component(msg);
382 mavlink_msg_open_drone_id_basic_id_get_id_or_mac(msg, open_drone_id_basic_id->id_or_mac);
383 open_drone_id_basic_id->id_type = mavlink_msg_open_drone_id_basic_id_get_id_type(msg);
384 open_drone_id_basic_id->ua_type = mavlink_msg_open_drone_id_basic_id_get_ua_type(msg);
385 mavlink_msg_open_drone_id_basic_id_get_uas_id(msg, open_drone_id_basic_id->uas_id);
386#else
387 uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN;
388 memset(open_drone_id_basic_id, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
389 memcpy(open_drone_id_basic_id, _MAV_PAYLOAD(msg), len);
390#endif
391}