mavlink_msg_open_drone_id_location.h 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655
  1. #pragma once
  2. // MESSAGE OPEN_DRONE_ID_LOCATION PACKING
  3. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION 12901
  4. typedef struct __mavlink_open_drone_id_location_t {
  5. int32_t latitude; /*< [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).*/
  6. int32_t longitude; /*< [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).*/
  7. float altitude_barometric; /*< [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.*/
  8. float altitude_geodetic; /*< [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.*/
  9. 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.*/
  10. 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.*/
  11. 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.*/
  12. 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.*/
  13. 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.*/
  14. uint8_t target_system; /*< System ID (0 for broadcast).*/
  15. uint8_t target_component; /*< Component ID (0 for broadcast).*/
  16. 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. */
  17. uint8_t status; /*< Indicates whether the unmanned aircraft is on the ground or in the air.*/
  18. uint8_t height_reference; /*< Indicates the reference point for the height field.*/
  19. uint8_t horizontal_accuracy; /*< The accuracy of the horizontal position.*/
  20. uint8_t vertical_accuracy; /*< The accuracy of the vertical position.*/
  21. uint8_t barometer_accuracy; /*< The accuracy of the barometric altitude.*/
  22. uint8_t speed_accuracy; /*< The accuracy of the horizontal and vertical speed.*/
  23. uint8_t timestamp_accuracy; /*< The accuracy of the timestamps.*/
  24. } mavlink_open_drone_id_location_t;
  25. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN 59
  26. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_MIN_LEN 59
  27. #define MAVLINK_MSG_ID_12901_LEN 59
  28. #define MAVLINK_MSG_ID_12901_MIN_LEN 59
  29. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_CRC 254
  30. #define MAVLINK_MSG_ID_12901_CRC 254
  31. #define MAVLINK_MSG_OPEN_DRONE_ID_LOCATION_FIELD_ID_OR_MAC_LEN 20
  32. #if MAVLINK_COMMAND_24BIT
  33. #define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_LOCATION { \
  34. 12901, \
  35. "OPEN_DRONE_ID_LOCATION", \
  36. 19, \
  37. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_open_drone_id_location_t, target_system) }, \
  38. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_open_drone_id_location_t, target_component) }, \
  39. { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 32, offsetof(mavlink_open_drone_id_location_t, id_or_mac) }, \
  40. { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_open_drone_id_location_t, status) }, \
  41. { "direction", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_open_drone_id_location_t, direction) }, \
  42. { "speed_horizontal", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_open_drone_id_location_t, speed_horizontal) }, \
  43. { "speed_vertical", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_open_drone_id_location_t, speed_vertical) }, \
  44. { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_open_drone_id_location_t, latitude) }, \
  45. { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_open_drone_id_location_t, longitude) }, \
  46. { "altitude_barometric", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_open_drone_id_location_t, altitude_barometric) }, \
  47. { "altitude_geodetic", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_open_drone_id_location_t, altitude_geodetic) }, \
  48. { "height_reference", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_open_drone_id_location_t, height_reference) }, \
  49. { "height", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_open_drone_id_location_t, height) }, \
  50. { "horizontal_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 54, offsetof(mavlink_open_drone_id_location_t, horizontal_accuracy) }, \
  51. { "vertical_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 55, offsetof(mavlink_open_drone_id_location_t, vertical_accuracy) }, \
  52. { "barometer_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 56, offsetof(mavlink_open_drone_id_location_t, barometer_accuracy) }, \
  53. { "speed_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 57, offsetof(mavlink_open_drone_id_location_t, speed_accuracy) }, \
  54. { "timestamp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_open_drone_id_location_t, timestamp) }, \
  55. { "timestamp_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_open_drone_id_location_t, timestamp_accuracy) }, \
  56. } \
  57. }
  58. #else
  59. #define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_LOCATION { \
  60. "OPEN_DRONE_ID_LOCATION", \
  61. 19, \
  62. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 30, offsetof(mavlink_open_drone_id_location_t, target_system) }, \
  63. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 31, offsetof(mavlink_open_drone_id_location_t, target_component) }, \
  64. { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 32, offsetof(mavlink_open_drone_id_location_t, id_or_mac) }, \
  65. { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 52, offsetof(mavlink_open_drone_id_location_t, status) }, \
  66. { "direction", NULL, MAVLINK_TYPE_UINT16_T, 0, 24, offsetof(mavlink_open_drone_id_location_t, direction) }, \
  67. { "speed_horizontal", NULL, MAVLINK_TYPE_UINT16_T, 0, 26, offsetof(mavlink_open_drone_id_location_t, speed_horizontal) }, \
  68. { "speed_vertical", NULL, MAVLINK_TYPE_INT16_T, 0, 28, offsetof(mavlink_open_drone_id_location_t, speed_vertical) }, \
  69. { "latitude", NULL, MAVLINK_TYPE_INT32_T, 0, 0, offsetof(mavlink_open_drone_id_location_t, latitude) }, \
  70. { "longitude", NULL, MAVLINK_TYPE_INT32_T, 0, 4, offsetof(mavlink_open_drone_id_location_t, longitude) }, \
  71. { "altitude_barometric", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_open_drone_id_location_t, altitude_barometric) }, \
  72. { "altitude_geodetic", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_open_drone_id_location_t, altitude_geodetic) }, \
  73. { "height_reference", NULL, MAVLINK_TYPE_UINT8_T, 0, 53, offsetof(mavlink_open_drone_id_location_t, height_reference) }, \
  74. { "height", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_open_drone_id_location_t, height) }, \
  75. { "horizontal_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 54, offsetof(mavlink_open_drone_id_location_t, horizontal_accuracy) }, \
  76. { "vertical_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 55, offsetof(mavlink_open_drone_id_location_t, vertical_accuracy) }, \
  77. { "barometer_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 56, offsetof(mavlink_open_drone_id_location_t, barometer_accuracy) }, \
  78. { "speed_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 57, offsetof(mavlink_open_drone_id_location_t, speed_accuracy) }, \
  79. { "timestamp", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_open_drone_id_location_t, timestamp) }, \
  80. { "timestamp_accuracy", NULL, MAVLINK_TYPE_UINT8_T, 0, 58, offsetof(mavlink_open_drone_id_location_t, timestamp_accuracy) }, \
  81. } \
  82. }
  83. #endif
  84. /**
  85. * @brief Pack a open_drone_id_location message
  86. * @param system_id ID of this system
  87. * @param component_id ID of this component (e.g. 200 for IMU)
  88. * @param msg The MAVLink message to compress the data into
  89. *
  90. * @param target_system System ID (0 for broadcast).
  91. * @param target_component Component ID (0 for broadcast).
  92. * @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.
  93. * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
  94. * @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.
  95. * @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.
  96. * @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.
  97. * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  98. * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  99. * @param altitude_barometric [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
  100. * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
  101. * @param height_reference Indicates the reference point for the height field.
  102. * @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.
  103. * @param horizontal_accuracy The accuracy of the horizontal position.
  104. * @param vertical_accuracy The accuracy of the vertical position.
  105. * @param barometer_accuracy The accuracy of the barometric altitude.
  106. * @param speed_accuracy The accuracy of the horizontal and vertical speed.
  107. * @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.
  108. * @param timestamp_accuracy The accuracy of the timestamps.
  109. * @return length of the message in bytes (excluding serial stream start sign)
  110. */
  111. static inline uint16_t mavlink_msg_open_drone_id_location_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  112. 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)
  113. {
  114. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  115. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN];
  116. _mav_put_int32_t(buf, 0, latitude);
  117. _mav_put_int32_t(buf, 4, longitude);
  118. _mav_put_float(buf, 8, altitude_barometric);
  119. _mav_put_float(buf, 12, altitude_geodetic);
  120. _mav_put_float(buf, 16, height);
  121. _mav_put_float(buf, 20, timestamp);
  122. _mav_put_uint16_t(buf, 24, direction);
  123. _mav_put_uint16_t(buf, 26, speed_horizontal);
  124. _mav_put_int16_t(buf, 28, speed_vertical);
  125. _mav_put_uint8_t(buf, 30, target_system);
  126. _mav_put_uint8_t(buf, 31, target_component);
  127. _mav_put_uint8_t(buf, 52, status);
  128. _mav_put_uint8_t(buf, 53, height_reference);
  129. _mav_put_uint8_t(buf, 54, horizontal_accuracy);
  130. _mav_put_uint8_t(buf, 55, vertical_accuracy);
  131. _mav_put_uint8_t(buf, 56, barometer_accuracy);
  132. _mav_put_uint8_t(buf, 57, speed_accuracy);
  133. _mav_put_uint8_t(buf, 58, timestamp_accuracy);
  134. _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
  135. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
  136. #else
  137. mavlink_open_drone_id_location_t packet;
  138. packet.latitude = latitude;
  139. packet.longitude = longitude;
  140. packet.altitude_barometric = altitude_barometric;
  141. packet.altitude_geodetic = altitude_geodetic;
  142. packet.height = height;
  143. packet.timestamp = timestamp;
  144. packet.direction = direction;
  145. packet.speed_horizontal = speed_horizontal;
  146. packet.speed_vertical = speed_vertical;
  147. packet.target_system = target_system;
  148. packet.target_component = target_component;
  149. packet.status = status;
  150. packet.height_reference = height_reference;
  151. packet.horizontal_accuracy = horizontal_accuracy;
  152. packet.vertical_accuracy = vertical_accuracy;
  153. packet.barometer_accuracy = barometer_accuracy;
  154. packet.speed_accuracy = speed_accuracy;
  155. packet.timestamp_accuracy = timestamp_accuracy;
  156. mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  157. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
  158. #endif
  159. msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION;
  160. 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);
  161. }
  162. /**
  163. * @brief Pack a open_drone_id_location message on a channel
  164. * @param system_id ID of this system
  165. * @param component_id ID of this component (e.g. 200 for IMU)
  166. * @param chan The MAVLink channel this message will be sent over
  167. * @param msg The MAVLink message to compress the data into
  168. * @param target_system System ID (0 for broadcast).
  169. * @param target_component Component ID (0 for broadcast).
  170. * @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.
  171. * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
  172. * @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.
  173. * @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.
  174. * @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.
  175. * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  176. * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  177. * @param altitude_barometric [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
  178. * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
  179. * @param height_reference Indicates the reference point for the height field.
  180. * @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.
  181. * @param horizontal_accuracy The accuracy of the horizontal position.
  182. * @param vertical_accuracy The accuracy of the vertical position.
  183. * @param barometer_accuracy The accuracy of the barometric altitude.
  184. * @param speed_accuracy The accuracy of the horizontal and vertical speed.
  185. * @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.
  186. * @param timestamp_accuracy The accuracy of the timestamps.
  187. * @return length of the message in bytes (excluding serial stream start sign)
  188. */
  189. static inline uint16_t mavlink_msg_open_drone_id_location_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  190. mavlink_message_t* msg,
  191. 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)
  192. {
  193. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  194. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN];
  195. _mav_put_int32_t(buf, 0, latitude);
  196. _mav_put_int32_t(buf, 4, longitude);
  197. _mav_put_float(buf, 8, altitude_barometric);
  198. _mav_put_float(buf, 12, altitude_geodetic);
  199. _mav_put_float(buf, 16, height);
  200. _mav_put_float(buf, 20, timestamp);
  201. _mav_put_uint16_t(buf, 24, direction);
  202. _mav_put_uint16_t(buf, 26, speed_horizontal);
  203. _mav_put_int16_t(buf, 28, speed_vertical);
  204. _mav_put_uint8_t(buf, 30, target_system);
  205. _mav_put_uint8_t(buf, 31, target_component);
  206. _mav_put_uint8_t(buf, 52, status);
  207. _mav_put_uint8_t(buf, 53, height_reference);
  208. _mav_put_uint8_t(buf, 54, horizontal_accuracy);
  209. _mav_put_uint8_t(buf, 55, vertical_accuracy);
  210. _mav_put_uint8_t(buf, 56, barometer_accuracy);
  211. _mav_put_uint8_t(buf, 57, speed_accuracy);
  212. _mav_put_uint8_t(buf, 58, timestamp_accuracy);
  213. _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
  214. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
  215. #else
  216. mavlink_open_drone_id_location_t packet;
  217. packet.latitude = latitude;
  218. packet.longitude = longitude;
  219. packet.altitude_barometric = altitude_barometric;
  220. packet.altitude_geodetic = altitude_geodetic;
  221. packet.height = height;
  222. packet.timestamp = timestamp;
  223. packet.direction = direction;
  224. packet.speed_horizontal = speed_horizontal;
  225. packet.speed_vertical = speed_vertical;
  226. packet.target_system = target_system;
  227. packet.target_component = target_component;
  228. packet.status = status;
  229. packet.height_reference = height_reference;
  230. packet.horizontal_accuracy = horizontal_accuracy;
  231. packet.vertical_accuracy = vertical_accuracy;
  232. packet.barometer_accuracy = barometer_accuracy;
  233. packet.speed_accuracy = speed_accuracy;
  234. packet.timestamp_accuracy = timestamp_accuracy;
  235. mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  236. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
  237. #endif
  238. msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION;
  239. 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);
  240. }
  241. /**
  242. * @brief Encode a open_drone_id_location struct
  243. *
  244. * @param system_id ID of this system
  245. * @param component_id ID of this component (e.g. 200 for IMU)
  246. * @param msg The MAVLink message to compress the data into
  247. * @param open_drone_id_location C-struct to read the message contents from
  248. */
  249. 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)
  250. {
  251. 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);
  252. }
  253. /**
  254. * @brief Encode a open_drone_id_location struct on a channel
  255. *
  256. * @param system_id ID of this system
  257. * @param component_id ID of this component (e.g. 200 for IMU)
  258. * @param chan The MAVLink channel this message will be sent over
  259. * @param msg The MAVLink message to compress the data into
  260. * @param open_drone_id_location C-struct to read the message contents from
  261. */
  262. 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)
  263. {
  264. 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);
  265. }
  266. /**
  267. * @brief Send a open_drone_id_location message
  268. * @param chan MAVLink channel to send the message
  269. *
  270. * @param target_system System ID (0 for broadcast).
  271. * @param target_component Component ID (0 for broadcast).
  272. * @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.
  273. * @param status Indicates whether the unmanned aircraft is on the ground or in the air.
  274. * @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.
  275. * @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.
  276. * @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.
  277. * @param latitude [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  278. * @param longitude [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  279. * @param altitude_barometric [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
  280. * @param altitude_geodetic [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
  281. * @param height_reference Indicates the reference point for the height field.
  282. * @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.
  283. * @param horizontal_accuracy The accuracy of the horizontal position.
  284. * @param vertical_accuracy The accuracy of the vertical position.
  285. * @param barometer_accuracy The accuracy of the barometric altitude.
  286. * @param speed_accuracy The accuracy of the horizontal and vertical speed.
  287. * @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.
  288. * @param timestamp_accuracy The accuracy of the timestamps.
  289. */
  290. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  291. 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)
  292. {
  293. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  294. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN];
  295. _mav_put_int32_t(buf, 0, latitude);
  296. _mav_put_int32_t(buf, 4, longitude);
  297. _mav_put_float(buf, 8, altitude_barometric);
  298. _mav_put_float(buf, 12, altitude_geodetic);
  299. _mav_put_float(buf, 16, height);
  300. _mav_put_float(buf, 20, timestamp);
  301. _mav_put_uint16_t(buf, 24, direction);
  302. _mav_put_uint16_t(buf, 26, speed_horizontal);
  303. _mav_put_int16_t(buf, 28, speed_vertical);
  304. _mav_put_uint8_t(buf, 30, target_system);
  305. _mav_put_uint8_t(buf, 31, target_component);
  306. _mav_put_uint8_t(buf, 52, status);
  307. _mav_put_uint8_t(buf, 53, height_reference);
  308. _mav_put_uint8_t(buf, 54, horizontal_accuracy);
  309. _mav_put_uint8_t(buf, 55, vertical_accuracy);
  310. _mav_put_uint8_t(buf, 56, barometer_accuracy);
  311. _mav_put_uint8_t(buf, 57, speed_accuracy);
  312. _mav_put_uint8_t(buf, 58, timestamp_accuracy);
  313. _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
  314. _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);
  315. #else
  316. mavlink_open_drone_id_location_t packet;
  317. packet.latitude = latitude;
  318. packet.longitude = longitude;
  319. packet.altitude_barometric = altitude_barometric;
  320. packet.altitude_geodetic = altitude_geodetic;
  321. packet.height = height;
  322. packet.timestamp = timestamp;
  323. packet.direction = direction;
  324. packet.speed_horizontal = speed_horizontal;
  325. packet.speed_vertical = speed_vertical;
  326. packet.target_system = target_system;
  327. packet.target_component = target_component;
  328. packet.status = status;
  329. packet.height_reference = height_reference;
  330. packet.horizontal_accuracy = horizontal_accuracy;
  331. packet.vertical_accuracy = vertical_accuracy;
  332. packet.barometer_accuracy = barometer_accuracy;
  333. packet.speed_accuracy = speed_accuracy;
  334. packet.timestamp_accuracy = timestamp_accuracy;
  335. mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  336. _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);
  337. #endif
  338. }
  339. /**
  340. * @brief Send a open_drone_id_location message
  341. * @param chan MAVLink channel to send the message
  342. * @param struct The MAVLink struct to serialize
  343. */
  344. 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)
  345. {
  346. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  347. 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);
  348. #else
  349. _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);
  350. #endif
  351. }
  352. #if MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  353. /*
  354. This variant of _send() can be used to save stack space by re-using
  355. memory from the receive buffer. The caller provides a
  356. mavlink_message_t which is the size of a full mavlink message. This
  357. is usually the receive buffer for the channel, and allows a reply to an
  358. incoming message with minimum stack space usage.
  359. */
  360. 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)
  361. {
  362. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  363. char *buf = (char *)msgbuf;
  364. _mav_put_int32_t(buf, 0, latitude);
  365. _mav_put_int32_t(buf, 4, longitude);
  366. _mav_put_float(buf, 8, altitude_barometric);
  367. _mav_put_float(buf, 12, altitude_geodetic);
  368. _mav_put_float(buf, 16, height);
  369. _mav_put_float(buf, 20, timestamp);
  370. _mav_put_uint16_t(buf, 24, direction);
  371. _mav_put_uint16_t(buf, 26, speed_horizontal);
  372. _mav_put_int16_t(buf, 28, speed_vertical);
  373. _mav_put_uint8_t(buf, 30, target_system);
  374. _mav_put_uint8_t(buf, 31, target_component);
  375. _mav_put_uint8_t(buf, 52, status);
  376. _mav_put_uint8_t(buf, 53, height_reference);
  377. _mav_put_uint8_t(buf, 54, horizontal_accuracy);
  378. _mav_put_uint8_t(buf, 55, vertical_accuracy);
  379. _mav_put_uint8_t(buf, 56, barometer_accuracy);
  380. _mav_put_uint8_t(buf, 57, speed_accuracy);
  381. _mav_put_uint8_t(buf, 58, timestamp_accuracy);
  382. _mav_put_uint8_t_array(buf, 32, id_or_mac, 20);
  383. _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);
  384. #else
  385. mavlink_open_drone_id_location_t *packet = (mavlink_open_drone_id_location_t *)msgbuf;
  386. packet->latitude = latitude;
  387. packet->longitude = longitude;
  388. packet->altitude_barometric = altitude_barometric;
  389. packet->altitude_geodetic = altitude_geodetic;
  390. packet->height = height;
  391. packet->timestamp = timestamp;
  392. packet->direction = direction;
  393. packet->speed_horizontal = speed_horizontal;
  394. packet->speed_vertical = speed_vertical;
  395. packet->target_system = target_system;
  396. packet->target_component = target_component;
  397. packet->status = status;
  398. packet->height_reference = height_reference;
  399. packet->horizontal_accuracy = horizontal_accuracy;
  400. packet->vertical_accuracy = vertical_accuracy;
  401. packet->barometer_accuracy = barometer_accuracy;
  402. packet->speed_accuracy = speed_accuracy;
  403. packet->timestamp_accuracy = timestamp_accuracy;
  404. mav_array_memcpy(packet->id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  405. _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);
  406. #endif
  407. }
  408. #endif
  409. #endif
  410. // MESSAGE OPEN_DRONE_ID_LOCATION UNPACKING
  411. /**
  412. * @brief Get field target_system from open_drone_id_location message
  413. *
  414. * @return System ID (0 for broadcast).
  415. */
  416. static inline uint8_t mavlink_msg_open_drone_id_location_get_target_system(const mavlink_message_t* msg)
  417. {
  418. return _MAV_RETURN_uint8_t(msg, 30);
  419. }
  420. /**
  421. * @brief Get field target_component from open_drone_id_location message
  422. *
  423. * @return Component ID (0 for broadcast).
  424. */
  425. static inline uint8_t mavlink_msg_open_drone_id_location_get_target_component(const mavlink_message_t* msg)
  426. {
  427. return _MAV_RETURN_uint8_t(msg, 31);
  428. }
  429. /**
  430. * @brief Get field id_or_mac from open_drone_id_location message
  431. *
  432. * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
  433. */
  434. static inline uint16_t mavlink_msg_open_drone_id_location_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
  435. {
  436. return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 32);
  437. }
  438. /**
  439. * @brief Get field status from open_drone_id_location message
  440. *
  441. * @return Indicates whether the unmanned aircraft is on the ground or in the air.
  442. */
  443. static inline uint8_t mavlink_msg_open_drone_id_location_get_status(const mavlink_message_t* msg)
  444. {
  445. return _MAV_RETURN_uint8_t(msg, 52);
  446. }
  447. /**
  448. * @brief Get field direction from open_drone_id_location message
  449. *
  450. * @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.
  451. */
  452. static inline uint16_t mavlink_msg_open_drone_id_location_get_direction(const mavlink_message_t* msg)
  453. {
  454. return _MAV_RETURN_uint16_t(msg, 24);
  455. }
  456. /**
  457. * @brief Get field speed_horizontal from open_drone_id_location message
  458. *
  459. * @return [cm/s] Ground speed. Positive only. If unknown: 25500 cm/s. If speed is larger than 25425 cm/s, use 25425 cm/s.
  460. */
  461. static inline uint16_t mavlink_msg_open_drone_id_location_get_speed_horizontal(const mavlink_message_t* msg)
  462. {
  463. return _MAV_RETURN_uint16_t(msg, 26);
  464. }
  465. /**
  466. * @brief Get field speed_vertical from open_drone_id_location message
  467. *
  468. * @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.
  469. */
  470. static inline int16_t mavlink_msg_open_drone_id_location_get_speed_vertical(const mavlink_message_t* msg)
  471. {
  472. return _MAV_RETURN_int16_t(msg, 28);
  473. }
  474. /**
  475. * @brief Get field latitude from open_drone_id_location message
  476. *
  477. * @return [degE7] Current latitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  478. */
  479. static inline int32_t mavlink_msg_open_drone_id_location_get_latitude(const mavlink_message_t* msg)
  480. {
  481. return _MAV_RETURN_int32_t(msg, 0);
  482. }
  483. /**
  484. * @brief Get field longitude from open_drone_id_location message
  485. *
  486. * @return [degE7] Current longitude of the unmanned aircraft. If unknown: 0 (both Lat/Lon).
  487. */
  488. static inline int32_t mavlink_msg_open_drone_id_location_get_longitude(const mavlink_message_t* msg)
  489. {
  490. return _MAV_RETURN_int32_t(msg, 4);
  491. }
  492. /**
  493. * @brief Get field altitude_barometric from open_drone_id_location message
  494. *
  495. * @return [m] The altitude calculated from the barometric pressue. Reference is against 29.92inHg or 1013.2mb. If unknown: -1000 m.
  496. */
  497. static inline float mavlink_msg_open_drone_id_location_get_altitude_barometric(const mavlink_message_t* msg)
  498. {
  499. return _MAV_RETURN_float(msg, 8);
  500. }
  501. /**
  502. * @brief Get field altitude_geodetic from open_drone_id_location message
  503. *
  504. * @return [m] The geodetic altitude as defined by WGS84. If unknown: -1000 m.
  505. */
  506. static inline float mavlink_msg_open_drone_id_location_get_altitude_geodetic(const mavlink_message_t* msg)
  507. {
  508. return _MAV_RETURN_float(msg, 12);
  509. }
  510. /**
  511. * @brief Get field height_reference from open_drone_id_location message
  512. *
  513. * @return Indicates the reference point for the height field.
  514. */
  515. static inline uint8_t mavlink_msg_open_drone_id_location_get_height_reference(const mavlink_message_t* msg)
  516. {
  517. return _MAV_RETURN_uint8_t(msg, 53);
  518. }
  519. /**
  520. * @brief Get field height from open_drone_id_location message
  521. *
  522. * @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.
  523. */
  524. static inline float mavlink_msg_open_drone_id_location_get_height(const mavlink_message_t* msg)
  525. {
  526. return _MAV_RETURN_float(msg, 16);
  527. }
  528. /**
  529. * @brief Get field horizontal_accuracy from open_drone_id_location message
  530. *
  531. * @return The accuracy of the horizontal position.
  532. */
  533. static inline uint8_t mavlink_msg_open_drone_id_location_get_horizontal_accuracy(const mavlink_message_t* msg)
  534. {
  535. return _MAV_RETURN_uint8_t(msg, 54);
  536. }
  537. /**
  538. * @brief Get field vertical_accuracy from open_drone_id_location message
  539. *
  540. * @return The accuracy of the vertical position.
  541. */
  542. static inline uint8_t mavlink_msg_open_drone_id_location_get_vertical_accuracy(const mavlink_message_t* msg)
  543. {
  544. return _MAV_RETURN_uint8_t(msg, 55);
  545. }
  546. /**
  547. * @brief Get field barometer_accuracy from open_drone_id_location message
  548. *
  549. * @return The accuracy of the barometric altitude.
  550. */
  551. static inline uint8_t mavlink_msg_open_drone_id_location_get_barometer_accuracy(const mavlink_message_t* msg)
  552. {
  553. return _MAV_RETURN_uint8_t(msg, 56);
  554. }
  555. /**
  556. * @brief Get field speed_accuracy from open_drone_id_location message
  557. *
  558. * @return The accuracy of the horizontal and vertical speed.
  559. */
  560. static inline uint8_t mavlink_msg_open_drone_id_location_get_speed_accuracy(const mavlink_message_t* msg)
  561. {
  562. return _MAV_RETURN_uint8_t(msg, 57);
  563. }
  564. /**
  565. * @brief Get field timestamp from open_drone_id_location message
  566. *
  567. * @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.
  568. */
  569. static inline float mavlink_msg_open_drone_id_location_get_timestamp(const mavlink_message_t* msg)
  570. {
  571. return _MAV_RETURN_float(msg, 20);
  572. }
  573. /**
  574. * @brief Get field timestamp_accuracy from open_drone_id_location message
  575. *
  576. * @return The accuracy of the timestamps.
  577. */
  578. static inline uint8_t mavlink_msg_open_drone_id_location_get_timestamp_accuracy(const mavlink_message_t* msg)
  579. {
  580. return _MAV_RETURN_uint8_t(msg, 58);
  581. }
  582. /**
  583. * @brief Decode a open_drone_id_location message into a struct
  584. *
  585. * @param msg The message to decode
  586. * @param open_drone_id_location C-struct to decode the message contents into
  587. */
  588. 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)
  589. {
  590. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  591. open_drone_id_location->latitude = mavlink_msg_open_drone_id_location_get_latitude(msg);
  592. open_drone_id_location->longitude = mavlink_msg_open_drone_id_location_get_longitude(msg);
  593. open_drone_id_location->altitude_barometric = mavlink_msg_open_drone_id_location_get_altitude_barometric(msg);
  594. open_drone_id_location->altitude_geodetic = mavlink_msg_open_drone_id_location_get_altitude_geodetic(msg);
  595. open_drone_id_location->height = mavlink_msg_open_drone_id_location_get_height(msg);
  596. open_drone_id_location->timestamp = mavlink_msg_open_drone_id_location_get_timestamp(msg);
  597. open_drone_id_location->direction = mavlink_msg_open_drone_id_location_get_direction(msg);
  598. open_drone_id_location->speed_horizontal = mavlink_msg_open_drone_id_location_get_speed_horizontal(msg);
  599. open_drone_id_location->speed_vertical = mavlink_msg_open_drone_id_location_get_speed_vertical(msg);
  600. open_drone_id_location->target_system = mavlink_msg_open_drone_id_location_get_target_system(msg);
  601. open_drone_id_location->target_component = mavlink_msg_open_drone_id_location_get_target_component(msg);
  602. mavlink_msg_open_drone_id_location_get_id_or_mac(msg, open_drone_id_location->id_or_mac);
  603. open_drone_id_location->status = mavlink_msg_open_drone_id_location_get_status(msg);
  604. open_drone_id_location->height_reference = mavlink_msg_open_drone_id_location_get_height_reference(msg);
  605. open_drone_id_location->horizontal_accuracy = mavlink_msg_open_drone_id_location_get_horizontal_accuracy(msg);
  606. open_drone_id_location->vertical_accuracy = mavlink_msg_open_drone_id_location_get_vertical_accuracy(msg);
  607. open_drone_id_location->barometer_accuracy = mavlink_msg_open_drone_id_location_get_barometer_accuracy(msg);
  608. open_drone_id_location->speed_accuracy = mavlink_msg_open_drone_id_location_get_speed_accuracy(msg);
  609. open_drone_id_location->timestamp_accuracy = mavlink_msg_open_drone_id_location_get_timestamp_accuracy(msg);
  610. #else
  611. uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN;
  612. memset(open_drone_id_location, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_LOCATION_LEN);
  613. memcpy(open_drone_id_location, _MAV_PAYLOAD(msg), len);
  614. #endif
  615. }