Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_open_drone_id_authentication.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE OPEN_DRONE_ID_AUTHENTICATION PACKING
3
4#define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION 12902
5
6
8 uint32_t timestamp; /*< [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.*/
9 uint8_t target_system; /*< System ID (0 for broadcast).*/
10 uint8_t target_component; /*< Component ID (0 for broadcast).*/
11 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. */
12 uint8_t authentication_type; /*< Indicates the type of authentication.*/
13 uint8_t data_page; /*< Allowed range is 0 - 15.*/
14 uint8_t last_page_index; /*< This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.*/
15 uint8_t length; /*< [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.*/
16 uint8_t authentication_data[23]; /*< Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.*/
17} mavlink_open_drone_id_authentication_t;
18
19#define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN 53
20#define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN 53
21#define MAVLINK_MSG_ID_12902_LEN 53
22#define MAVLINK_MSG_ID_12902_MIN_LEN 53
23
24#define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC 140
25#define MAVLINK_MSG_ID_12902_CRC 140
26
27#define MAVLINK_MSG_OPEN_DRONE_ID_AUTHENTICATION_FIELD_ID_OR_MAC_LEN 20
28#define MAVLINK_MSG_OPEN_DRONE_ID_AUTHENTICATION_FIELD_AUTHENTICATION_DATA_LEN 23
29
30#if MAVLINK_COMMAND_24BIT
31#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_AUTHENTICATION {
32 12902,
33 "OPEN_DRONE_ID_AUTHENTICATION",
34 9,
35 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_open_drone_id_authentication_t, target_system) },
36 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_open_drone_id_authentication_t, target_component) },
37 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 6, offsetof(mavlink_open_drone_id_authentication_t, id_or_mac) },
38 { "authentication_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_open_drone_id_authentication_t, authentication_type) },
39 { "data_page", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_open_drone_id_authentication_t, data_page) },
40 { "last_page_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_open_drone_id_authentication_t, last_page_index) },
41 { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_open_drone_id_authentication_t, length) },
42 { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_open_drone_id_authentication_t, timestamp) },
43 { "authentication_data", NULL, MAVLINK_TYPE_UINT8_T, 23, 30, offsetof(mavlink_open_drone_id_authentication_t, authentication_data) },
44 } \
45}
46#else
47#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_AUTHENTICATION {
48 "OPEN_DRONE_ID_AUTHENTICATION",
49 9,
50 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_open_drone_id_authentication_t, target_system) },
51 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_open_drone_id_authentication_t, target_component) },
52 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 6, offsetof(mavlink_open_drone_id_authentication_t, id_or_mac) },
53 { "authentication_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_open_drone_id_authentication_t, authentication_type) },
54 { "data_page", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_open_drone_id_authentication_t, data_page) },
55 { "last_page_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_open_drone_id_authentication_t, last_page_index) },
56 { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_open_drone_id_authentication_t, length) },
57 { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_open_drone_id_authentication_t, timestamp) },
58 { "authentication_data", NULL, MAVLINK_TYPE_UINT8_T, 23, 30, offsetof(mavlink_open_drone_id_authentication_t, authentication_data) },
59 } \
60}
61#endif
62
63/**
64 * @brief Pack a open_drone_id_authentication message
65 * @param system_id ID of this system
66 * @param component_id ID of this component (e.g. 200 for IMU)
67 * @param msg The MAVLink message to compress the data into
68 *
69 * @param target_system System ID (0 for broadcast).
70 * @param target_component Component ID (0 for broadcast).
71 * @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.
72 * @param authentication_type Indicates the type of authentication.
73 * @param data_page Allowed range is 0 - 15.
74 * @param last_page_index This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
75 * @param length [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
76 * @param timestamp [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
77 * @param authentication_data Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
78 * @return length of the message in bytes (excluding serial stream start sign)
79 */
80static inline uint16_t mavlink_msg_open_drone_id_authentication_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
81 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t authentication_type, uint8_t data_page, uint8_t last_page_index, uint8_t length, uint32_t timestamp, const uint8_t *authentication_data)
82{
83#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
85 _mav_put_uint32_t(buf, 0, timestamp);
86 _mav_put_uint8_t(buf, 4, target_system);
87 _mav_put_uint8_t(buf, 5, target_component);
88 _mav_put_uint8_t(buf, 26, authentication_type);
89 _mav_put_uint8_t(buf, 27, data_page);
90 _mav_put_uint8_t(buf, 28, last_page_index);
91 _mav_put_uint8_t(buf, 29, length);
92 _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
93 _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
94 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
95#else
96 mavlink_open_drone_id_authentication_t packet;
97 packet.timestamp = timestamp;
98 packet.target_system = target_system;
99 packet.target_component = target_component;
100 packet.authentication_type = authentication_type;
101 packet.data_page = data_page;
102 packet.last_page_index = last_page_index;
103 packet.length = length;
104 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
105 mav_array_memcpy(packet.authentication_data, authentication_data, sizeof(uint8_t)*23);
106 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
107#endif
108
111}
112
113/**
114 * @brief Pack a open_drone_id_authentication message
115 * @param system_id ID of this system
116 * @param component_id ID of this component (e.g. 200 for IMU)
117 * @param status MAVLink status structure
118 * @param msg The MAVLink message to compress the data into
119 *
120 * @param target_system System ID (0 for broadcast).
121 * @param target_component Component ID (0 for broadcast).
122 * @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.
123 * @param authentication_type Indicates the type of authentication.
124 * @param data_page Allowed range is 0 - 15.
125 * @param last_page_index This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
126 * @param length [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
127 * @param timestamp [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
128 * @param authentication_data Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
129 * @return length of the message in bytes (excluding serial stream start sign)
130 */
131static inline uint16_t mavlink_msg_open_drone_id_authentication_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
132 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t authentication_type, uint8_t data_page, uint8_t last_page_index, uint8_t length, uint32_t timestamp, const uint8_t *authentication_data)
133{
134#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
136 _mav_put_uint32_t(buf, 0, timestamp);
137 _mav_put_uint8_t(buf, 4, target_system);
138 _mav_put_uint8_t(buf, 5, target_component);
139 _mav_put_uint8_t(buf, 26, authentication_type);
140 _mav_put_uint8_t(buf, 27, data_page);
141 _mav_put_uint8_t(buf, 28, last_page_index);
142 _mav_put_uint8_t(buf, 29, length);
143 _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
144 _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
145 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
146#else
147 mavlink_open_drone_id_authentication_t packet;
148 packet.timestamp = timestamp;
149 packet.target_system = target_system;
150 packet.target_component = target_component;
151 packet.authentication_type = authentication_type;
152 packet.data_page = data_page;
153 packet.last_page_index = last_page_index;
154 packet.length = length;
155 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
156 mav_array_memcpy(packet.authentication_data, authentication_data, sizeof(uint8_t)*23);
157 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
158#endif
159
161#if MAVLINK_CRC_EXTRA
162 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
163#else
164 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
165#endif
166}
167
168/**
169 * @brief Pack a open_drone_id_authentication message on a channel
170 * @param system_id ID of this system
171 * @param component_id ID of this component (e.g. 200 for IMU)
172 * @param chan The MAVLink channel this message will be sent over
173 * @param msg The MAVLink message to compress the data into
174 * @param target_system System ID (0 for broadcast).
175 * @param target_component Component ID (0 for broadcast).
176 * @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.
177 * @param authentication_type Indicates the type of authentication.
178 * @param data_page Allowed range is 0 - 15.
179 * @param last_page_index This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
180 * @param length [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
181 * @param timestamp [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
182 * @param authentication_data Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
183 * @return length of the message in bytes (excluding serial stream start sign)
184 */
185static inline uint16_t mavlink_msg_open_drone_id_authentication_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
186 mavlink_message_t* msg,
187 uint8_t target_system,uint8_t target_component,const uint8_t *id_or_mac,uint8_t authentication_type,uint8_t data_page,uint8_t last_page_index,uint8_t length,uint32_t timestamp,const uint8_t *authentication_data)
188{
189#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
191 _mav_put_uint32_t(buf, 0, timestamp);
192 _mav_put_uint8_t(buf, 4, target_system);
193 _mav_put_uint8_t(buf, 5, target_component);
194 _mav_put_uint8_t(buf, 26, authentication_type);
195 _mav_put_uint8_t(buf, 27, data_page);
196 _mav_put_uint8_t(buf, 28, last_page_index);
197 _mav_put_uint8_t(buf, 29, length);
198 _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
199 _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
200 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
201#else
202 mavlink_open_drone_id_authentication_t packet;
203 packet.timestamp = timestamp;
204 packet.target_system = target_system;
205 packet.target_component = target_component;
206 packet.authentication_type = authentication_type;
207 packet.data_page = data_page;
208 packet.last_page_index = last_page_index;
209 packet.length = length;
210 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
211 mav_array_memcpy(packet.authentication_data, authentication_data, sizeof(uint8_t)*23);
212 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
213#endif
214
217}
218
219/**
220 * @brief Encode a open_drone_id_authentication struct
221 *
222 * @param system_id ID of this system
223 * @param component_id ID of this component (e.g. 200 for IMU)
224 * @param msg The MAVLink message to compress the data into
225 * @param open_drone_id_authentication C-struct to read the message contents from
226 */
227static inline uint16_t mavlink_msg_open_drone_id_authentication_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
228{
229 return mavlink_msg_open_drone_id_authentication_pack(system_id, component_id, msg, open_drone_id_authentication->target_system, open_drone_id_authentication->target_component, open_drone_id_authentication->id_or_mac, open_drone_id_authentication->authentication_type, open_drone_id_authentication->data_page, open_drone_id_authentication->last_page_index, open_drone_id_authentication->length, open_drone_id_authentication->timestamp, open_drone_id_authentication->authentication_data);
230}
231
232/**
233 * @brief Encode a open_drone_id_authentication struct on a channel
234 *
235 * @param system_id ID of this system
236 * @param component_id ID of this component (e.g. 200 for IMU)
237 * @param chan The MAVLink channel this message will be sent over
238 * @param msg The MAVLink message to compress the data into
239 * @param open_drone_id_authentication C-struct to read the message contents from
240 */
241static inline uint16_t mavlink_msg_open_drone_id_authentication_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
242{
243 return mavlink_msg_open_drone_id_authentication_pack_chan(system_id, component_id, chan, msg, open_drone_id_authentication->target_system, open_drone_id_authentication->target_component, open_drone_id_authentication->id_or_mac, open_drone_id_authentication->authentication_type, open_drone_id_authentication->data_page, open_drone_id_authentication->last_page_index, open_drone_id_authentication->length, open_drone_id_authentication->timestamp, open_drone_id_authentication->authentication_data);
244}
245
246/**
247 * @brief Encode a open_drone_id_authentication struct with provided status structure
248 *
249 * @param system_id ID of this system
250 * @param component_id ID of this component (e.g. 200 for IMU)
251 * @param status MAVLink status structure
252 * @param msg The MAVLink message to compress the data into
253 * @param open_drone_id_authentication C-struct to read the message contents from
254 */
255static inline uint16_t mavlink_msg_open_drone_id_authentication_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
256{
257 return mavlink_msg_open_drone_id_authentication_pack_status(system_id, component_id, _status, msg, open_drone_id_authentication->target_system, open_drone_id_authentication->target_component, open_drone_id_authentication->id_or_mac, open_drone_id_authentication->authentication_type, open_drone_id_authentication->data_page, open_drone_id_authentication->last_page_index, open_drone_id_authentication->length, open_drone_id_authentication->timestamp, open_drone_id_authentication->authentication_data);
258}
259
260/**
261 * @brief Send a open_drone_id_authentication message
262 * @param chan MAVLink channel to send the message
263 *
264 * @param target_system System ID (0 for broadcast).
265 * @param target_component Component ID (0 for broadcast).
266 * @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.
267 * @param authentication_type Indicates the type of authentication.
268 * @param data_page Allowed range is 0 - 15.
269 * @param last_page_index This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
270 * @param length [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
271 * @param timestamp [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
272 * @param authentication_data Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
273 */
274#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
275
276static inline void mavlink_msg_open_drone_id_authentication_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t authentication_type, uint8_t data_page, uint8_t last_page_index, uint8_t length, uint32_t timestamp, const uint8_t *authentication_data)
277{
278#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
279 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN];
280 _mav_put_uint32_t(buf, 0, timestamp);
281 _mav_put_uint8_t(buf, 4, target_system);
282 _mav_put_uint8_t(buf, 5, target_component);
283 _mav_put_uint8_t(buf, 26, authentication_type);
284 _mav_put_uint8_t(buf, 27, data_page);
285 _mav_put_uint8_t(buf, 28, last_page_index);
286 _mav_put_uint8_t(buf, 29, length);
287 _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
288 _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
289 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
290#else
291 mavlink_open_drone_id_authentication_t packet;
292 packet.timestamp = timestamp;
293 packet.target_system = target_system;
294 packet.target_component = target_component;
295 packet.authentication_type = authentication_type;
296 packet.data_page = data_page;
297 packet.last_page_index = last_page_index;
298 packet.length = length;
299 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
300 mav_array_memcpy(packet.authentication_data, authentication_data, sizeof(uint8_t)*23);
301 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, (const char *)&packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
302#endif
303}
304
305/**
306 * @brief Send a open_drone_id_authentication message
307 * @param chan MAVLink channel to send the message
308 * @param struct The MAVLink struct to serialize
309 */
310static inline void mavlink_msg_open_drone_id_authentication_send_struct(mavlink_channel_t chan, const mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
311{
312#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
313 mavlink_msg_open_drone_id_authentication_send(chan, open_drone_id_authentication->target_system, open_drone_id_authentication->target_component, open_drone_id_authentication->id_or_mac, open_drone_id_authentication->authentication_type, open_drone_id_authentication->data_page, open_drone_id_authentication->last_page_index, open_drone_id_authentication->length, open_drone_id_authentication->timestamp, open_drone_id_authentication->authentication_data);
314#else
315 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, (const char *)open_drone_id_authentication, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
316#endif
317}
318
319#if MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
320/*
321 This variant of _send() can be used to save stack space by reusing
322 memory from the receive buffer. The caller provides a
323 mavlink_message_t which is the size of a full mavlink message. This
324 is usually the receive buffer for the channel, and allows a reply to an
325 incoming message with minimum stack space usage.
326 */
327static inline void mavlink_msg_open_drone_id_authentication_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 authentication_type, uint8_t data_page, uint8_t last_page_index, uint8_t length, uint32_t timestamp, const uint8_t *authentication_data)
328{
329#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
330 char *buf = (char *)msgbuf;
331 _mav_put_uint32_t(buf, 0, timestamp);
332 _mav_put_uint8_t(buf, 4, target_system);
333 _mav_put_uint8_t(buf, 5, target_component);
334 _mav_put_uint8_t(buf, 26, authentication_type);
335 _mav_put_uint8_t(buf, 27, data_page);
336 _mav_put_uint8_t(buf, 28, last_page_index);
337 _mav_put_uint8_t(buf, 29, length);
338 _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
339 _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
340 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
341#else
342 mavlink_open_drone_id_authentication_t *packet = (mavlink_open_drone_id_authentication_t *)msgbuf;
343 packet->timestamp = timestamp;
344 packet->target_system = target_system;
345 packet->target_component = target_component;
346 packet->authentication_type = authentication_type;
347 packet->data_page = data_page;
348 packet->last_page_index = last_page_index;
349 packet->length = length;
350 mav_array_memcpy(packet->id_or_mac, id_or_mac, sizeof(uint8_t)*20);
351 mav_array_memcpy(packet->authentication_data, authentication_data, sizeof(uint8_t)*23);
352 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, (const char *)packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
353#endif
354}
355#endif
356
357#endif
358
359// MESSAGE OPEN_DRONE_ID_AUTHENTICATION UNPACKING
360
361
362/**
363 * @brief Get field target_system from open_drone_id_authentication message
364 *
365 * @return System ID (0 for broadcast).
366 */
367static inline uint8_t mavlink_msg_open_drone_id_authentication_get_target_system(const mavlink_message_t* msg)
368{
369 return _MAV_RETURN_uint8_t(msg, 4);
370}
371
372/**
373 * @brief Get field target_component from open_drone_id_authentication message
374 *
375 * @return Component ID (0 for broadcast).
376 */
377static inline uint8_t mavlink_msg_open_drone_id_authentication_get_target_component(const mavlink_message_t* msg)
378{
379 return _MAV_RETURN_uint8_t(msg, 5);
380}
381
382/**
383 * @brief Get field id_or_mac from open_drone_id_authentication message
384 *
385 * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
386 */
387static inline uint16_t mavlink_msg_open_drone_id_authentication_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
388{
389 return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 6);
390}
391
392/**
393 * @brief Get field authentication_type from open_drone_id_authentication message
394 *
395 * @return Indicates the type of authentication.
396 */
397static inline uint8_t mavlink_msg_open_drone_id_authentication_get_authentication_type(const mavlink_message_t* msg)
398{
399 return _MAV_RETURN_uint8_t(msg, 26);
400}
401
402/**
403 * @brief Get field data_page from open_drone_id_authentication message
404 *
405 * @return Allowed range is 0 - 15.
406 */
407static inline uint8_t mavlink_msg_open_drone_id_authentication_get_data_page(const mavlink_message_t* msg)
408{
409 return _MAV_RETURN_uint8_t(msg, 27);
410}
411
412/**
413 * @brief Get field last_page_index from open_drone_id_authentication message
414 *
415 * @return This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
416 */
417static inline uint8_t mavlink_msg_open_drone_id_authentication_get_last_page_index(const mavlink_message_t* msg)
418{
419 return _MAV_RETURN_uint8_t(msg, 28);
420}
421
422/**
423 * @brief Get field length from open_drone_id_authentication message
424 *
425 * @return [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
426 */
427static inline uint8_t mavlink_msg_open_drone_id_authentication_get_length(const mavlink_message_t* msg)
428{
429 return _MAV_RETURN_uint8_t(msg, 29);
430}
431
432/**
433 * @brief Get field timestamp from open_drone_id_authentication message
434 *
435 * @return [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
436 */
437static inline uint32_t mavlink_msg_open_drone_id_authentication_get_timestamp(const mavlink_message_t* msg)
438{
439 return _MAV_RETURN_uint32_t(msg, 0);
440}
441
442/**
443 * @brief Get field authentication_data from open_drone_id_authentication message
444 *
445 * @return Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
446 */
447static inline uint16_t mavlink_msg_open_drone_id_authentication_get_authentication_data(const mavlink_message_t* msg, uint8_t *authentication_data)
448{
449 return _MAV_RETURN_uint8_t_array(msg, authentication_data, 23, 30);
450}
451
452/**
453 * @brief Decode a open_drone_id_authentication message into a struct
454 *
455 * @param msg The message to decode
456 * @param open_drone_id_authentication C-struct to decode the message contents into
457 */
458static inline void mavlink_msg_open_drone_id_authentication_decode(const mavlink_message_t* msg, mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
459{
460#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
461 open_drone_id_authentication->timestamp = mavlink_msg_open_drone_id_authentication_get_timestamp(msg);
462 open_drone_id_authentication->target_system = mavlink_msg_open_drone_id_authentication_get_target_system(msg);
463 open_drone_id_authentication->target_component = mavlink_msg_open_drone_id_authentication_get_target_component(msg);
464 mavlink_msg_open_drone_id_authentication_get_id_or_mac(msg, open_drone_id_authentication->id_or_mac);
465 open_drone_id_authentication->authentication_type = mavlink_msg_open_drone_id_authentication_get_authentication_type(msg);
466 open_drone_id_authentication->data_page = mavlink_msg_open_drone_id_authentication_get_data_page(msg);
467 open_drone_id_authentication->last_page_index = mavlink_msg_open_drone_id_authentication_get_last_page_index(msg);
468 open_drone_id_authentication->length = mavlink_msg_open_drone_id_authentication_get_length(msg);
469 mavlink_msg_open_drone_id_authentication_get_authentication_data(msg, open_drone_id_authentication->authentication_data);
470#else
471 uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN;
472 memset(open_drone_id_authentication, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
473 memcpy(open_drone_id_authentication, _MAV_PAYLOAD(msg), len);
474#endif
475}