mavlink_msg_open_drone_id_system.h 32 KB

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