Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_open_drone_id_system.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE OPEN_DRONE_ID_SYSTEM PACKING
3
4#define MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM 12904
5
6
8 int32_t operator_latitude; /*< [degE7] Latitude of the operator. If unknown: 0 (both Lat/Lon).*/
9 int32_t operator_longitude; /*< [degE7] Longitude of the operator. If unknown: 0 (both Lat/Lon).*/
10 float area_ceiling; /*< [m] Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.*/
11 float area_floor; /*< [m] Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.*/
12 float operator_altitude_geo; /*< [m] Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.*/
13 uint32_t timestamp; /*< [s] 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.*/
14 uint16_t area_count; /*< Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.*/
15 uint16_t area_radius; /*< [m] Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.*/
16 uint8_t target_system; /*< System ID (0 for broadcast).*/
17 uint8_t target_component; /*< Component ID (0 for broadcast).*/
18 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. */
19 uint8_t operator_location_type; /*< Specifies the operator location type.*/
20 uint8_t classification_type; /*< Specifies the classification type of the UA.*/
21 uint8_t category_eu; /*< When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.*/
22 uint8_t class_eu; /*< When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.*/
23} mavlink_open_drone_id_system_t;
24
25#define MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN 54
26#define MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN 54
27#define MAVLINK_MSG_ID_12904_LEN 54
28#define MAVLINK_MSG_ID_12904_MIN_LEN 54
29
30#define MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC 77
31#define MAVLINK_MSG_ID_12904_CRC 77
32
33#define MAVLINK_MSG_OPEN_DRONE_ID_SYSTEM_FIELD_ID_OR_MAC_LEN 20
34
35#if MAVLINK_COMMAND_24BIT
36#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_SYSTEM {
37 12904,
38 "OPEN_DRONE_ID_SYSTEM",
39 15,
40 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_open_drone_id_system_t, target_system) },
41 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_open_drone_id_system_t, target_component) },
42 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 30, offsetof(mavlink_open_drone_id_system_t, id_or_mac) },
43 { "operator_location_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_open_drone_id_system_t, operator_location_type) },
44 { "classification_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_open_drone_id_system_t, classification_type) },
45 { "operator_latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_open_drone_id_system_t, operator_latitude) },
46 { "operator_longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_open_drone_id_system_t, operator_longitude) },
47 { "area_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_open_drone_id_system_t, area_count) },
48 { "area_radius", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_open_drone_id_system_t, area_radius) },
49 { "area_ceiling", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_open_drone_id_system_t, area_ceiling) },
50 { "area_floor", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_open_drone_id_system_t, area_floor) },
51 { "category_eu", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_open_drone_id_system_t, category_eu) },
52 { "class_eu", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_open_drone_id_system_t, class_eu) },
53 { "operator_altitude_geo", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_open_drone_id_system_t, operator_altitude_geo) },
54 { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_open_drone_id_system_t, timestamp) },
55 } \
56}
57#else
58#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_SYSTEM {
59 "OPEN_DRONE_ID_SYSTEM",
60 15,
61 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_open_drone_id_system_t, target_system) },
62 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_open_drone_id_system_t, target_component) },
63 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 30, offsetof(mavlink_open_drone_id_system_t, id_or_mac) },
64 { "operator_location_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 50, offsetof(mavlink_open_drone_id_system_t, operator_location_type) },
65 { "classification_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 51, offsetof(mavlink_open_drone_id_system_t, classification_type) },
66 { "operator_latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_open_drone_id_system_t, operator_latitude) },
67 { "operator_longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_open_drone_id_system_t, operator_longitude) },
68 { "area_count", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_open_drone_id_system_t, area_count) },
69 { "area_radius", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_open_drone_id_system_t, area_radius) },
70 { "area_ceiling", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_open_drone_id_system_t, area_ceiling) },
71 { "area_floor", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_open_drone_id_system_t, area_floor) },
72 { "category_eu", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_open_drone_id_system_t, category_eu) },
73 { "class_eu", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_open_drone_id_system_t, class_eu) },
74 { "operator_altitude_geo", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_open_drone_id_system_t, operator_altitude_geo) },
75 { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 20, offsetof(mavlink_open_drone_id_system_t, timestamp) },
76 } \
77}
78#endif
79
80/**
81 * @brief Pack a open_drone_id_system message
82 * @param system_id ID of this system
83 * @param component_id ID of this component (e.g. 200 for IMU)
84 * @param msg The MAVLink message to compress the data into
85 *
86 * @param target_system System ID (0 for broadcast).
87 * @param target_component Component ID (0 for broadcast).
88 * @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.
89 * @param operator_location_type Specifies the operator location type.
90 * @param classification_type Specifies the classification type of the UA.
91 * @param operator_latitude [degE7] Latitude of the operator. If unknown: 0 (both Lat/Lon).
92 * @param operator_longitude [degE7] Longitude of the operator. If unknown: 0 (both Lat/Lon).
93 * @param area_count Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.
94 * @param area_radius [m] Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.
95 * @param area_ceiling [m] Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
96 * @param area_floor [m] Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
97 * @param category_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.
98 * @param class_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.
99 * @param operator_altitude_geo [m] Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.
100 * @param timestamp [s] 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
101 * @return length of the message in bytes (excluding serial stream start sign)
102 */
103static inline uint16_t mavlink_msg_open_drone_id_system_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
104 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t operator_location_type, uint8_t classification_type, int32_t operator_latitude, int32_t operator_longitude, uint16_t area_count, uint16_t area_radius, float area_ceiling, float area_floor, uint8_t category_eu, uint8_t class_eu, float operator_altitude_geo, uint32_t timestamp)
105{
106#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
108 _mav_put_int32_t(buf, 0, operator_latitude);
109 _mav_put_int32_t(buf, 4, operator_longitude);
110 _mav_put_float(buf, 8, area_ceiling);
111 _mav_put_float(buf, 12, area_floor);
112 _mav_put_float(buf, 16, operator_altitude_geo);
113 _mav_put_uint32_t(buf, 20, timestamp);
114 _mav_put_uint16_t(buf, 24, area_count);
115 _mav_put_uint16_t(buf, 26, area_radius);
116 _mav_put_uint8_t(buf, 28, target_system);
117 _mav_put_uint8_t(buf, 29, target_component);
118 _mav_put_uint8_t(buf, 50, operator_location_type);
119 _mav_put_uint8_t(buf, 51, classification_type);
120 _mav_put_uint8_t(buf, 52, category_eu);
121 _mav_put_uint8_t(buf, 53, class_eu);
122 _mav_put_uint8_t_array(buf, 30, id_or_mac, 20);
123 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
124#else
125 mavlink_open_drone_id_system_t packet;
126 packet.operator_latitude = operator_latitude;
127 packet.operator_longitude = operator_longitude;
128 packet.area_ceiling = area_ceiling;
129 packet.area_floor = area_floor;
130 packet.operator_altitude_geo = operator_altitude_geo;
131 packet.timestamp = timestamp;
132 packet.area_count = area_count;
133 packet.area_radius = area_radius;
134 packet.target_system = target_system;
135 packet.target_component = target_component;
136 packet.operator_location_type = operator_location_type;
137 packet.classification_type = classification_type;
138 packet.category_eu = category_eu;
139 packet.class_eu = class_eu;
140 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
141 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
142#endif
143
146}
147
148/**
149 * @brief Pack a open_drone_id_system message
150 * @param system_id ID of this system
151 * @param component_id ID of this component (e.g. 200 for IMU)
152 * @param status MAVLink status structure
153 * @param msg The MAVLink message to compress the data into
154 *
155 * @param target_system System ID (0 for broadcast).
156 * @param target_component Component ID (0 for broadcast).
157 * @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.
158 * @param operator_location_type Specifies the operator location type.
159 * @param classification_type Specifies the classification type of the UA.
160 * @param operator_latitude [degE7] Latitude of the operator. If unknown: 0 (both Lat/Lon).
161 * @param operator_longitude [degE7] Longitude of the operator. If unknown: 0 (both Lat/Lon).
162 * @param area_count Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.
163 * @param area_radius [m] Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.
164 * @param area_ceiling [m] Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
165 * @param area_floor [m] Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
166 * @param category_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.
167 * @param class_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.
168 * @param operator_altitude_geo [m] Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.
169 * @param timestamp [s] 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
170 * @return length of the message in bytes (excluding serial stream start sign)
171 */
172static inline uint16_t mavlink_msg_open_drone_id_system_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
173 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t operator_location_type, uint8_t classification_type, int32_t operator_latitude, int32_t operator_longitude, uint16_t area_count, uint16_t area_radius, float area_ceiling, float area_floor, uint8_t category_eu, uint8_t class_eu, float operator_altitude_geo, uint32_t timestamp)
174{
175#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
177 _mav_put_int32_t(buf, 0, operator_latitude);
178 _mav_put_int32_t(buf, 4, operator_longitude);
179 _mav_put_float(buf, 8, area_ceiling);
180 _mav_put_float(buf, 12, area_floor);
181 _mav_put_float(buf, 16, operator_altitude_geo);
182 _mav_put_uint32_t(buf, 20, timestamp);
183 _mav_put_uint16_t(buf, 24, area_count);
184 _mav_put_uint16_t(buf, 26, area_radius);
185 _mav_put_uint8_t(buf, 28, target_system);
186 _mav_put_uint8_t(buf, 29, target_component);
187 _mav_put_uint8_t(buf, 50, operator_location_type);
188 _mav_put_uint8_t(buf, 51, classification_type);
189 _mav_put_uint8_t(buf, 52, category_eu);
190 _mav_put_uint8_t(buf, 53, class_eu);
191 _mav_put_uint8_t_array(buf, 30, id_or_mac, 20);
192 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
193#else
194 mavlink_open_drone_id_system_t packet;
195 packet.operator_latitude = operator_latitude;
196 packet.operator_longitude = operator_longitude;
197 packet.area_ceiling = area_ceiling;
198 packet.area_floor = area_floor;
199 packet.operator_altitude_geo = operator_altitude_geo;
200 packet.timestamp = timestamp;
201 packet.area_count = area_count;
202 packet.area_radius = area_radius;
203 packet.target_system = target_system;
204 packet.target_component = target_component;
205 packet.operator_location_type = operator_location_type;
206 packet.classification_type = classification_type;
207 packet.category_eu = category_eu;
208 packet.class_eu = class_eu;
209 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
210 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
211#endif
212
214#if MAVLINK_CRC_EXTRA
215 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC);
216#else
217 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
218#endif
219}
220
221/**
222 * @brief Pack a open_drone_id_system message on a channel
223 * @param system_id ID of this system
224 * @param component_id ID of this component (e.g. 200 for IMU)
225 * @param chan The MAVLink channel this message will be sent over
226 * @param msg The MAVLink message to compress the data into
227 * @param target_system System ID (0 for broadcast).
228 * @param target_component Component ID (0 for broadcast).
229 * @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.
230 * @param operator_location_type Specifies the operator location type.
231 * @param classification_type Specifies the classification type of the UA.
232 * @param operator_latitude [degE7] Latitude of the operator. If unknown: 0 (both Lat/Lon).
233 * @param operator_longitude [degE7] Longitude of the operator. If unknown: 0 (both Lat/Lon).
234 * @param area_count Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.
235 * @param area_radius [m] Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.
236 * @param area_ceiling [m] Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
237 * @param area_floor [m] Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
238 * @param category_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.
239 * @param class_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.
240 * @param operator_altitude_geo [m] Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.
241 * @param timestamp [s] 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
242 * @return length of the message in bytes (excluding serial stream start sign)
243 */
244static inline uint16_t mavlink_msg_open_drone_id_system_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
245 mavlink_message_t* msg,
246 uint8_t target_system,uint8_t target_component,const uint8_t *id_or_mac,uint8_t operator_location_type,uint8_t classification_type,int32_t operator_latitude,int32_t operator_longitude,uint16_t area_count,uint16_t area_radius,float area_ceiling,float area_floor,uint8_t category_eu,uint8_t class_eu,float operator_altitude_geo,uint32_t timestamp)
247{
248#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
250 _mav_put_int32_t(buf, 0, operator_latitude);
251 _mav_put_int32_t(buf, 4, operator_longitude);
252 _mav_put_float(buf, 8, area_ceiling);
253 _mav_put_float(buf, 12, area_floor);
254 _mav_put_float(buf, 16, operator_altitude_geo);
255 _mav_put_uint32_t(buf, 20, timestamp);
256 _mav_put_uint16_t(buf, 24, area_count);
257 _mav_put_uint16_t(buf, 26, area_radius);
258 _mav_put_uint8_t(buf, 28, target_system);
259 _mav_put_uint8_t(buf, 29, target_component);
260 _mav_put_uint8_t(buf, 50, operator_location_type);
261 _mav_put_uint8_t(buf, 51, classification_type);
262 _mav_put_uint8_t(buf, 52, category_eu);
263 _mav_put_uint8_t(buf, 53, class_eu);
264 _mav_put_uint8_t_array(buf, 30, id_or_mac, 20);
265 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
266#else
267 mavlink_open_drone_id_system_t packet;
268 packet.operator_latitude = operator_latitude;
269 packet.operator_longitude = operator_longitude;
270 packet.area_ceiling = area_ceiling;
271 packet.area_floor = area_floor;
272 packet.operator_altitude_geo = operator_altitude_geo;
273 packet.timestamp = timestamp;
274 packet.area_count = area_count;
275 packet.area_radius = area_radius;
276 packet.target_system = target_system;
277 packet.target_component = target_component;
278 packet.operator_location_type = operator_location_type;
279 packet.classification_type = classification_type;
280 packet.category_eu = category_eu;
281 packet.class_eu = class_eu;
282 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
283 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
284#endif
285
287 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC);
288}
289
290/**
291 * @brief Encode a open_drone_id_system struct
292 *
293 * @param system_id ID of this system
294 * @param component_id ID of this component (e.g. 200 for IMU)
295 * @param msg The MAVLink message to compress the data into
296 * @param open_drone_id_system C-struct to read the message contents from
297 */
298static inline uint16_t mavlink_msg_open_drone_id_system_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_open_drone_id_system_t* open_drone_id_system)
299{
300 return mavlink_msg_open_drone_id_system_pack(system_id, component_id, msg, open_drone_id_system->target_system, open_drone_id_system->target_component, open_drone_id_system->id_or_mac, open_drone_id_system->operator_location_type, open_drone_id_system->classification_type, open_drone_id_system->operator_latitude, open_drone_id_system->operator_longitude, open_drone_id_system->area_count, open_drone_id_system->area_radius, open_drone_id_system->area_ceiling, open_drone_id_system->area_floor, open_drone_id_system->category_eu, open_drone_id_system->class_eu, open_drone_id_system->operator_altitude_geo, open_drone_id_system->timestamp);
301}
302
303/**
304 * @brief Encode a open_drone_id_system struct on a channel
305 *
306 * @param system_id ID of this system
307 * @param component_id ID of this component (e.g. 200 for IMU)
308 * @param chan The MAVLink channel this message will be sent over
309 * @param msg The MAVLink message to compress the data into
310 * @param open_drone_id_system C-struct to read the message contents from
311 */
312static inline uint16_t mavlink_msg_open_drone_id_system_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_open_drone_id_system_t* open_drone_id_system)
313{
314 return mavlink_msg_open_drone_id_system_pack_chan(system_id, component_id, chan, msg, open_drone_id_system->target_system, open_drone_id_system->target_component, open_drone_id_system->id_or_mac, open_drone_id_system->operator_location_type, open_drone_id_system->classification_type, open_drone_id_system->operator_latitude, open_drone_id_system->operator_longitude, open_drone_id_system->area_count, open_drone_id_system->area_radius, open_drone_id_system->area_ceiling, open_drone_id_system->area_floor, open_drone_id_system->category_eu, open_drone_id_system->class_eu, open_drone_id_system->operator_altitude_geo, open_drone_id_system->timestamp);
315}
316
317/**
318 * @brief Encode a open_drone_id_system struct with provided status structure
319 *
320 * @param system_id ID of this system
321 * @param component_id ID of this component (e.g. 200 for IMU)
322 * @param status MAVLink status structure
323 * @param msg The MAVLink message to compress the data into
324 * @param open_drone_id_system C-struct to read the message contents from
325 */
326static inline uint16_t mavlink_msg_open_drone_id_system_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_open_drone_id_system_t* open_drone_id_system)
327{
328 return mavlink_msg_open_drone_id_system_pack_status(system_id, component_id, _status, msg, open_drone_id_system->target_system, open_drone_id_system->target_component, open_drone_id_system->id_or_mac, open_drone_id_system->operator_location_type, open_drone_id_system->classification_type, open_drone_id_system->operator_latitude, open_drone_id_system->operator_longitude, open_drone_id_system->area_count, open_drone_id_system->area_radius, open_drone_id_system->area_ceiling, open_drone_id_system->area_floor, open_drone_id_system->category_eu, open_drone_id_system->class_eu, open_drone_id_system->operator_altitude_geo, open_drone_id_system->timestamp);
329}
330
331/**
332 * @brief Send a open_drone_id_system message
333 * @param chan MAVLink channel to send the message
334 *
335 * @param target_system System ID (0 for broadcast).
336 * @param target_component Component ID (0 for broadcast).
337 * @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.
338 * @param operator_location_type Specifies the operator location type.
339 * @param classification_type Specifies the classification type of the UA.
340 * @param operator_latitude [degE7] Latitude of the operator. If unknown: 0 (both Lat/Lon).
341 * @param operator_longitude [degE7] Longitude of the operator. If unknown: 0 (both Lat/Lon).
342 * @param area_count Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.
343 * @param area_radius [m] Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.
344 * @param area_ceiling [m] Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
345 * @param area_floor [m] Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
346 * @param category_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.
347 * @param class_eu When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.
348 * @param operator_altitude_geo [m] Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.
349 * @param timestamp [s] 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
350 */
351#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
352
353static inline void mavlink_msg_open_drone_id_system_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t operator_location_type, uint8_t classification_type, int32_t operator_latitude, int32_t operator_longitude, uint16_t area_count, uint16_t area_radius, float area_ceiling, float area_floor, uint8_t category_eu, uint8_t class_eu, float operator_altitude_geo, uint32_t timestamp)
354{
355#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
356 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN];
357 _mav_put_int32_t(buf, 0, operator_latitude);
358 _mav_put_int32_t(buf, 4, operator_longitude);
359 _mav_put_float(buf, 8, area_ceiling);
360 _mav_put_float(buf, 12, area_floor);
361 _mav_put_float(buf, 16, operator_altitude_geo);
362 _mav_put_uint32_t(buf, 20, timestamp);
363 _mav_put_uint16_t(buf, 24, area_count);
364 _mav_put_uint16_t(buf, 26, area_radius);
365 _mav_put_uint8_t(buf, 28, target_system);
366 _mav_put_uint8_t(buf, 29, target_component);
367 _mav_put_uint8_t(buf, 50, operator_location_type);
368 _mav_put_uint8_t(buf, 51, classification_type);
369 _mav_put_uint8_t(buf, 52, category_eu);
370 _mav_put_uint8_t(buf, 53, class_eu);
371 _mav_put_uint8_t_array(buf, 30, id_or_mac, 20);
372 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC);
373#else
374 mavlink_open_drone_id_system_t packet;
375 packet.operator_latitude = operator_latitude;
376 packet.operator_longitude = operator_longitude;
377 packet.area_ceiling = area_ceiling;
378 packet.area_floor = area_floor;
379 packet.operator_altitude_geo = operator_altitude_geo;
380 packet.timestamp = timestamp;
381 packet.area_count = area_count;
382 packet.area_radius = area_radius;
383 packet.target_system = target_system;
384 packet.target_component = target_component;
385 packet.operator_location_type = operator_location_type;
386 packet.classification_type = classification_type;
387 packet.category_eu = category_eu;
388 packet.class_eu = class_eu;
389 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
390 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM, (const char *)&packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC);
391#endif
392}
393
394/**
395 * @brief Send a open_drone_id_system message
396 * @param chan MAVLink channel to send the message
397 * @param struct The MAVLink struct to serialize
398 */
399static inline void mavlink_msg_open_drone_id_system_send_struct(mavlink_channel_t chan, const mavlink_open_drone_id_system_t* open_drone_id_system)
400{
401#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
402 mavlink_msg_open_drone_id_system_send(chan, open_drone_id_system->target_system, open_drone_id_system->target_component, open_drone_id_system->id_or_mac, open_drone_id_system->operator_location_type, open_drone_id_system->classification_type, open_drone_id_system->operator_latitude, open_drone_id_system->operator_longitude, open_drone_id_system->area_count, open_drone_id_system->area_radius, open_drone_id_system->area_ceiling, open_drone_id_system->area_floor, open_drone_id_system->category_eu, open_drone_id_system->class_eu, open_drone_id_system->operator_altitude_geo, open_drone_id_system->timestamp);
403#else
404 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM, (const char *)open_drone_id_system, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC);
405#endif
406}
407
408#if MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN <= MAVLINK_MAX_PAYLOAD_LEN
409/*
410 This variant of _send() can be used to save stack space by reusing
411 memory from the receive buffer. The caller provides a
412 mavlink_message_t which is the size of a full mavlink message. This
413 is usually the receive buffer for the channel, and allows a reply to an
414 incoming message with minimum stack space usage.
415 */
416static inline void mavlink_msg_open_drone_id_system_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 operator_location_type, uint8_t classification_type, int32_t operator_latitude, int32_t operator_longitude, uint16_t area_count, uint16_t area_radius, float area_ceiling, float area_floor, uint8_t category_eu, uint8_t class_eu, float operator_altitude_geo, uint32_t timestamp)
417{
418#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
419 char *buf = (char *)msgbuf;
420 _mav_put_int32_t(buf, 0, operator_latitude);
421 _mav_put_int32_t(buf, 4, operator_longitude);
422 _mav_put_float(buf, 8, area_ceiling);
423 _mav_put_float(buf, 12, area_floor);
424 _mav_put_float(buf, 16, operator_altitude_geo);
425 _mav_put_uint32_t(buf, 20, timestamp);
426 _mav_put_uint16_t(buf, 24, area_count);
427 _mav_put_uint16_t(buf, 26, area_radius);
428 _mav_put_uint8_t(buf, 28, target_system);
429 _mav_put_uint8_t(buf, 29, target_component);
430 _mav_put_uint8_t(buf, 50, operator_location_type);
431 _mav_put_uint8_t(buf, 51, classification_type);
432 _mav_put_uint8_t(buf, 52, category_eu);
433 _mav_put_uint8_t(buf, 53, class_eu);
434 _mav_put_uint8_t_array(buf, 30, id_or_mac, 20);
435 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC);
436#else
437 mavlink_open_drone_id_system_t *packet = (mavlink_open_drone_id_system_t *)msgbuf;
438 packet->operator_latitude = operator_latitude;
439 packet->operator_longitude = operator_longitude;
440 packet->area_ceiling = area_ceiling;
441 packet->area_floor = area_floor;
442 packet->operator_altitude_geo = operator_altitude_geo;
443 packet->timestamp = timestamp;
444 packet->area_count = area_count;
445 packet->area_radius = area_radius;
446 packet->target_system = target_system;
447 packet->target_component = target_component;
448 packet->operator_location_type = operator_location_type;
449 packet->classification_type = classification_type;
450 packet->category_eu = category_eu;
451 packet->class_eu = class_eu;
452 mav_array_memcpy(packet->id_or_mac, id_or_mac, sizeof(uint8_t)*20);
453 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM, (const char *)packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_CRC);
454#endif
455}
456#endif
457
458#endif
459
460// MESSAGE OPEN_DRONE_ID_SYSTEM UNPACKING
461
462
463/**
464 * @brief Get field target_system from open_drone_id_system message
465 *
466 * @return System ID (0 for broadcast).
467 */
468static inline uint8_t mavlink_msg_open_drone_id_system_get_target_system(const mavlink_message_t* msg)
469{
470 return _MAV_RETURN_uint8_t(msg, 28);
471}
472
473/**
474 * @brief Get field target_component from open_drone_id_system message
475 *
476 * @return Component ID (0 for broadcast).
477 */
478static inline uint8_t mavlink_msg_open_drone_id_system_get_target_component(const mavlink_message_t* msg)
479{
480 return _MAV_RETURN_uint8_t(msg, 29);
481}
482
483/**
484 * @brief Get field id_or_mac from open_drone_id_system message
485 *
486 * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
487 */
488static inline uint16_t mavlink_msg_open_drone_id_system_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
489{
490 return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 30);
491}
492
493/**
494 * @brief Get field operator_location_type from open_drone_id_system message
495 *
496 * @return Specifies the operator location type.
497 */
498static inline uint8_t mavlink_msg_open_drone_id_system_get_operator_location_type(const mavlink_message_t* msg)
499{
500 return _MAV_RETURN_uint8_t(msg, 50);
501}
502
503/**
504 * @brief Get field classification_type from open_drone_id_system message
505 *
506 * @return Specifies the classification type of the UA.
507 */
508static inline uint8_t mavlink_msg_open_drone_id_system_get_classification_type(const mavlink_message_t* msg)
509{
510 return _MAV_RETURN_uint8_t(msg, 51);
511}
512
513/**
514 * @brief Get field operator_latitude from open_drone_id_system message
515 *
516 * @return [degE7] Latitude of the operator. If unknown: 0 (both Lat/Lon).
517 */
518static inline int32_t mavlink_msg_open_drone_id_system_get_operator_latitude(const mavlink_message_t* msg)
519{
520 return _MAV_RETURN_int32_t(msg, 0);
521}
522
523/**
524 * @brief Get field operator_longitude from open_drone_id_system message
525 *
526 * @return [degE7] Longitude of the operator. If unknown: 0 (both Lat/Lon).
527 */
528static inline int32_t mavlink_msg_open_drone_id_system_get_operator_longitude(const mavlink_message_t* msg)
529{
530 return _MAV_RETURN_int32_t(msg, 4);
531}
532
533/**
534 * @brief Get field area_count from open_drone_id_system message
535 *
536 * @return Number of aircraft in the area, group or formation (default 1). Used only for swarms/multiple UA.
537 */
538static inline uint16_t mavlink_msg_open_drone_id_system_get_area_count(const mavlink_message_t* msg)
539{
540 return _MAV_RETURN_uint16_t(msg, 24);
541}
542
543/**
544 * @brief Get field area_radius from open_drone_id_system message
545 *
546 * @return [m] Radius of the cylindrical area of the group or formation (default 0). Used only for swarms/multiple UA.
547 */
548static inline uint16_t mavlink_msg_open_drone_id_system_get_area_radius(const mavlink_message_t* msg)
549{
550 return _MAV_RETURN_uint16_t(msg, 26);
551}
552
553/**
554 * @brief Get field area_ceiling from open_drone_id_system message
555 *
556 * @return [m] Area Operations Ceiling relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
557 */
558static inline float mavlink_msg_open_drone_id_system_get_area_ceiling(const mavlink_message_t* msg)
559{
560 return _MAV_RETURN_float(msg, 8);
561}
562
563/**
564 * @brief Get field area_floor from open_drone_id_system message
565 *
566 * @return [m] Area Operations Floor relative to WGS84. If unknown: -1000 m. Used only for swarms/multiple UA.
567 */
568static inline float mavlink_msg_open_drone_id_system_get_area_floor(const mavlink_message_t* msg)
569{
570 return _MAV_RETURN_float(msg, 12);
571}
572
573/**
574 * @brief Get field category_eu from open_drone_id_system message
575 *
576 * @return When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the category of the UA.
577 */
578static inline uint8_t mavlink_msg_open_drone_id_system_get_category_eu(const mavlink_message_t* msg)
579{
580 return _MAV_RETURN_uint8_t(msg, 52);
581}
582
583/**
584 * @brief Get field class_eu from open_drone_id_system message
585 *
586 * @return When classification_type is MAV_ODID_CLASSIFICATION_TYPE_EU, specifies the class of the UA.
587 */
588static inline uint8_t mavlink_msg_open_drone_id_system_get_class_eu(const mavlink_message_t* msg)
589{
590 return _MAV_RETURN_uint8_t(msg, 53);
591}
592
593/**
594 * @brief Get field operator_altitude_geo from open_drone_id_system message
595 *
596 * @return [m] Geodetic altitude of the operator relative to WGS84. If unknown: -1000 m.
597 */
598static inline float mavlink_msg_open_drone_id_system_get_operator_altitude_geo(const mavlink_message_t* msg)
599{
600 return _MAV_RETURN_float(msg, 16);
601}
602
603/**
604 * @brief Get field timestamp from open_drone_id_system message
605 *
606 * @return [s] 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
607 */
608static inline uint32_t mavlink_msg_open_drone_id_system_get_timestamp(const mavlink_message_t* msg)
609{
610 return _MAV_RETURN_uint32_t(msg, 20);
611}
612
613/**
614 * @brief Decode a open_drone_id_system message into a struct
615 *
616 * @param msg The message to decode
617 * @param open_drone_id_system C-struct to decode the message contents into
618 */
619static inline void mavlink_msg_open_drone_id_system_decode(const mavlink_message_t* msg, mavlink_open_drone_id_system_t* open_drone_id_system)
620{
621#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
622 open_drone_id_system->operator_latitude = mavlink_msg_open_drone_id_system_get_operator_latitude(msg);
623 open_drone_id_system->operator_longitude = mavlink_msg_open_drone_id_system_get_operator_longitude(msg);
624 open_drone_id_system->area_ceiling = mavlink_msg_open_drone_id_system_get_area_ceiling(msg);
625 open_drone_id_system->area_floor = mavlink_msg_open_drone_id_system_get_area_floor(msg);
626 open_drone_id_system->operator_altitude_geo = mavlink_msg_open_drone_id_system_get_operator_altitude_geo(msg);
627 open_drone_id_system->timestamp = mavlink_msg_open_drone_id_system_get_timestamp(msg);
628 open_drone_id_system->area_count = mavlink_msg_open_drone_id_system_get_area_count(msg);
629 open_drone_id_system->area_radius = mavlink_msg_open_drone_id_system_get_area_radius(msg);
630 open_drone_id_system->target_system = mavlink_msg_open_drone_id_system_get_target_system(msg);
631 open_drone_id_system->target_component = mavlink_msg_open_drone_id_system_get_target_component(msg);
632 mavlink_msg_open_drone_id_system_get_id_or_mac(msg, open_drone_id_system->id_or_mac);
633 open_drone_id_system->operator_location_type = mavlink_msg_open_drone_id_system_get_operator_location_type(msg);
634 open_drone_id_system->classification_type = mavlink_msg_open_drone_id_system_get_classification_type(msg);
635 open_drone_id_system->category_eu = mavlink_msg_open_drone_id_system_get_category_eu(msg);
636 open_drone_id_system->class_eu = mavlink_msg_open_drone_id_system_get_class_eu(msg);
637#else
638 uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN;
639 memset(open_drone_id_system, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_SYSTEM_LEN);
640 memcpy(open_drone_id_system, _MAV_PAYLOAD(msg), len);
641#endif
642}