Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_open_drone_id_location.h
blob0c2834393368464e5f7f84d45cca9ed956d7fe04
1 #pragma once
2 // MESSAGE OPEN_DRONE_ID_LOCATION PACKING
4 #define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION 12901
7 typedef struct __mavlink_open_drone_id_location_t {
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 pressue. 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.*/
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;
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
34 #define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC 254
35 #define MAVLINK_MSG_ID_12901_CRC 254
37 #define MAVLINK_MSG_OPEN_DRONE_ID_LOCATION_FIELD_ID_OR_MAC_LEN 20
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 } \
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 } \
90 #endif
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
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 pressue. 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.
116 * @param timestamp_accuracy The accuracy of the timestamps.
117 * @return length of the message in bytes (excluding serial stream start sign)
119 static 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)
122 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
123 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN];
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
168 msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION;
169 return mavlink_finalize_message(msg, system_id, component_id, 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);
173 * @brief Pack a open_drone_id_location message on a channel
174 * @param system_id ID of this system
175 * @param component_id ID of this component (e.g. 200 for IMU)
176 * @param chan The MAVLink channel this message will be sent over
177 * @param msg The MAVLink message to compress the data into
178 * @param target_system System ID (0 for broadcast).
179 * @param target_component Component ID (0 for broadcast).
180 * @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.
181 * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
182 * @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.
183 * @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.
184 * @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.
185 * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
186 * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
187 * @param altitude_barometric [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
188 * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
189 * @param height_reference Indicates the reference point for the height field.
190 * @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.
191 * @param horizontal_accuracy The accuracy of the horizontal position.
192 * @param vertical_accuracy The accuracy of the vertical position.
193 * @param barometer_accuracy The accuracy of the barometric altitude.
194 * @param speed_accuracy The accuracy of the horizontal and vertical speed.
195 * @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.
196 * @param timestamp_accuracy The accuracy of the timestamps.
197 * @return length of the message in bytes (excluding serial stream start sign)
199 static inline uint16_t mavlink_msg_open_drone_id_location_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
200 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)
203 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
204 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN];
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
249 msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION;
250 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, 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);
254 * @brief Encode a open_drone_id_location struct
256 * @param system_id ID of this system
257 * @param component_id ID of this component (e.g. 200 for IMU)
258 * @param msg The MAVLink message to compress the data into
259 * @param open_drone_id_location C-struct to read the message contents from
261 static 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)
263 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);
267 * @brief Encode a open_drone_id_location struct on a channel
269 * @param system_id ID of this system
270 * @param component_id ID of this component (e.g. 200 for IMU)
271 * @param chan The MAVLink channel this message will be sent over
272 * @param msg The MAVLink message to compress the data into
273 * @param open_drone_id_location C-struct to read the message contents from
275 static 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)
277 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);
281 * @brief Send a open_drone_id_location message
282 * @param chan MAVLink channel to send the message
284 * @param target_system System ID (0 for broadcast).
285 * @param target_component Component ID (0 for broadcast).
286 * @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.
287 * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
288 * @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.
289 * @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.
290 * @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.
291 * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
292 * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
293 * @param altitude_barometric [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
294 * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
295 * @param height_reference Indicates the reference point for the height field.
296 * @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.
297 * @param horizontal_accuracy The accuracy of the horizontal position.
298 * @param vertical_accuracy The accuracy of the vertical position.
299 * @param barometer_accuracy The accuracy of the barometric altitude.
300 * @param speed_accuracy The accuracy of the horizontal and vertical speed.
301 * @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.
302 * @param timestamp_accuracy The accuracy of the timestamps.
304 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
306 static 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)
308 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
309 char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN];
310 _mav_put_int32_t(buf, 0, latitude);
311 _mav_put_int32_t(buf, 4, longitude);
312 _mav_put_float(buf, 8, altitude_barometric);
313 _mav_put_float(buf, 12, altitude_geodetic);
314 _mav_put_float(buf, 16, height);
315 _mav_put_float(buf, 20, timestamp);
316 _mav_put_uint16_t(buf, 24, direction);
317 _mav_put_uint16_t(buf, 26, speed_horizontal);
318 _mav_put_int16_t(buf, 28, speed_vertical);
319 _mav_put_uint8_t(buf, 30, target_system);
320 _mav_put_uint8_t(buf, 31, target_component);
321 _mav_put_uint8_t(buf, 52, status);
322 _mav_put_uint8_t(buf, 53, height_reference);
323 _mav_put_uint8_t(buf, 54, horizontal_accuracy);
324 _mav_put_uint8_t(buf, 55, vertical_accuracy);
325 _mav_put_uint8_t(buf, 56, barometer_accuracy);
326 _mav_put_uint8_t(buf, 57, speed_accuracy);
327 _mav_put_uint8_t(buf, 58, timestamp_accuracy);
328 _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
329 _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);
330 #else
331 mavlink_open_drone_id_location_t packet;
332 packet.latitude = latitude;
333 packet.longitude = longitude;
334 packet.altitude_barometric = altitude_barometric;
335 packet.altitude_geodetic = altitude_geodetic;
336 packet.height = height;
337 packet.timestamp = timestamp;
338 packet.direction = direction;
339 packet.speed_horizontal = speed_horizontal;
340 packet.speed_vertical = speed_vertical;
341 packet.target_system = target_system;
342 packet.target_component = target_component;
343 packet.status = status;
344 packet.height_reference = height_reference;
345 packet.horizontal_accuracy = horizontal_accuracy;
346 packet.vertical_accuracy = vertical_accuracy;
347 packet.barometer_accuracy = barometer_accuracy;
348 packet.speed_accuracy = speed_accuracy;
349 packet.timestamp_accuracy = timestamp_accuracy;
350 mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
351 _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);
352 #endif
356 * @brief Send a open_drone_id_location message
357 * @param chan MAVLink channel to send the message
358 * @param struct The MAVLink struct to serialize
360 static 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)
362 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
363 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);
364 #else
365 _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);
366 #endif
369 #if MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
371 This varient of _send() can be used to save stack space by re-using
372 memory from the receive buffer. The caller provides a
373 mavlink_message_t which is the size of a full mavlink message. This
374 is usually the receive buffer for the channel, and allows a reply to an
375 incoming message with minimum stack space usage.
377 static 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)
379 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
380 char *buf = (char *)msgbuf;
381 _mav_put_int32_t(buf, 0, latitude);
382 _mav_put_int32_t(buf, 4, longitude);
383 _mav_put_float(buf, 8, altitude_barometric);
384 _mav_put_float(buf, 12, altitude_geodetic);
385 _mav_put_float(buf, 16, height);
386 _mav_put_float(buf, 20, timestamp);
387 _mav_put_uint16_t(buf, 24, direction);
388 _mav_put_uint16_t(buf, 26, speed_horizontal);
389 _mav_put_int16_t(buf, 28, speed_vertical);
390 _mav_put_uint8_t(buf, 30, target_system);
391 _mav_put_uint8_t(buf, 31, target_component);
392 _mav_put_uint8_t(buf, 52, status);
393 _mav_put_uint8_t(buf, 53, height_reference);
394 _mav_put_uint8_t(buf, 54, horizontal_accuracy);
395 _mav_put_uint8_t(buf, 55, vertical_accuracy);
396 _mav_put_uint8_t(buf, 56, barometer_accuracy);
397 _mav_put_uint8_t(buf, 57, speed_accuracy);
398 _mav_put_uint8_t(buf, 58, timestamp_accuracy);
399 _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
400 _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);
401 #else
402 mavlink_open_drone_id_location_t *packet = (mavlink_open_drone_id_location_t *)msgbuf;
403 packet->latitude = latitude;
404 packet->longitude = longitude;
405 packet->altitude_barometric = altitude_barometric;
406 packet->altitude_geodetic = altitude_geodetic;
407 packet->height = height;
408 packet->timestamp = timestamp;
409 packet->direction = direction;
410 packet->speed_horizontal = speed_horizontal;
411 packet->speed_vertical = speed_vertical;
412 packet->target_system = target_system;
413 packet->target_component = target_component;
414 packet->status = status;
415 packet->height_reference = height_reference;
416 packet->horizontal_accuracy = horizontal_accuracy;
417 packet->vertical_accuracy = vertical_accuracy;
418 packet->barometer_accuracy = barometer_accuracy;
419 packet->speed_accuracy = speed_accuracy;
420 packet->timestamp_accuracy = timestamp_accuracy;
421 mav_array_memcpy(packet->id_or_mac, id_or_mac, sizeof(uint8_t)*20);
422 _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);
423 #endif
425 #endif
427 #endif
429 // MESSAGE OPEN_DRONE_ID_LOCATION UNPACKING
433 * @brief Get field target_system from open_drone_id_location message
435 * @return System ID (0 for broadcast).
437 static inline uint8_t mavlink_msg_open_drone_id_location_get_target_system(const mavlink_message_t* msg)
439 return _MAV_RETURN_uint8_t(msg, 30);
443 * @brief Get field target_component from open_drone_id_location message
445 * @return Component ID (0 for broadcast).
447 static inline uint8_t mavlink_msg_open_drone_id_location_get_target_component(const mavlink_message_t* msg)
449 return _MAV_RETURN_uint8_t(msg, 31);
453 * @brief Get field id_or_mac from open_drone_id_location message
455 * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
457 static inline uint16_t mavlink_msg_open_drone_id_location_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
459 return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 32);
463 * @brief Get field status from open_drone_id_location message
465 * @return Indicates whether the unmanned aircraft is on the ground or in the air.
467 static inline uint8_t mavlink_msg_open_drone_id_location_get_status(const mavlink_message_t* msg)
469 return _MAV_RETURN_uint8_t(msg, 52);
473 * @brief Get field direction from open_drone_id_location message
475 * @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.
477 static inline uint16_t mavlink_msg_open_drone_id_location_get_direction(const mavlink_message_t* msg)
479 return _MAV_RETURN_uint16_t(msg, 24);
483 * @brief Get field speed_horizontal from open_drone_id_location message
485 * @return [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.
487 static inline uint16_t mavlink_msg_open_drone_id_location_get_speed_horizontal(const mavlink_message_t* msg)
489 return _MAV_RETURN_uint16_t(msg, 26);
493 * @brief Get field speed_vertical from open_drone_id_location message
495 * @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.
497 static inline int16_t mavlink_msg_open_drone_id_location_get_speed_vertical(const mavlink_message_t* msg)
499 return _MAV_RETURN_int16_t(msg, 28);
503 * @brief Get field latitude from open_drone_id_location message
505 * @return [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
507 static inline int32_t mavlink_msg_open_drone_id_location_get_latitude(const mavlink_message_t* msg)
509 return _MAV_RETURN_int32_t(msg, 0);
513 * @brief Get field longitude from open_drone_id_location message
515 * @return [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
517 static inline int32_t mavlink_msg_open_drone_id_location_get_longitude(const mavlink_message_t* msg)
519 return _MAV_RETURN_int32_t(msg, 4);
523 * @brief Get field altitude_barometric from open_drone_id_location message
525 * @return [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
527 static inline float mavlink_msg_open_drone_id_location_get_altitude_barometric(const mavlink_message_t* msg)
529 return _MAV_RETURN_float(msg, 8);
533 * @brief Get field altitude_geodetic from open_drone_id_location message
535 * @return [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
537 static inline float mavlink_msg_open_drone_id_location_get_altitude_geodetic(const mavlink_message_t* msg)
539 return _MAV_RETURN_float(msg, 12);
543 * @brief Get field height_reference from open_drone_id_location message
545 * @return Indicates the reference point for the height field.
547 static inline uint8_t mavlink_msg_open_drone_id_location_get_height_reference(const mavlink_message_t* msg)
549 return _MAV_RETURN_uint8_t(msg, 53);
553 * @brief Get field height from open_drone_id_location message
555 * @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.
557 static inline float mavlink_msg_open_drone_id_location_get_height(const mavlink_message_t* msg)
559 return _MAV_RETURN_float(msg, 16);
563 * @brief Get field horizontal_accuracy from open_drone_id_location message
565 * @return The accuracy of the horizontal position.
567 static inline uint8_t mavlink_msg_open_drone_id_location_get_horizontal_accuracy(const mavlink_message_t* msg)
569 return _MAV_RETURN_uint8_t(msg, 54);
573 * @brief Get field vertical_accuracy from open_drone_id_location message
575 * @return The accuracy of the vertical position.
577 static inline uint8_t mavlink_msg_open_drone_id_location_get_vertical_accuracy(const mavlink_message_t* msg)
579 return _MAV_RETURN_uint8_t(msg, 55);
583 * @brief Get field barometer_accuracy from open_drone_id_location message
585 * @return The accuracy of the barometric altitude.
587 static inline uint8_t mavlink_msg_open_drone_id_location_get_barometer_accuracy(const mavlink_message_t* msg)
589 return _MAV_RETURN_uint8_t(msg, 56);
593 * @brief Get field speed_accuracy from open_drone_id_location message
595 * @return The accuracy of the horizontal and vertical speed.
597 static inline uint8_t mavlink_msg_open_drone_id_location_get_speed_accuracy(const mavlink_message_t* msg)
599 return _MAV_RETURN_uint8_t(msg, 57);
603 * @brief Get field timestamp from open_drone_id_location message
605 * @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.
607 static inline float mavlink_msg_open_drone_id_location_get_timestamp(const mavlink_message_t* msg)
609 return _MAV_RETURN_float(msg, 20);
613 * @brief Get field timestamp_accuracy from open_drone_id_location message
615 * @return The accuracy of the timestamps.
617 static inline uint8_t mavlink_msg_open_drone_id_location_get_timestamp_accuracy(const mavlink_message_t* msg)
619 return _MAV_RETURN_uint8_t(msg, 58);
623 * @brief Decode a open_drone_id_location message into a struct
625 * @param msg The message to decode
626 * @param open_drone_id_location C-struct to decode the message contents into
628 static inline void mavlink_msg_open_drone_id_location_decode(const mavlink_message_t* msg, mavlink_open_drone_id_location_t* open_drone_id_location)
630 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
631 open_drone_id_location->latitude = mavlink_msg_open_drone_id_location_get_latitude(msg);
632 open_drone_id_location->longitude = mavlink_msg_open_drone_id_location_get_longitude(msg);
633 open_drone_id_location->altitude_barometric = mavlink_msg_open_drone_id_location_get_altitude_barometric(msg);
634 open_drone_id_location->altitude_geodetic = mavlink_msg_open_drone_id_location_get_altitude_geodetic(msg);
635 open_drone_id_location->height = mavlink_msg_open_drone_id_location_get_height(msg);
636 open_drone_id_location->timestamp = mavlink_msg_open_drone_id_location_get_timestamp(msg);
637 open_drone_id_location->direction = mavlink_msg_open_drone_id_location_get_direction(msg);
638 open_drone_id_location->speed_horizontal = mavlink_msg_open_drone_id_location_get_speed_horizontal(msg);
639 open_drone_id_location->speed_vertical = mavlink_msg_open_drone_id_location_get_speed_vertical(msg);
640 open_drone_id_location->target_system = mavlink_msg_open_drone_id_location_get_target_system(msg);
641 open_drone_id_location->target_component = mavlink_msg_open_drone_id_location_get_target_component(msg);
642 mavlink_msg_open_drone_id_location_get_id_or_mac(msg, open_drone_id_location->id_or_mac);
643 open_drone_id_location->status = mavlink_msg_open_drone_id_location_get_status(msg);
644 open_drone_id_location->height_reference = mavlink_msg_open_drone_id_location_get_height_reference(msg);
645 open_drone_id_location->horizontal_accuracy = mavlink_msg_open_drone_id_location_get_horizontal_accuracy(msg);
646 open_drone_id_location->vertical_accuracy = mavlink_msg_open_drone_id_location_get_vertical_accuracy(msg);
647 open_drone_id_location->barometer_accuracy = mavlink_msg_open_drone_id_location_get_barometer_accuracy(msg);
648 open_drone_id_location->speed_accuracy = mavlink_msg_open_drone_id_location_get_speed_accuracy(msg);
649 open_drone_id_location->timestamp_accuracy = mavlink_msg_open_drone_id_location_get_timestamp_accuracy(msg);
650 #else
651 uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN;
652 memset(open_drone_id_location, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
653 memcpy(open_drone_id_location, _MAV_PAYLOAD(msg), len);
654 #endif