mavlink_msg_open_drone_id_authentication.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. #pragma once
  2. // MESSAGE OPEN_DRONE_ID_AUTHENTICATION PACKING
  3. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION 12902
  4. typedef struct __mavlink_open_drone_id_authentication_t {
  5. uint32_t timestamp; /*< [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.*/
  6. uint8_t target_system; /*< System ID (0 for broadcast).*/
  7. uint8_t target_component; /*< Component ID (0 for broadcast).*/
  8. 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. */
  9. uint8_t authentication_type; /*< Indicates the type of authentication.*/
  10. uint8_t data_page; /*< Allowed range is 0 - 15.*/
  11. uint8_t last_page_index; /*< This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.*/
  12. uint8_t length; /*< [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.*/
  13. uint8_t authentication_data[23]; /*< Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.*/
  14. } mavlink_open_drone_id_authentication_t;
  15. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN 53
  16. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN 53
  17. #define MAVLINK_MSG_ID_12902_LEN 53
  18. #define MAVLINK_MSG_ID_12902_MIN_LEN 53
  19. #define MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC 140
  20. #define MAVLINK_MSG_ID_12902_CRC 140
  21. #define MAVLINK_MSG_OPEN_DRONE_ID_AUTHENTICATION_FIELD_ID_OR_MAC_LEN 20
  22. #define MAVLINK_MSG_OPEN_DRONE_ID_AUTHENTICATION_FIELD_AUTHENTICATION_DATA_LEN 23
  23. #if MAVLINK_COMMAND_24BIT
  24. #define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_AUTHENTICATION { \
  25. 12902, \
  26. "OPEN_DRONE_ID_AUTHENTICATION", \
  27. 9, \
  28. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_open_drone_id_authentication_t, target_system) }, \
  29. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_open_drone_id_authentication_t, target_component) }, \
  30. { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 6, offsetof(mavlink_open_drone_id_authentication_t, id_or_mac) }, \
  31. { "authentication_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_open_drone_id_authentication_t, authentication_type) }, \
  32. { "data_page", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_open_drone_id_authentication_t, data_page) }, \
  33. { "last_page_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_open_drone_id_authentication_t, last_page_index) }, \
  34. { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_open_drone_id_authentication_t, length) }, \
  35. { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_open_drone_id_authentication_t, timestamp) }, \
  36. { "authentication_data", NULL, MAVLINK_TYPE_UINT8_T, 23, 30, offsetof(mavlink_open_drone_id_authentication_t, authentication_data) }, \
  37. } \
  38. }
  39. #else
  40. #define MAVLINK_MESSAGE_INFO_OPEN_DRONE_ID_AUTHENTICATION { \
  41. "OPEN_DRONE_ID_AUTHENTICATION", \
  42. 9, \
  43. { { "target_system", NULL, MAVLINK_TYPE_UINT8_T, 0, 4, offsetof(mavlink_open_drone_id_authentication_t, target_system) }, \
  44. { "target_component", NULL, MAVLINK_TYPE_UINT8_T, 0, 5, offsetof(mavlink_open_drone_id_authentication_t, target_component) }, \
  45. { "id_or_mac", NULL, MAVLINK_TYPE_UINT8_T, 20, 6, offsetof(mavlink_open_drone_id_authentication_t, id_or_mac) }, \
  46. { "authentication_type", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_open_drone_id_authentication_t, authentication_type) }, \
  47. { "data_page", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_open_drone_id_authentication_t, data_page) }, \
  48. { "last_page_index", NULL, MAVLINK_TYPE_UINT8_T, 0, 28, offsetof(mavlink_open_drone_id_authentication_t, last_page_index) }, \
  49. { "length", NULL, MAVLINK_TYPE_UINT8_T, 0, 29, offsetof(mavlink_open_drone_id_authentication_t, length) }, \
  50. { "timestamp", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_open_drone_id_authentication_t, timestamp) }, \
  51. { "authentication_data", NULL, MAVLINK_TYPE_UINT8_T, 23, 30, offsetof(mavlink_open_drone_id_authentication_t, authentication_data) }, \
  52. } \
  53. }
  54. #endif
  55. /**
  56. * @brief Pack a open_drone_id_authentication message
  57. * @param system_id ID of this system
  58. * @param component_id ID of this component (e.g. 200 for IMU)
  59. * @param msg The MAVLink message to compress the data into
  60. *
  61. * @param target_system System ID (0 for broadcast).
  62. * @param target_component Component ID (0 for broadcast).
  63. * @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.
  64. * @param authentication_type Indicates the type of authentication.
  65. * @param data_page Allowed range is 0 - 15.
  66. * @param last_page_index This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  67. * @param length [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  68. * @param timestamp [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
  69. * @param authentication_data Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
  70. * @return length of the message in bytes (excluding serial stream start sign)
  71. */
  72. static inline uint16_t mavlink_msg_open_drone_id_authentication_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
  73. uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t authentication_type, uint8_t data_page, uint8_t last_page_index, uint8_t length, uint32_t timestamp, const uint8_t *authentication_data)
  74. {
  75. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  76. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN];
  77. _mav_put_uint32_t(buf, 0, timestamp);
  78. _mav_put_uint8_t(buf, 4, target_system);
  79. _mav_put_uint8_t(buf, 5, target_component);
  80. _mav_put_uint8_t(buf, 26, authentication_type);
  81. _mav_put_uint8_t(buf, 27, data_page);
  82. _mav_put_uint8_t(buf, 28, last_page_index);
  83. _mav_put_uint8_t(buf, 29, length);
  84. _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
  85. _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
  86. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
  87. #else
  88. mavlink_open_drone_id_authentication_t packet;
  89. packet.timestamp = timestamp;
  90. packet.target_system = target_system;
  91. packet.target_component = target_component;
  92. packet.authentication_type = authentication_type;
  93. packet.data_page = data_page;
  94. packet.last_page_index = last_page_index;
  95. packet.length = length;
  96. mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  97. mav_array_memcpy(packet.authentication_data, authentication_data, sizeof(uint8_t)*23);
  98. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
  99. #endif
  100. msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION;
  101. return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
  102. }
  103. /**
  104. * @brief Pack a open_drone_id_authentication message on a channel
  105. * @param system_id ID of this system
  106. * @param component_id ID of this component (e.g. 200 for IMU)
  107. * @param chan The MAVLink channel this message will be sent over
  108. * @param msg The MAVLink message to compress the data into
  109. * @param target_system System ID (0 for broadcast).
  110. * @param target_component Component ID (0 for broadcast).
  111. * @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.
  112. * @param authentication_type Indicates the type of authentication.
  113. * @param data_page Allowed range is 0 - 15.
  114. * @param last_page_index This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  115. * @param length [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  116. * @param timestamp [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
  117. * @param authentication_data Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
  118. * @return length of the message in bytes (excluding serial stream start sign)
  119. */
  120. static inline uint16_t mavlink_msg_open_drone_id_authentication_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
  121. mavlink_message_t* msg,
  122. uint8_t target_system,uint8_t target_component,const uint8_t *id_or_mac,uint8_t authentication_type,uint8_t data_page,uint8_t last_page_index,uint8_t length,uint32_t timestamp,const uint8_t *authentication_data)
  123. {
  124. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  125. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN];
  126. _mav_put_uint32_t(buf, 0, timestamp);
  127. _mav_put_uint8_t(buf, 4, target_system);
  128. _mav_put_uint8_t(buf, 5, target_component);
  129. _mav_put_uint8_t(buf, 26, authentication_type);
  130. _mav_put_uint8_t(buf, 27, data_page);
  131. _mav_put_uint8_t(buf, 28, last_page_index);
  132. _mav_put_uint8_t(buf, 29, length);
  133. _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
  134. _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
  135. memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
  136. #else
  137. mavlink_open_drone_id_authentication_t packet;
  138. packet.timestamp = timestamp;
  139. packet.target_system = target_system;
  140. packet.target_component = target_component;
  141. packet.authentication_type = authentication_type;
  142. packet.data_page = data_page;
  143. packet.last_page_index = last_page_index;
  144. packet.length = length;
  145. mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  146. mav_array_memcpy(packet.authentication_data, authentication_data, sizeof(uint8_t)*23);
  147. memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
  148. #endif
  149. msg->msgid = MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION;
  150. return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
  151. }
  152. /**
  153. * @brief Encode a open_drone_id_authentication struct
  154. *
  155. * @param system_id ID of this system
  156. * @param component_id ID of this component (e.g. 200 for IMU)
  157. * @param msg The MAVLink message to compress the data into
  158. * @param open_drone_id_authentication C-struct to read the message contents from
  159. */
  160. static inline uint16_t mavlink_msg_open_drone_id_authentication_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
  161. {
  162. return mavlink_msg_open_drone_id_authentication_pack(system_id, component_id, msg, open_drone_id_authentication->target_system, open_drone_id_authentication->target_component, open_drone_id_authentication->id_or_mac, open_drone_id_authentication->authentication_type, open_drone_id_authentication->data_page, open_drone_id_authentication->last_page_index, open_drone_id_authentication->length, open_drone_id_authentication->timestamp, open_drone_id_authentication->authentication_data);
  163. }
  164. /**
  165. * @brief Encode a open_drone_id_authentication struct on a channel
  166. *
  167. * @param system_id ID of this system
  168. * @param component_id ID of this component (e.g. 200 for IMU)
  169. * @param chan The MAVLink channel this message will be sent over
  170. * @param msg The MAVLink message to compress the data into
  171. * @param open_drone_id_authentication C-struct to read the message contents from
  172. */
  173. static inline uint16_t mavlink_msg_open_drone_id_authentication_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
  174. {
  175. return mavlink_msg_open_drone_id_authentication_pack_chan(system_id, component_id, chan, msg, open_drone_id_authentication->target_system, open_drone_id_authentication->target_component, open_drone_id_authentication->id_or_mac, open_drone_id_authentication->authentication_type, open_drone_id_authentication->data_page, open_drone_id_authentication->last_page_index, open_drone_id_authentication->length, open_drone_id_authentication->timestamp, open_drone_id_authentication->authentication_data);
  176. }
  177. /**
  178. * @brief Send a open_drone_id_authentication message
  179. * @param chan MAVLink channel to send the message
  180. *
  181. * @param target_system System ID (0 for broadcast).
  182. * @param target_component Component ID (0 for broadcast).
  183. * @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.
  184. * @param authentication_type Indicates the type of authentication.
  185. * @param data_page Allowed range is 0 - 15.
  186. * @param last_page_index This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  187. * @param length [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  188. * @param timestamp [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
  189. * @param authentication_data Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
  190. */
  191. #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
  192. static inline void mavlink_msg_open_drone_id_authentication_send(mavlink_channel_t chan, uint8_t target_system, uint8_t target_component, const uint8_t *id_or_mac, uint8_t authentication_type, uint8_t data_page, uint8_t last_page_index, uint8_t length, uint32_t timestamp, const uint8_t *authentication_data)
  193. {
  194. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  195. char buf[MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN];
  196. _mav_put_uint32_t(buf, 0, timestamp);
  197. _mav_put_uint8_t(buf, 4, target_system);
  198. _mav_put_uint8_t(buf, 5, target_component);
  199. _mav_put_uint8_t(buf, 26, authentication_type);
  200. _mav_put_uint8_t(buf, 27, data_page);
  201. _mav_put_uint8_t(buf, 28, last_page_index);
  202. _mav_put_uint8_t(buf, 29, length);
  203. _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
  204. _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
  205. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
  206. #else
  207. mavlink_open_drone_id_authentication_t packet;
  208. packet.timestamp = timestamp;
  209. packet.target_system = target_system;
  210. packet.target_component = target_component;
  211. packet.authentication_type = authentication_type;
  212. packet.data_page = data_page;
  213. packet.last_page_index = last_page_index;
  214. packet.length = length;
  215. mav_array_memcpy(packet.id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  216. mav_array_memcpy(packet.authentication_data, authentication_data, sizeof(uint8_t)*23);
  217. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, (const char *)&packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
  218. #endif
  219. }
  220. /**
  221. * @brief Send a open_drone_id_authentication message
  222. * @param chan MAVLink channel to send the message
  223. * @param struct The MAVLink struct to serialize
  224. */
  225. static inline void mavlink_msg_open_drone_id_authentication_send_struct(mavlink_channel_t chan, const mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
  226. {
  227. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  228. mavlink_msg_open_drone_id_authentication_send(chan, open_drone_id_authentication->target_system, open_drone_id_authentication->target_component, open_drone_id_authentication->id_or_mac, open_drone_id_authentication->authentication_type, open_drone_id_authentication->data_page, open_drone_id_authentication->last_page_index, open_drone_id_authentication->length, open_drone_id_authentication->timestamp, open_drone_id_authentication->authentication_data);
  229. #else
  230. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, (const char *)open_drone_id_authentication, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
  231. #endif
  232. }
  233. #if MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
  234. /*
  235. This variant of _send() can be used to save stack space by re-using
  236. memory from the receive buffer. The caller provides a
  237. mavlink_message_t which is the size of a full mavlink message. This
  238. is usually the receive buffer for the channel, and allows a reply to an
  239. incoming message with minimum stack space usage.
  240. */
  241. static inline void mavlink_msg_open_drone_id_authentication_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 authentication_type, uint8_t data_page, uint8_t last_page_index, uint8_t length, uint32_t timestamp, const uint8_t *authentication_data)
  242. {
  243. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  244. char *buf = (char *)msgbuf;
  245. _mav_put_uint32_t(buf, 0, timestamp);
  246. _mav_put_uint8_t(buf, 4, target_system);
  247. _mav_put_uint8_t(buf, 5, target_component);
  248. _mav_put_uint8_t(buf, 26, authentication_type);
  249. _mav_put_uint8_t(buf, 27, data_page);
  250. _mav_put_uint8_t(buf, 28, last_page_index);
  251. _mav_put_uint8_t(buf, 29, length);
  252. _mav_put_uint8_t_array(buf, 6, id_or_mac, 20);
  253. _mav_put_uint8_t_array(buf, 30, authentication_data, 23);
  254. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, buf, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
  255. #else
  256. mavlink_open_drone_id_authentication_t *packet = (mavlink_open_drone_id_authentication_t *)msgbuf;
  257. packet->timestamp = timestamp;
  258. packet->target_system = target_system;
  259. packet->target_component = target_component;
  260. packet->authentication_type = authentication_type;
  261. packet->data_page = data_page;
  262. packet->last_page_index = last_page_index;
  263. packet->length = length;
  264. mav_array_memcpy(packet->id_or_mac, id_or_mac, sizeof(uint8_t)*20);
  265. mav_array_memcpy(packet->authentication_data, authentication_data, sizeof(uint8_t)*23);
  266. _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION, (const char *)packet, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_MIN_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_CRC);
  267. #endif
  268. }
  269. #endif
  270. #endif
  271. // MESSAGE OPEN_DRONE_ID_AUTHENTICATION UNPACKING
  272. /**
  273. * @brief Get field target_system from open_drone_id_authentication message
  274. *
  275. * @return System ID (0 for broadcast).
  276. */
  277. static inline uint8_t mavlink_msg_open_drone_id_authentication_get_target_system(const mavlink_message_t* msg)
  278. {
  279. return _MAV_RETURN_uint8_t(msg, 4);
  280. }
  281. /**
  282. * @brief Get field target_component from open_drone_id_authentication message
  283. *
  284. * @return Component ID (0 for broadcast).
  285. */
  286. static inline uint8_t mavlink_msg_open_drone_id_authentication_get_target_component(const mavlink_message_t* msg)
  287. {
  288. return _MAV_RETURN_uint8_t(msg, 5);
  289. }
  290. /**
  291. * @brief Get field id_or_mac from open_drone_id_authentication message
  292. *
  293. * @return Only used for drone ID data received from other UAs. See detailed description at https://mavlink.io/en/services/opendroneid.html.
  294. */
  295. static inline uint16_t mavlink_msg_open_drone_id_authentication_get_id_or_mac(const mavlink_message_t* msg, uint8_t *id_or_mac)
  296. {
  297. return _MAV_RETURN_uint8_t_array(msg, id_or_mac, 20, 6);
  298. }
  299. /**
  300. * @brief Get field authentication_type from open_drone_id_authentication message
  301. *
  302. * @return Indicates the type of authentication.
  303. */
  304. static inline uint8_t mavlink_msg_open_drone_id_authentication_get_authentication_type(const mavlink_message_t* msg)
  305. {
  306. return _MAV_RETURN_uint8_t(msg, 26);
  307. }
  308. /**
  309. * @brief Get field data_page from open_drone_id_authentication message
  310. *
  311. * @return Allowed range is 0 - 15.
  312. */
  313. static inline uint8_t mavlink_msg_open_drone_id_authentication_get_data_page(const mavlink_message_t* msg)
  314. {
  315. return _MAV_RETURN_uint8_t(msg, 27);
  316. }
  317. /**
  318. * @brief Get field last_page_index from open_drone_id_authentication message
  319. *
  320. * @return This field is only present for page 0. Allowed range is 0 - 15. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  321. */
  322. static inline uint8_t mavlink_msg_open_drone_id_authentication_get_last_page_index(const mavlink_message_t* msg)
  323. {
  324. return _MAV_RETURN_uint8_t(msg, 28);
  325. }
  326. /**
  327. * @brief Get field length from open_drone_id_authentication message
  328. *
  329. * @return [bytes] This field is only present for page 0. Total bytes of authentication_data from all data pages. See the description of struct ODID_Auth_data at https://github.com/opendroneid/opendroneid-core-c/blob/master/libopendroneid/opendroneid.h.
  330. */
  331. static inline uint8_t mavlink_msg_open_drone_id_authentication_get_length(const mavlink_message_t* msg)
  332. {
  333. return _MAV_RETURN_uint8_t(msg, 29);
  334. }
  335. /**
  336. * @brief Get field timestamp from open_drone_id_authentication message
  337. *
  338. * @return [s] This field is only present for page 0. 32 bit Unix Timestamp in seconds since 00:00:00 01/01/2019.
  339. */
  340. static inline uint32_t mavlink_msg_open_drone_id_authentication_get_timestamp(const mavlink_message_t* msg)
  341. {
  342. return _MAV_RETURN_uint32_t(msg, 0);
  343. }
  344. /**
  345. * @brief Get field authentication_data from open_drone_id_authentication message
  346. *
  347. * @return Opaque authentication data. For page 0, the size is only 17 bytes. For other pages, the size is 23 bytes. Shall be filled with nulls in the unused portion of the field.
  348. */
  349. static inline uint16_t mavlink_msg_open_drone_id_authentication_get_authentication_data(const mavlink_message_t* msg, uint8_t *authentication_data)
  350. {
  351. return _MAV_RETURN_uint8_t_array(msg, authentication_data, 23, 30);
  352. }
  353. /**
  354. * @brief Decode a open_drone_id_authentication message into a struct
  355. *
  356. * @param msg The message to decode
  357. * @param open_drone_id_authentication C-struct to decode the message contents into
  358. */
  359. static inline void mavlink_msg_open_drone_id_authentication_decode(const mavlink_message_t* msg, mavlink_open_drone_id_authentication_t* open_drone_id_authentication)
  360. {
  361. #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
  362. open_drone_id_authentication->timestamp = mavlink_msg_open_drone_id_authentication_get_timestamp(msg);
  363. open_drone_id_authentication->target_system = mavlink_msg_open_drone_id_authentication_get_target_system(msg);
  364. open_drone_id_authentication->target_component = mavlink_msg_open_drone_id_authentication_get_target_component(msg);
  365. mavlink_msg_open_drone_id_authentication_get_id_or_mac(msg, open_drone_id_authentication->id_or_mac);
  366. open_drone_id_authentication->authentication_type = mavlink_msg_open_drone_id_authentication_get_authentication_type(msg);
  367. open_drone_id_authentication->data_page = mavlink_msg_open_drone_id_authentication_get_data_page(msg);
  368. open_drone_id_authentication->last_page_index = mavlink_msg_open_drone_id_authentication_get_last_page_index(msg);
  369. open_drone_id_authentication->length = mavlink_msg_open_drone_id_authentication_get_length(msg);
  370. mavlink_msg_open_drone_id_authentication_get_authentication_data(msg, open_drone_id_authentication->authentication_data);
  371. #else
  372. uint8_t len = msg->len < MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN? msg->len : MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN;
  373. memset(open_drone_id_authentication, 0, MAVLINK_MSG_ID_OPEN_DRONE_ID_AUTHENTICATION_LEN);
  374. memcpy(open_drone_id_authentication, _MAV_PAYLOAD(msg), len);
  375. #endif
  376. }