Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_open_drone_id_location.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE OPEN_DRONE_ID_LOCATION PACKING
3
4#define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION 12901
5
6
8 int32_t latitude; /*< [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).*/
9 int32_t longitude; /*< [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).*/
10 float altitude_barometric; /*< [m] The altitude calculated from the barometric pressure. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.*/
11 float altitude_geodetic; /*< [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.*/
12 float height; /*< [m] The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.*/
13 float timestamp; /*< [s] Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.*/
14 uint16_t direction; /*< [cdeg] Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.*/
15 uint16_t speed_horizontal; /*< [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.*/
16 int16_t speed_vertical; /*< [cm/s] The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.*/
17 uint8_t target_system; /*< System ID (0 for broadcast).*/
18 uint8_t target_component; /*< Component ID (0 for broadcast).*/
19 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. */
20 uint8_t status; /*< Indicates whether the unmanned aircraft is on the ground or in the air.*/
21 uint8_t height_reference; /*< Indicates the reference point for the height field.*/
22 uint8_t horizontal_accuracy; /*< The accuracy of the horizontal position.*/
23 uint8_t vertical_accuracy; /*< The accuracy of the vertical position.*/
24 uint8_t barometer_accuracy; /*< The accuracy of the barometric altitude.*/
25 uint8_t speed_accuracy; /*< The accuracy of the horizontal and vertical speed.*/
26 uint8_t timestamp_accuracy; /*< The accuracy of the timestamps.*/
27} mavlink_open_drone_id_location_t;
28
29#define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN 59
30#define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN 59
31#define MAVLINK_MSG_ID_12901_LEN 59
32#define MAVLINK_MSG_ID_12901_MIN_LEN 59
33
34#define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC 254
35#define MAVLINK_MSG_ID_12901_CRC 254
36
37#define MAVLINK_MSG_OPEN_DRONE_ID_LOCATION_FIELD_ID_OR_MAC_LEN 20
38
39#if MAVLINK_COMMAND_24BIT
40#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_LOCATION {
41 12901,
42 "OPEN_DRONE_ID_LOCATION",
43 19,
44 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_open_drone_id_location_t, target_system) },
45 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_open_drone_id_location_t, target_component) },
46 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 32, offsetof(mavlink_open_drone_id_location_t, id_or_mac) },
47 { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_open_drone_id_location_t, status) },
48 { "direction", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_open_drone_id_location_t, direction) },
49 { "speed_horizontal", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_open_drone_id_location_t, speed_horizontal) },
50 { "speed_vertical", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_open_drone_id_location_t, speed_vertical) },
51 { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_open_drone_id_location_t, latitude) },
52 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_open_drone_id_location_t, longitude) },
53 { "altitude_barometric", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_open_drone_id_location_t, altitude_barometric) },
54 { "altitude_geodetic", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_open_drone_id_location_t, altitude_geodetic) },
55 { "height_reference", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_open_drone_id_location_t, height_reference) },
56 { "height", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_open_drone_id_location_t, height) },
57 { "horizontal_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 54, offsetof(mavlink_open_drone_id_location_t, horizontal_accuracy) },
58 { "vertical_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 55, offsetof(mavlink_open_drone_id_location_t, vertical_accuracy) },
59 { "barometer_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 56, offsetof(mavlink_open_drone_id_location_t, barometer_accuracy) },
60 { "speed_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 57, offsetof(mavlink_open_drone_id_location_t, speed_accuracy) },
61 { "timestamp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_open_drone_id_location_t, timestamp) },
62 { "timestamp_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_open_drone_id_location_t, timestamp_accuracy) },
63 } \
64}
65#else
66#define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_LOCATION {
67 "OPEN_DRONE_ID_LOCATION",
68 19,
69 { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_open_drone_id_location_t, target_system) },
70 { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_open_drone_id_location_t, target_component) },
71 { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 32, offsetof(mavlink_open_drone_id_location_t, id_or_mac) },
72 { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_open_drone_id_location_t, status) },
73 { "direction", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_open_drone_id_location_t, direction) },
74 { "speed_horizontal", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_open_drone_id_location_t, speed_horizontal) },
75 { "speed_vertical", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_open_drone_id_location_t, speed_vertical) },
76 { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_open_drone_id_location_t, latitude) },
77 { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_open_drone_id_location_t, longitude) },
78 { "altitude_barometric", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_open_drone_id_location_t, altitude_barometric) },
79 { "altitude_geodetic", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_open_drone_id_location_t, altitude_geodetic) },
80 { "height_reference", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_open_drone_id_location_t, height_reference) },
81 { "height", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_open_drone_id_location_t, height) },
82 { "horizontal_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 54, offsetof(mavlink_open_drone_id_location_t, horizontal_accuracy) },
83 { "vertical_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 55, offsetof(mavlink_open_drone_id_location_t, vertical_accuracy) },
84 { "barometer_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 56, offsetof(mavlink_open_drone_id_location_t, barometer_accuracy) },
85 { "speed_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 57, offsetof(mavlink_open_drone_id_location_t, speed_accuracy) },
86 { "timestamp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_open_drone_id_location_t, timestamp) },
87 { "timestamp_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_open_drone_id_location_t, timestamp_accuracy) },
88 } \
89}
90#endif
91
92/**
93 * @brief Pack a open_drone_id_location message
94 * @param system_id ID of this system
95 * @param component_id ID of this component (e.g. 200 for IMU)
96 * @param msg The MAVLink message to compress the data into
97 *
98 * @param target_system System ID (0 for broadcast).
99 * @param target_component Component ID (0 for broadcast).
100 * @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.
101 * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
102 * @param direction [cdeg] Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.
103 * @param speed_horizontal [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.
104 * @param speed_vertical [cm/s] The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.
105 * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
106 * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
107 * @param altitude_barometric [m] The altitude calculated from the barometric pressure. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
108 * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
109 * @param height_reference Indicates the reference point for the height field.
110 * @param height [m] The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.
111 * @param horizontal_accuracy The accuracy of the horizontal position.
112 * @param vertical_accuracy The accuracy of the vertical position.
113 * @param barometer_accuracy The accuracy of the barometric altitude.
114 * @param speed_accuracy The accuracy of the horizontal and vertical speed.
115 * @param timestamp [s] Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.
116 * @param timestamp_accuracy The accuracy of the timestamps.
117 * @return length of the message in bytes (excluding serial stream start sign)
118 */
119static inline uint16_t mavlink_msg_open_drone_id_location_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
120 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t status, uint16_t direction, uint16_t speed_horizontal, int16_t speed_vertical, int32_t latitude, int32_t longitude, float altitude_barometric, float altitude_geodetic, uint8_t height_reference, float height, uint8_t horizontal_accuracy, uint8_t vertical_accuracy, uint8_t barometer_accuracy, uint8_t speed_accuracy, float timestamp, uint8_t timestamp_accuracy)
121{
122#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
124 _mav_put_int32_t(buf, 0, latitude);
125 _mav_put_int32_t(buf, 4, longitude);
126 _mav_put_float(buf, 8, altitude_barometric);
127 _mav_put_float(buf, 12, altitude_geodetic);
128 _mav_put_float(buf, 16, height);
129 _mav_put_float(buf, 20, timestamp);
130 _mav_put_uint16_t(buf, 24, direction);
131 _mav_put_uint16_t(buf, 26, speed_horizontal);
132 _mav_put_int16_t(buf, 28, speed_vertical);
133 _mav_put_uint8_t(buf, 30, target_system);
134 _mav_put_uint8_t(buf, 31, target_component);
135 _mav_put_uint8_t(buf, 52, status);
136 _mav_put_uint8_t(buf, 53, height_reference);
137 _mav_put_uint8_t(buf, 54, horizontal_accuracy);
138 _mav_put_uint8_t(buf, 55, vertical_accuracy);
139 _mav_put_uint8_t(buf, 56, barometer_accuracy);
140 _mav_put_uint8_t(buf, 57, speed_accuracy);
141 _mav_put_uint8_t(buf, 58, timestamp_accuracy);
142 _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
143 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
144#else
145 mavlink_open_drone_id_location_t packet;
146 packet.latitude = latitude;
147 packet.longitude = longitude;
148 packet.altitude_barometric = altitude_barometric;
149 packet.altitude_geodetic = altitude_geodetic;
150 packet.height = height;
151 packet.timestamp = timestamp;
152 packet.direction = direction;
153 packet.speed_horizontal = speed_horizontal;
154 packet.speed_vertical = speed_vertical;
155 packet.target_system = target_system;
156 packet.target_component = target_component;
157 packet.status = status;
158 packet.height_reference = height_reference;
159 packet.horizontal_accuracy = horizontal_accuracy;
160 packet.vertical_accuracy = vertical_accuracy;
161 packet.barometer_accuracy = barometer_accuracy;
162 packet.speed_accuracy = speed_accuracy;
163 packet.timestamp_accuracy = timestamp_accuracy;
164 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
165 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
166#endif
167
170}
171
172/**
173 * @brief Pack a open_drone_id_location message
174 * @param system_id ID of this system
175 * @param component_id ID of this component (e.g. 200 for IMU)
176 * @param status MAVLink status structure
177 * @param msg The MAVLink message to compress the data into
178 *
179 * @param target_system System ID (0 for broadcast).
180 * @param target_component Component ID (0 for broadcast).
181 * @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.
182 * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
183 * @param direction [cdeg] Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.
184 * @param speed_horizontal [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.
185 * @param speed_vertical [cm/s] The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.
186 * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
187 * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
188 * @param altitude_barometric [m] The altitude calculated from the barometric pressure. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
189 * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
190 * @param height_reference Indicates the reference point for the height field.
191 * @param height [m] The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.
192 * @param horizontal_accuracy The accuracy of the horizontal position.
193 * @param vertical_accuracy The accuracy of the vertical position.
194 * @param barometer_accuracy The accuracy of the barometric altitude.
195 * @param speed_accuracy The accuracy of the horizontal and vertical speed.
196 * @param timestamp [s] Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.
197 * @param timestamp_accuracy The accuracy of the timestamps.
198 * @return length of the message in bytes (excluding serial stream start sign)
199 */
200static inline uint16_t mavlink_msg_open_drone_id_location_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
201 uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t status, uint16_t direction, uint16_t speed_horizontal, int16_t speed_vertical, int32_t latitude, int32_t longitude, float altitude_barometric, float altitude_geodetic, uint8_t height_reference, float height, uint8_t horizontal_accuracy, uint8_t vertical_accuracy, uint8_t barometer_accuracy, uint8_t speed_accuracy, float timestamp, uint8_t timestamp_accuracy)
202{
203#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
205 _mav_put_int32_t(buf, 0, latitude);
206 _mav_put_int32_t(buf, 4, longitude);
207 _mav_put_float(buf, 8, altitude_barometric);
208 _mav_put_float(buf, 12, altitude_geodetic);
209 _mav_put_float(buf, 16, height);
210 _mav_put_float(buf, 20, timestamp);
211 _mav_put_uint16_t(buf, 24, direction);
212 _mav_put_uint16_t(buf, 26, speed_horizontal);
213 _mav_put_int16_t(buf, 28, speed_vertical);
214 _mav_put_uint8_t(buf, 30, target_system);
215 _mav_put_uint8_t(buf, 31, target_component);
216 _mav_put_uint8_t(buf, 52, status);
217 _mav_put_uint8_t(buf, 53, height_reference);
218 _mav_put_uint8_t(buf, 54, horizontal_accuracy);
219 _mav_put_uint8_t(buf, 55, vertical_accuracy);
220 _mav_put_uint8_t(buf, 56, barometer_accuracy);
221 _mav_put_uint8_t(buf, 57, speed_accuracy);
222 _mav_put_uint8_t(buf, 58, timestamp_accuracy);
223 _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
224 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
225#else
226 mavlink_open_drone_id_location_t packet;
227 packet.latitude = latitude;
228 packet.longitude = longitude;
229 packet.altitude_barometric = altitude_barometric;
230 packet.altitude_geodetic = altitude_geodetic;
231 packet.height = height;
232 packet.timestamp = timestamp;
233 packet.direction = direction;
234 packet.speed_horizontal = speed_horizontal;
235 packet.speed_vertical = speed_vertical;
236 packet.target_system = target_system;
237 packet.target_component = target_component;
238 packet.status = status;
239 packet.height_reference = height_reference;
240 packet.horizontal_accuracy = horizontal_accuracy;
241 packet.vertical_accuracy = vertical_accuracy;
242 packet.barometer_accuracy = barometer_accuracy;
243 packet.speed_accuracy = speed_accuracy;
244 packet.timestamp_accuracy = timestamp_accuracy;
245 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
246 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
247#endif
248
250#if MAVLINK_CRC_EXTRA
251 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC);
252#else
253 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
254#endif
255}
256
257/**
258 * @brief Pack a open_drone_id_location message on a channel
259 * @param system_id ID of this system
260 * @param component_id ID of this component (e.g. 200 for IMU)
261 * @param chan The MAVLink channel this message will be sent over
262 * @param msg The MAVLink message to compress the data into
263 * @param target_system System ID (0 for broadcast).
264 * @param target_component Component ID (0 for broadcast).
265 * @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.
266 * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
267 * @param direction [cdeg] Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.
268 * @param speed_horizontal [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.
269 * @param speed_vertical [cm/s] The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.
270 * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
271 * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
272 * @param altitude_barometric [m] The altitude calculated from the barometric pressure. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
273 * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
274 * @param height_reference Indicates the reference point for the height field.
275 * @param height [m] The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.
276 * @param horizontal_accuracy The accuracy of the horizontal position.
277 * @param vertical_accuracy The accuracy of the vertical position.
278 * @param barometer_accuracy The accuracy of the barometric altitude.
279 * @param speed_accuracy The accuracy of the horizontal and vertical speed.
280 * @param timestamp [s] Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.
281 * @param timestamp_accuracy The accuracy of the timestamps.
282 * @return length of the message in bytes (excluding serial stream start sign)
283 */
284static inline uint16_t mavlink_msg_open_drone_id_location_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
285 mavlink_message_t* msg,
286 uint8_t target_system,uint8_t target_component,const uint8_t *id_or_mac,uint8_t status,uint16_t direction,uint16_t speed_horizontal,int16_t speed_vertical,int32_t latitude,int32_t longitude,float altitude_barometric,float altitude_geodetic,uint8_t height_reference,float height,uint8_t horizontal_accuracy,uint8_t vertical_accuracy,uint8_t barometer_accuracy,uint8_t speed_accuracy,float timestamp,uint8_t timestamp_accuracy)
287{
288#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
290 _mav_put_int32_t(buf, 0, latitude);
291 _mav_put_int32_t(buf, 4, longitude);
292 _mav_put_float(buf, 8, altitude_barometric);
293 _mav_put_float(buf, 12, altitude_geodetic);
294 _mav_put_float(buf, 16, height);
295 _mav_put_float(buf, 20, timestamp);
296 _mav_put_uint16_t(buf, 24, direction);
297 _mav_put_uint16_t(buf, 26, speed_horizontal);
298 _mav_put_int16_t(buf, 28, speed_vertical);
299 _mav_put_uint8_t(buf, 30, target_system);
300 _mav_put_uint8_t(buf, 31, target_component);
301 _mav_put_uint8_t(buf, 52, status);
302 _mav_put_uint8_t(buf, 53, height_reference);
303 _mav_put_uint8_t(buf, 54, horizontal_accuracy);
304 _mav_put_uint8_t(buf, 55, vertical_accuracy);
305 _mav_put_uint8_t(buf, 56, barometer_accuracy);
306 _mav_put_uint8_t(buf, 57, speed_accuracy);
307 _mav_put_uint8_t(buf, 58, timestamp_accuracy);
308 _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
309 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
310#else
311 mavlink_open_drone_id_location_t packet;
312 packet.latitude = latitude;
313 packet.longitude = longitude;
314 packet.altitude_barometric = altitude_barometric;
315 packet.altitude_geodetic = altitude_geodetic;
316 packet.height = height;
317 packet.timestamp = timestamp;
318 packet.direction = direction;
319 packet.speed_horizontal = speed_horizontal;
320 packet.speed_vertical = speed_vertical;
321 packet.target_system = target_system;
322 packet.target_component = target_component;
323 packet.status = status;
324 packet.height_reference = height_reference;
325 packet.horizontal_accuracy = horizontal_accuracy;
326 packet.vertical_accuracy = vertical_accuracy;
327 packet.barometer_accuracy = barometer_accuracy;
328 packet.speed_accuracy = speed_accuracy;
329 packet.timestamp_accuracy = timestamp_accuracy;
330 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
331 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
332#endif
333
336}
337
338/**
339 * @brief Encode a open_drone_id_location struct
340 *
341 * @param system_id ID of this system
342 * @param component_id ID of this component (e.g. 200 for IMU)
343 * @param msg The MAVLink message to compress the data into
344 * @param open_drone_id_location C-struct to read the message contents from
345 */
346static inline uint16_t mavlink_msg_open_drone_id_location_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_open_drone_id_location_t* open_drone_id_location)
347{
348 return mavlink_msg_open_drone_id_location_pack(system_id, component_id, msg, open_drone_id_location->target_system, open_drone_id_location->target_component, open_drone_id_location->id_or_mac, open_drone_id_location->status, open_drone_id_location->direction, open_drone_id_location->speed_horizontal, open_drone_id_location->speed_vertical, open_drone_id_location->latitude, open_drone_id_location->longitude, open_drone_id_location->altitude_barometric, open_drone_id_location->altitude_geodetic, open_drone_id_location->height_reference, open_drone_id_location->height, open_drone_id_location->horizontal_accuracy, open_drone_id_location->vertical_accuracy, open_drone_id_location->barometer_accuracy, open_drone_id_location->speed_accuracy, open_drone_id_location->timestamp, open_drone_id_location->timestamp_accuracy);
349}
350
351/**
352 * @brief Encode a open_drone_id_location struct on a channel
353 *
354 * @param system_id ID of this system
355 * @param component_id ID of this component (e.g. 200 for IMU)
356 * @param chan The MAVLink channel this message will be sent over
357 * @param msg The MAVLink message to compress the data into
358 * @param open_drone_id_location C-struct to read the message contents from
359 */
360static inline uint16_t mavlink_msg_open_drone_id_location_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_open_drone_id_location_t* open_drone_id_location)
361{
362 return mavlink_msg_open_drone_id_location_pack_chan(system_id, component_id, chan, msg, open_drone_id_location->target_system, open_drone_id_location->target_component, open_drone_id_location->id_or_mac, open_drone_id_location->status, open_drone_id_location->direction, open_drone_id_location->speed_horizontal, open_drone_id_location->speed_vertical, open_drone_id_location->latitude, open_drone_id_location->longitude, open_drone_id_location->altitude_barometric, open_drone_id_location->altitude_geodetic, open_drone_id_location->height_reference, open_drone_id_location->height, open_drone_id_location->horizontal_accuracy, open_drone_id_location->vertical_accuracy, open_drone_id_location->barometer_accuracy, open_drone_id_location->speed_accuracy, open_drone_id_location->timestamp, open_drone_id_location->timestamp_accuracy);
363}
364
365/**
366 * @brief Encode a open_drone_id_location struct with provided status structure
367 *
368 * @param system_id ID of this system
369 * @param component_id ID of this component (e.g. 200 for IMU)
370 * @param status MAVLink status structure
371 * @param msg The MAVLink message to compress the data into
372 * @param open_drone_id_location C-struct to read the message contents from
373 */
374static inline uint16_t mavlink_msg_open_drone_id_location_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_open_drone_id_location_t* open_drone_id_location)
375{
376 return mavlink_msg_open_drone_id_location_pack_status(system_id, component_id, _status, msg, open_drone_id_location->target_system, open_drone_id_location->target_component, open_drone_id_location->id_or_mac, open_drone_id_location->status, open_drone_id_location->direction, open_drone_id_location->speed_horizontal, open_drone_id_location->speed_vertical, open_drone_id_location->latitude, open_drone_id_location->longitude, open_drone_id_location->altitude_barometric, open_drone_id_location->altitude_geodetic, open_drone_id_location->height_reference, open_drone_id_location->height, open_drone_id_location->horizontal_accuracy, open_drone_id_location->vertical_accuracy, open_drone_id_location->barometer_accuracy, open_drone_id_location->speed_accuracy, open_drone_id_location->timestamp, open_drone_id_location->timestamp_accuracy);
377}
378
379/**
380 * @brief Send a open_drone_id_location message
381 * @param chan MAVLink channel to send the message
382 *
383 * @param target_system System ID (0 for broadcast).
384 * @param target_component Component ID (0 for broadcast).
385 * @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.
386 * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
387 * @param direction [cdeg] Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.
388 * @param speed_horizontal [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.
389 * @param speed_vertical [cm/s] The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.
390 * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
391 * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
392 * @param altitude_barometric [m] The altitude calculated from the barometric pressure. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
393 * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
394 * @param height_reference Indicates the reference point for the height field.
395 * @param height [m] The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.
396 * @param horizontal_accuracy The accuracy of the horizontal position.
397 * @param vertical_accuracy The accuracy of the vertical position.
398 * @param barometer_accuracy The accuracy of the barometric altitude.
399 * @param speed_accuracy The accuracy of the horizontal and vertical speed.
400 * @param timestamp [s] Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.
401 * @param timestamp_accuracy The accuracy of the timestamps.
402 */
403#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
404
405static inline void mavlink_msg_open_drone_id_location_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t status, uint16_t direction, uint16_t speed_horizontal, int16_t speed_vertical, int32_t latitude, int32_t longitude, float altitude_barometric, float altitude_geodetic, uint8_t height_reference, float height, uint8_t horizontal_accuracy, uint8_t vertical_accuracy, uint8_t barometer_accuracy, uint8_t speed_accuracy, float timestamp, uint8_t timestamp_accuracy)
406{
407#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
408 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN];
409 _mav_put_int32_t(buf, 0, latitude);
410 _mav_put_int32_t(buf, 4, longitude);
411 _mav_put_float(buf, 8, altitude_barometric);
412 _mav_put_float(buf, 12, altitude_geodetic);
413 _mav_put_float(buf, 16, height);
414 _mav_put_float(buf, 20, timestamp);
415 _mav_put_uint16_t(buf, 24, direction);
416 _mav_put_uint16_t(buf, 26, speed_horizontal);
417 _mav_put_int16_t(buf, 28, speed_vertical);
418 _mav_put_uint8_t(buf, 30, target_system);
419 _mav_put_uint8_t(buf, 31, target_component);
420 _mav_put_uint8_t(buf, 52, status);
421 _mav_put_uint8_t(buf, 53, height_reference);
422 _mav_put_uint8_t(buf, 54, horizontal_accuracy);
423 _mav_put_uint8_t(buf, 55, vertical_accuracy);
424 _mav_put_uint8_t(buf, 56, barometer_accuracy);
425 _mav_put_uint8_t(buf, 57, speed_accuracy);
426 _mav_put_uint8_t(buf, 58, timestamp_accuracy);
427 _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
428 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC);
429#else
430 mavlink_open_drone_id_location_t packet;
431 packet.latitude = latitude;
432 packet.longitude = longitude;
433 packet.altitude_barometric = altitude_barometric;
434 packet.altitude_geodetic = altitude_geodetic;
435 packet.height = height;
436 packet.timestamp = timestamp;
437 packet.direction = direction;
438 packet.speed_horizontal = speed_horizontal;
439 packet.speed_vertical = speed_vertical;
440 packet.target_system = target_system;
441 packet.target_component = target_component;
442 packet.status = status;
443 packet.height_reference = height_reference;
444 packet.horizontal_accuracy = horizontal_accuracy;
445 packet.vertical_accuracy = vertical_accuracy;
446 packet.barometer_accuracy = barometer_accuracy;
447 packet.speed_accuracy = speed_accuracy;
448 packet.timestamp_accuracy = timestamp_accuracy;
449 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
450 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION, (const char *)&packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC);
451#endif
452}
453
454/**
455 * @brief Send a open_drone_id_location message
456 * @param chan MAVLink channel to send the message
457 * @param struct The MAVLink struct to serialize
458 */
459static inline void mavlink_msg_open_drone_id_location_send_struct(mavlink_channel_t chan, const mavlink_open_drone_id_location_t* open_drone_id_location)
460{
461#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
462 mavlink_msg_open_drone_id_location_send(chan, open_drone_id_location->target_system, open_drone_id_location->target_component, open_drone_id_location->id_or_mac, open_drone_id_location->status, open_drone_id_location->direction, open_drone_id_location->speed_horizontal, open_drone_id_location->speed_vertical, open_drone_id_location->latitude, open_drone_id_location->longitude, open_drone_id_location->altitude_barometric, open_drone_id_location->altitude_geodetic, open_drone_id_location->height_reference, open_drone_id_location->height, open_drone_id_location->horizontal_accuracy, open_drone_id_location->vertical_accuracy, open_drone_id_location->barometer_accuracy, open_drone_id_location->speed_accuracy, open_drone_id_location->timestamp, open_drone_id_location->timestamp_accuracy);
463#else
464 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION, (const char *)open_drone_id_location, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC);
465#endif
466}
467
468#if MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
469/*
470 This variant of _send() can be used to save stack space by reusing
471 memory from the receive buffer. The caller provides a
472 mavlink_message_t which is the size of a full mavlink message. This
473 is usually the receive buffer for the channel, and allows a reply to an
474 incoming message with minimum stack space usage.
475 */
476static inline void mavlink_msg_open_drone_id_location_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 status, uint16_t direction, uint16_t speed_horizontal, int16_t speed_vertical, int32_t latitude, int32_t longitude, float altitude_barometric, float altitude_geodetic, uint8_t height_reference, float height, uint8_t horizontal_accuracy, uint8_t vertical_accuracy, uint8_t barometer_accuracy, uint8_t speed_accuracy, float timestamp, uint8_t timestamp_accuracy)
477{
478#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
479 char *buf = (char *)msgbuf;
480 _mav_put_int32_t(buf, 0, latitude);
481 _mav_put_int32_t(buf, 4, longitude);
482 _mav_put_float(buf, 8, altitude_barometric);
483 _mav_put_float(buf, 12, altitude_geodetic);
484 _mav_put_float(buf, 16, height);
485 _mav_put_float(buf, 20, timestamp);
486 _mav_put_uint16_t(buf, 24, direction);
487 _mav_put_uint16_t(buf, 26, speed_horizontal);
488 _mav_put_int16_t(buf, 28, speed_vertical);
489 _mav_put_uint8_t(buf, 30, target_system);
490 _mav_put_uint8_t(buf, 31, target_component);
491 _mav_put_uint8_t(buf, 52, status);
492 _mav_put_uint8_t(buf, 53, height_reference);
493 _mav_put_uint8_t(buf, 54, horizontal_accuracy);
494 _mav_put_uint8_t(buf, 55, vertical_accuracy);
495 _mav_put_uint8_t(buf, 56, barometer_accuracy);
496 _mav_put_uint8_t(buf, 57, speed_accuracy);
497 _mav_put_uint8_t(buf, 58, timestamp_accuracy);
498 _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
499 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC);
500#else
501 mavlink_open_drone_id_location_t *packet = (mavlink_open_drone_id_location_t *)msgbuf;
502 packet->latitude = latitude;
503 packet->longitude = longitude;
504 packet->altitude_barometric = altitude_barometric;
505 packet->altitude_geodetic = altitude_geodetic;
506 packet->height = height;
507 packet->timestamp = timestamp;
508 packet->direction = direction;
509 packet->speed_horizontal = speed_horizontal;
510 packet->speed_vertical = speed_vertical;
511 packet->target_system = target_system;
512 packet->target_component = target_component;
513 packet->status = status;
514 packet->height_reference = height_reference;
515 packet->horizontal_accuracy = horizontal_accuracy;
516 packet->vertical_accuracy = vertical_accuracy;
517 packet->barometer_accuracy = barometer_accuracy;
518 packet->speed_accuracy = speed_accuracy;
519 packet->timestamp_accuracy = timestamp_accuracy;
520 mav_array_memcpy(packet->id_or_mac, id_or_mac, sizeof(uint8_t)*20);
521 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION, (const char *)packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC);
522#endif
523}
524#endif
525
526#endif
527
528// MESSAGE OPEN_DRONE_ID_LOCATION UNPACKING
529
530
531/**
532 * @brief Get field target_system from open_drone_id_location message
533 *
534 * @return System ID (0 for broadcast).
535 */
536static inline uint8_t mavlink_msg_open_drone_id_location_get_target_system(const mavlink_message_t* msg)
537{
538 return _MAV_RETURN_uint8_t(msg, 30);
539}
540
541/**
542 * @brief Get field target_component from open_drone_id_location message
543 *
544 * @return Component ID (0 for broadcast).
545 */
546static inline uint8_t mavlink_msg_open_drone_id_location_get_target_component(const mavlink_message_t* msg)
547{
548 return _MAV_RETURN_uint8_t(msg, 31);
549}
550
551/**
552 * @brief Get field id_or_mac from open_drone_id_location message
553 *
554 * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
555 */
556static inline uint16_t mavlink_msg_open_drone_id_location_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
557{
558 return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 32);
559}
560
561/**
562 * @brief Get field status from open_drone_id_location message
563 *
564 * @return Indicates whether the unmanned aircraft is on the ground or in the air.
565 */
566static inline uint8_t mavlink_msg_open_drone_id_location_get_status(const mavlink_message_t* msg)
567{
568 return _MAV_RETURN_uint8_t(msg, 52);
569}
570
571/**
572 * @brief Get field direction from open_drone_id_location message
573 *
574 * @return [cdeg] Direction over ground (not heading, but direction of movement) measured clockwise from true North: 0 - 35999 centi-degrees. If unknown: 36100 centi-degrees.
575 */
576static inline uint16_t mavlink_msg_open_drone_id_location_get_direction(const mavlink_message_t* msg)
577{
578 return _MAV_RETURN_uint16_t(msg, 24);
579}
580
581/**
582 * @brief Get field speed_horizontal from open_drone_id_location message
583 *
584 * @return [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.
585 */
586static inline uint16_t mavlink_msg_open_drone_id_location_get_speed_horizontal(const mavlink_message_t* msg)
587{
588 return _MAV_RETURN_uint16_t(msg, 26);
589}
590
591/**
592 * @brief Get field speed_vertical from open_drone_id_location message
593 *
594 * @return [cm/s] The vertical speed. Up is positive. If unknown: 6300 cm/s. If speed is larger than 6200 cm/s, use 6200 cm/s. If lower than -6200 cm/s, use -6200 cm/s.
595 */
596static inline int16_t mavlink_msg_open_drone_id_location_get_speed_vertical(const mavlink_message_t* msg)
597{
598 return _MAV_RETURN_int16_t(msg, 28);
599}
600
601/**
602 * @brief Get field latitude from open_drone_id_location message
603 *
604 * @return [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
605 */
606static inline int32_t mavlink_msg_open_drone_id_location_get_latitude(const mavlink_message_t* msg)
607{
608 return _MAV_RETURN_int32_t(msg, 0);
609}
610
611/**
612 * @brief Get field longitude from open_drone_id_location message
613 *
614 * @return [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
615 */
616static inline int32_t mavlink_msg_open_drone_id_location_get_longitude(const mavlink_message_t* msg)
617{
618 return _MAV_RETURN_int32_t(msg, 4);
619}
620
621/**
622 * @brief Get field altitude_barometric from open_drone_id_location message
623 *
624 * @return [m] The altitude calculated from the barometric pressure. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
625 */
626static inline float mavlink_msg_open_drone_id_location_get_altitude_barometric(const mavlink_message_t* msg)
627{
628 return _MAV_RETURN_float(msg, 8);
629}
630
631/**
632 * @brief Get field altitude_geodetic from open_drone_id_location message
633 *
634 * @return [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
635 */
636static inline float mavlink_msg_open_drone_id_location_get_altitude_geodetic(const mavlink_message_t* msg)
637{
638 return _MAV_RETURN_float(msg, 12);
639}
640
641/**
642 * @brief Get field height_reference from open_drone_id_location message
643 *
644 * @return Indicates the reference point for the height field.
645 */
646static inline uint8_t mavlink_msg_open_drone_id_location_get_height_reference(const mavlink_message_t* msg)
647{
648 return _MAV_RETURN_uint8_t(msg, 53);
649}
650
651/**
652 * @brief Get field height from open_drone_id_location message
653 *
654 * @return [m] The current height of the unmanned aircraft above the take-off location or the ground as indicated by height_reference. If unknown: -1000 m.
655 */
656static inline float mavlink_msg_open_drone_id_location_get_height(const mavlink_message_t* msg)
657{
658 return _MAV_RETURN_float(msg, 16);
659}
660
661/**
662 * @brief Get field horizontal_accuracy from open_drone_id_location message
663 *
664 * @return The accuracy of the horizontal position.
665 */
666static inline uint8_t mavlink_msg_open_drone_id_location_get_horizontal_accuracy(const mavlink_message_t* msg)
667{
668 return _MAV_RETURN_uint8_t(msg, 54);
669}
670
671/**
672 * @brief Get field vertical_accuracy from open_drone_id_location message
673 *
674 * @return The accuracy of the vertical position.
675 */
676static inline uint8_t mavlink_msg_open_drone_id_location_get_vertical_accuracy(const mavlink_message_t* msg)
677{
678 return _MAV_RETURN_uint8_t(msg, 55);
679}
680
681/**
682 * @brief Get field barometer_accuracy from open_drone_id_location message
683 *
684 * @return The accuracy of the barometric altitude.
685 */
686static inline uint8_t mavlink_msg_open_drone_id_location_get_barometer_accuracy(const mavlink_message_t* msg)
687{
688 return _MAV_RETURN_uint8_t(msg, 56);
689}
690
691/**
692 * @brief Get field speed_accuracy from open_drone_id_location message
693 *
694 * @return The accuracy of the horizontal and vertical speed.
695 */
696static inline uint8_t mavlink_msg_open_drone_id_location_get_speed_accuracy(const mavlink_message_t* msg)
697{
698 return _MAV_RETURN_uint8_t(msg, 57);
699}
700
701/**
702 * @brief Get field timestamp from open_drone_id_location message
703 *
704 * @return [s] Seconds after the full hour with reference to UTC time. Typically the GPS outputs a time-of-week value in milliseconds. First convert that to UTC and then convert for this field using ((float) (time_week_ms % (60*60*1000))) / 1000. If unknown: 0xFFFF.
705 */
706static inline float mavlink_msg_open_drone_id_location_get_timestamp(const mavlink_message_t* msg)
707{
708 return _MAV_RETURN_float(msg, 20);
709}
710
711/**
712 * @brief Get field timestamp_accuracy from open_drone_id_location message
713 *
714 * @return The accuracy of the timestamps.
715 */
716static inline uint8_t mavlink_msg_open_drone_id_location_get_timestamp_accuracy(const mavlink_message_t* msg)
717{
718 return _MAV_RETURN_uint8_t(msg, 58);
719}
720
721/**
722 * @brief Decode a open_drone_id_location message into a struct
723 *
724 * @param msg The message to decode
725 * @param open_drone_id_location C-struct to decode the message contents into
726 */
727static inline void mavlink_msg_open_drone_id_location_decode(const mavlink_message_t* msg, mavlink_open_drone_id_location_t* open_drone_id_location)
728{
729#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
730 open_drone_id_location->latitude = mavlink_msg_open_drone_id_location_get_latitude(msg);
731 open_drone_id_location->longitude = mavlink_msg_open_drone_id_location_get_longitude(msg);
732 open_drone_id_location->altitude_barometric = mavlink_msg_open_drone_id_location_get_altitude_barometric(msg);
733 open_drone_id_location->altitude_geodetic = mavlink_msg_open_drone_id_location_get_altitude_geodetic(msg);
734 open_drone_id_location->height = mavlink_msg_open_drone_id_location_get_height(msg);
735 open_drone_id_location->timestamp = mavlink_msg_open_drone_id_location_get_timestamp(msg);
736 open_drone_id_location->direction = mavlink_msg_open_drone_id_location_get_direction(msg);
737 open_drone_id_location->speed_horizontal = mavlink_msg_open_drone_id_location_get_speed_horizontal(msg);
738 open_drone_id_location->speed_vertical = mavlink_msg_open_drone_id_location_get_speed_vertical(msg);
739 open_drone_id_location->target_system = mavlink_msg_open_drone_id_location_get_target_system(msg);
740 open_drone_id_location->target_component = mavlink_msg_open_drone_id_location_get_target_component(msg);
741 mavlink_msg_open_drone_id_location_get_id_or_mac(msg, open_drone_id_location->id_or_mac);
742 open_drone_id_location->status = mavlink_msg_open_drone_id_location_get_status(msg);
743 open_drone_id_location->height_reference = mavlink_msg_open_drone_id_location_get_height_reference(msg);
744 open_drone_id_location->horizontal_accuracy = mavlink_msg_open_drone_id_location_get_horizontal_accuracy(msg);
745 open_drone_id_location->vertical_accuracy = mavlink_msg_open_drone_id_location_get_vertical_accuracy(msg);
746 open_drone_id_location->barometer_accuracy = mavlink_msg_open_drone_id_location_get_barometer_accuracy(msg);
747 open_drone_id_location->speed_accuracy = mavlink_msg_open_drone_id_location_get_speed_accuracy(msg);
748 open_drone_id_location->timestamp_accuracy = mavlink_msg_open_drone_id_location_get_timestamp_accuracy(msg);
749#else
750 uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN;
751 memset(open_drone_id_location, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
752 memcpy(open_drone_id_location, _MAV_PAYLOAD(msg), len);
753#endif
754}