mavlink_msg_open_drone_id_basic_id.h 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391
  1. #pragma once
  2. // MESSAGE OPEN_DRONE_ID_BASIC_ID PACKING
  3. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID 12900
  4. typedef struct __mavlink_open_drone_id_basic_id_t {
  5. uint8_t target_system; /*< System ID (0 for broadcast).*/
  6. uint8_t target_component; /*< Component ID (0 for broadcast).*/
  7. 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. */
  8. uint8_t id_type; /*< Indicates the format for the uas_id field of this message.*/
  9. uint8_t ua_type; /*< Indicates the type of UA (Unmanned Aircraft).*/
  10. uint8_t uas_id[20]; /*< UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.*/
  11. } mavlink_open_drone_id_basic_id_t;
  12. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN 44
  13. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN 44
  14. #define MAVLINK_MSG_ID_12900_LEN 44
  15. #define MAVLINK_MSG_ID_12900_MIN_LEN 44
  16. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC 114
  17. #define MAVLINK_MSG_ID_12900_CRC 114
  18. #define MAVLINK_MSG_OPEN_DRONE_ID_BASIC_ID_FIELD_ID_OR_MAC_LEN 20
  19. #define MAVLINK_MSG_OPEN_DRONE_ID_BASIC_ID_FIELD_UAS_ID_LEN 20
  20. #if MAVLINK_COMMAND_24BIT
  21. #define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_BASIC_ID { \
  22. 12900, \
  23. "OPEN_DRONE_ID_BASIC_ID", \
  24. 6, \
  25. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_open_drone_id_basic_id_t, target_system) }, \
  26. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_open_drone_id_basic_id_t, target_component) }, \
  27. { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 2, offsetof(mavlink_open_drone_id_basic_id_t, id_or_mac) }, \
  28. { "id_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_open_drone_id_basic_id_t, id_type) }, \
  29. { "ua_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_open_drone_id_basic_id_t, ua_type) }, \
  30. { "uas_id", NULL, MAVLINK_TYPE_UINT8_T, 20, 24, offsetof(mavlink_open_drone_id_basic_id_t, uas_id) }, \
  31. } \
  32. }
  33. #else
  34. #define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_BASIC_ID { \
  35. "OPEN_DRONE_ID_BASIC_ID", \
  36. 6, \
  37. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 0, offsetof(mavlink_open_drone_id_basic_id_t, target_system) }, \
  38. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 1, offsetof(mavlink_open_drone_id_basic_id_t, target_component) }, \
  39. { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 2, offsetof(mavlink_open_drone_id_basic_id_t, id_or_mac) }, \
  40. { "id_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 22, offsetof(mavlink_open_drone_id_basic_id_t, id_type) }, \
  41. { "ua_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 23, offsetof(mavlink_open_drone_id_basic_id_t, ua_type) }, \
  42. { "uas_id", NULL, MAVLINK_TYPE_UINT8_T, 20, 24, offsetof(mavlink_open_drone_id_basic_id_t, uas_id) }, \
  43. } \
  44. }
  45. #endif
  46. /**
  47. * @brief Pack a open_drone_id_basic_id message
  48. * @param system_id ID of this system
  49. * @param component_id ID of this component (e.g. 200 for IMU)
  50. * @param msg The MAVLink message to compress the data into
  51. *
  52. * @param target_system System ID (0 for broadcast).
  53. * @param target_component Component ID (0 for broadcast).
  54. * @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.
  55. * @param id_type Indicates the format for the uas_id field of this message.
  56. * @param ua_type Indicates the type of UA (Unmanned Aircraft).
  57. * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
  58. * @return length of the message in bytes (excluding serial stream start sign)
  59. */
  60. static inline uint16_t mavlink_msg_open_drone_id_basic_id_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  61. uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t id_type, uint8_t ua_type, const uint8_t *uas_id)
  62. {
  63. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  64. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN];
  65. _mav_put_uint8_t(buf, 0, target_system);
  66. _mav_put_uint8_t(buf, 1, target_component);
  67. _mav_put_uint8_t(buf, 22, id_type);
  68. _mav_put_uint8_t(buf, 23, ua_type);
  69. _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
  70. _mav_put_uint8_t_array(buf, 24, uas_id, 20);
  71. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  72. #else
  73. mavlink_open_drone_id_basic_id_t packet;
  74. packet.target_system = target_system;
  75. packet.target_component = target_component;
  76. packet.id_type = id_type;
  77. packet.ua_type = ua_type;
  78. mav_array_assign_uint8_t(packet.id_or_mac, id_or_mac, 20);
  79. mav_array_assign_uint8_t(packet.uas_id, uas_id, 20);
  80. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  81. #endif
  82. msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID;
  83. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  84. }
  85. /**
  86. * @brief Pack a open_drone_id_basic_id message
  87. * @param system_id ID of this system
  88. * @param component_id ID of this component (e.g. 200 for IMU)
  89. * @param status MAVLink status structure
  90. * @param msg The MAVLink message to compress the data into
  91. *
  92. * @param target_system System ID (0 for broadcast).
  93. * @param target_component Component ID (0 for broadcast).
  94. * @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.
  95. * @param id_type Indicates the format for the uas_id field of this message.
  96. * @param ua_type Indicates the type of UA (Unmanned Aircraft).
  97. * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
  98. * @return length of the message in bytes (excluding serial stream start sign)
  99. */
  100. static inline uint16_t mavlink_msg_open_drone_id_basic_id_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
  101. uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t id_type, uint8_t ua_type, const uint8_t *uas_id)
  102. {
  103. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  104. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN];
  105. _mav_put_uint8_t(buf, 0, target_system);
  106. _mav_put_uint8_t(buf, 1, target_component);
  107. _mav_put_uint8_t(buf, 22, id_type);
  108. _mav_put_uint8_t(buf, 23, ua_type);
  109. _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
  110. _mav_put_uint8_t_array(buf, 24, uas_id, 20);
  111. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  112. #else
  113. mavlink_open_drone_id_basic_id_t packet;
  114. packet.target_system = target_system;
  115. packet.target_component = target_component;
  116. packet.id_type = id_type;
  117. packet.ua_type = ua_type;
  118. mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  119. mav_array_memcpy(packet.uas_id, uas_id, sizeof(uint8_t)*20);
  120. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  121. #endif
  122. msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID;
  123. #if MAVLINK_CRC_EXTRA
  124. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  125. #else
  126. return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  127. #endif
  128. }
  129. /**
  130. * @brief Pack a open_drone_id_basic_id message on a channel
  131. * @param system_id ID of this system
  132. * @param component_id ID of this component (e.g. 200 for IMU)
  133. * @param chan The MAVLink channel this message will be sent over
  134. * @param msg The MAVLink message to compress the data into
  135. * @param target_system System ID (0 for broadcast).
  136. * @param target_component Component ID (0 for broadcast).
  137. * @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.
  138. * @param id_type Indicates the format for the uas_id field of this message.
  139. * @param ua_type Indicates the type of UA (Unmanned Aircraft).
  140. * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
  141. * @return length of the message in bytes (excluding serial stream start sign)
  142. */
  143. static inline uint16_t mavlink_msg_open_drone_id_basic_id_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  144. mavlink_message_t* msg,
  145. uint8_t target_system,uint8_t target_component,const uint8_t *id_or_mac,uint8_t id_type,uint8_t ua_type,const uint8_t *uas_id)
  146. {
  147. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  148. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN];
  149. _mav_put_uint8_t(buf, 0, target_system);
  150. _mav_put_uint8_t(buf, 1, target_component);
  151. _mav_put_uint8_t(buf, 22, id_type);
  152. _mav_put_uint8_t(buf, 23, ua_type);
  153. _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
  154. _mav_put_uint8_t_array(buf, 24, uas_id, 20);
  155. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  156. #else
  157. mavlink_open_drone_id_basic_id_t packet;
  158. packet.target_system = target_system;
  159. packet.target_component = target_component;
  160. packet.id_type = id_type;
  161. packet.ua_type = ua_type;
  162. mav_array_assign_uint8_t(packet.id_or_mac, id_or_mac, 20);
  163. mav_array_assign_uint8_t(packet.uas_id, uas_id, 20);
  164. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  165. #endif
  166. msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID;
  167. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  168. }
  169. /**
  170. * @brief Encode a open_drone_id_basic_id struct
  171. *
  172. * @param system_id ID of this system
  173. * @param component_id ID of this component (e.g. 200 for IMU)
  174. * @param msg The MAVLink message to compress the data into
  175. * @param open_drone_id_basic_id C-struct to read the message contents from
  176. */
  177. static inline uint16_t mavlink_msg_open_drone_id_basic_id_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
  178. {
  179. return mavlink_msg_open_drone_id_basic_id_pack(system_id, component_id, msg, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
  180. }
  181. /**
  182. * @brief Encode a open_drone_id_basic_id struct on a channel
  183. *
  184. * @param system_id ID of this system
  185. * @param component_id ID of this component (e.g. 200 for IMU)
  186. * @param chan The MAVLink channel this message will be sent over
  187. * @param msg The MAVLink message to compress the data into
  188. * @param open_drone_id_basic_id C-struct to read the message contents from
  189. */
  190. static inline uint16_t mavlink_msg_open_drone_id_basic_id_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
  191. {
  192. return mavlink_msg_open_drone_id_basic_id_pack_chan(system_id, component_id, chan, msg, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
  193. }
  194. /**
  195. * @brief Encode a open_drone_id_basic_id struct with provided status structure
  196. *
  197. * @param system_id ID of this system
  198. * @param component_id ID of this component (e.g. 200 for IMU)
  199. * @param status MAVLink status structure
  200. * @param msg The MAVLink message to compress the data into
  201. * @param open_drone_id_basic_id C-struct to read the message contents from
  202. */
  203. static inline uint16_t mavlink_msg_open_drone_id_basic_id_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
  204. {
  205. return mavlink_msg_open_drone_id_basic_id_pack_status(system_id, component_id, _status, msg, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
  206. }
  207. /**
  208. * @brief Send a open_drone_id_basic_id message
  209. * @param chan MAVLink channel to send the message
  210. *
  211. * @param target_system System ID (0 for broadcast).
  212. * @param target_component Component ID (0 for broadcast).
  213. * @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.
  214. * @param id_type Indicates the format for the uas_id field of this message.
  215. * @param ua_type Indicates the type of UA (Unmanned Aircraft).
  216. * @param uas_id UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
  217. */
  218. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  219. static inline void mavlink_msg_open_drone_id_basic_id_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t id_type, uint8_t ua_type, const uint8_t *uas_id)
  220. {
  221. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  222. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN];
  223. _mav_put_uint8_t(buf, 0, target_system);
  224. _mav_put_uint8_t(buf, 1, target_component);
  225. _mav_put_uint8_t(buf, 22, id_type);
  226. _mav_put_uint8_t(buf, 23, ua_type);
  227. _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
  228. _mav_put_uint8_t_array(buf, 24, uas_id, 20);
  229. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  230. #else
  231. mavlink_open_drone_id_basic_id_t packet;
  232. packet.target_system = target_system;
  233. packet.target_component = target_component;
  234. packet.id_type = id_type;
  235. packet.ua_type = ua_type;
  236. mav_array_assign_uint8_t(packet.id_or_mac, id_or_mac, 20);
  237. mav_array_assign_uint8_t(packet.uas_id, uas_id, 20);
  238. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, (const char *)&packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  239. #endif
  240. }
  241. /**
  242. * @brief Send a open_drone_id_basic_id message
  243. * @param chan MAVLink channel to send the message
  244. * @param struct The MAVLink struct to serialize
  245. */
  246. static inline void mavlink_msg_open_drone_id_basic_id_send_struct(mavlink_channel_t chan, const mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
  247. {
  248. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  249. mavlink_msg_open_drone_id_basic_id_send(chan, open_drone_id_basic_id->target_system, open_drone_id_basic_id->target_component, open_drone_id_basic_id->id_or_mac, open_drone_id_basic_id->id_type, open_drone_id_basic_id->ua_type, open_drone_id_basic_id->uas_id);
  250. #else
  251. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, (const char *)open_drone_id_basic_id, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  252. #endif
  253. }
  254. #if MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  255. /*
  256. This variant of _send() can be used to save stack space by reusing
  257. memory from the receive buffer. The caller provides a
  258. mavlink_message_t which is the size of a full mavlink message. This
  259. is usually the receive buffer for the channel, and allows a reply to an
  260. incoming message with minimum stack space usage.
  261. */
  262. static inline void mavlink_msg_open_drone_id_basic_id_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 id_type, uint8_t ua_type, const uint8_t *uas_id)
  263. {
  264. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  265. char *buf = (char *)msgbuf;
  266. _mav_put_uint8_t(buf, 0, target_system);
  267. _mav_put_uint8_t(buf, 1, target_component);
  268. _mav_put_uint8_t(buf, 22, id_type);
  269. _mav_put_uint8_t(buf, 23, ua_type);
  270. _mav_put_uint8_t_array(buf, 2, id_or_mac, 20);
  271. _mav_put_uint8_t_array(buf, 24, uas_id, 20);
  272. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  273. #else
  274. mavlink_open_drone_id_basic_id_t *packet = (mavlink_open_drone_id_basic_id_t *)msgbuf;
  275. packet->target_system = target_system;
  276. packet->target_component = target_component;
  277. packet->id_type = id_type;
  278. packet->ua_type = ua_type;
  279. mav_array_assign_uint8_t(packet->id_or_mac, id_or_mac, 20);
  280. mav_array_assign_uint8_t(packet->uas_id, uas_id, 20);
  281. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID, (const char *)packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_CRC);
  282. #endif
  283. }
  284. #endif
  285. #endif
  286. // MESSAGE OPEN_DRONE_ID_BASIC_ID UNPACKING
  287. /**
  288. * @brief Get field target_system from open_drone_id_basic_id message
  289. *
  290. * @return System ID (0 for broadcast).
  291. */
  292. static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_target_system(const mavlink_message_t* msg)
  293. {
  294. return _MAV_RETURN_uint8_t(msg, 0);
  295. }
  296. /**
  297. * @brief Get field target_component from open_drone_id_basic_id message
  298. *
  299. * @return Component ID (0 for broadcast).
  300. */
  301. static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_target_component(const mavlink_message_t* msg)
  302. {
  303. return _MAV_RETURN_uint8_t(msg, 1);
  304. }
  305. /**
  306. * @brief Get field id_or_mac from open_drone_id_basic_id message
  307. *
  308. * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
  309. */
  310. static inline uint16_t mavlink_msg_open_drone_id_basic_id_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
  311. {
  312. return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 2);
  313. }
  314. /**
  315. * @brief Get field id_type from open_drone_id_basic_id message
  316. *
  317. * @return Indicates the format for the uas_id field of this message.
  318. */
  319. static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_id_type(const mavlink_message_t* msg)
  320. {
  321. return _MAV_RETURN_uint8_t(msg, 22);
  322. }
  323. /**
  324. * @brief Get field ua_type from open_drone_id_basic_id message
  325. *
  326. * @return Indicates the type of UA (Unmanned Aircraft).
  327. */
  328. static inline uint8_t mavlink_msg_open_drone_id_basic_id_get_ua_type(const mavlink_message_t* msg)
  329. {
  330. return _MAV_RETURN_uint8_t(msg, 23);
  331. }
  332. /**
  333. * @brief Get field uas_id from open_drone_id_basic_id message
  334. *
  335. * @return UAS (Unmanned Aircraft System) ID following the format specified by id_type. Shall be filled with nulls in the unused portion of the field.
  336. */
  337. static inline uint16_t mavlink_msg_open_drone_id_basic_id_get_uas_id(const mavlink_message_t* msg, uint8_t *uas_id)
  338. {
  339. return _MAV_RETURN_uint8_t_array(msg, uas_id, 20, 24);
  340. }
  341. /**
  342. * @brief Decode a open_drone_id_basic_id message into a struct
  343. *
  344. * @param msg The message to decode
  345. * @param open_drone_id_basic_id C-struct to decode the message contents into
  346. */
  347. static inline void mavlink_msg_open_drone_id_basic_id_decode(const mavlink_message_t* msg, mavlink_open_drone_id_basic_id_t* open_drone_id_basic_id)
  348. {
  349. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  350. open_drone_id_basic_id->target_system = mavlink_msg_open_drone_id_basic_id_get_target_system(msg);
  351. open_drone_id_basic_id->target_component = mavlink_msg_open_drone_id_basic_id_get_target_component(msg);
  352. mavlink_msg_open_drone_id_basic_id_get_id_or_mac(msg, open_drone_id_basic_id->id_or_mac);
  353. open_drone_id_basic_id->id_type = mavlink_msg_open_drone_id_basic_id_get_id_type(msg);
  354. open_drone_id_basic_id->ua_type = mavlink_msg_open_drone_id_basic_id_get_ua_type(msg);
  355. mavlink_msg_open_drone_id_basic_id_get_uas_id(msg, open_drone_id_basic_id->uas_id);
  356. #else
  357. uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN;
  358. memset(open_drone_id_basic_id, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_BASIC_ID_LEN);
  359. memcpy(open_drone_id_basic_id, _MAV_PAYLOAD(msg), len);
  360. #endif
  361. }