2 // MESSAGE COMPONENT_INFORMATION PACKING
4 #define MAVLINK_MSG_ID_COMPONENT_INFORMATION 395
7 typedef struct __mavlink_component_information_t
{
8 uint32_t time_boot_ms
; /*< [ms] Timestamp (time since system boot).*/
9 uint32_t metadata_type
; /*< The type of metadata being requested.*/
10 uint32_t metadata_uid
; /*< Unique uid for this metadata which a gcs can use for created cached metadata and understanding whether it's cache it up to date or whether it needs to download new data.*/
11 uint32_t translation_uid
; /*< Unique uid for the translation file associated with the metadata.*/
12 char metadata_uri
[70]; /*< Component definition URI. If prefix mavlinkftp:// file is downloaded from vehicle over mavlink ftp protocol. If prefix http[s]:// file is downloaded over internet. Files are json format. They can end in .gz to indicate file is in gzip format.*/
13 char translation_uri
[70]; /*< The translations for strings within the metadata file. If null the either do not exist or may be included in the metadata file itself. The translations specified here supercede any which may be in the metadata file itself. The uri format is the same as component_metadata_uri . Files are in Json Translation spec format. Empty string indicates no tranlsation file.*/
14 } mavlink_component_information_t
;
16 #define MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN 156
17 #define MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN 156
18 #define MAVLINK_MSG_ID_395_LEN 156
19 #define MAVLINK_MSG_ID_395_MIN_LEN 156
21 #define MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC 163
22 #define MAVLINK_MSG_ID_395_CRC 163
24 #define MAVLINK_MSG_COMPONENT_INFORMATION_FIELD_METADATA_URI_LEN 70
25 #define MAVLINK_MSG_COMPONENT_INFORMATION_FIELD_TRANSLATION_URI_LEN 70
27 #if MAVLINK_COMMAND_24BIT
28 #define MAVLINK_MESSAGE_INFO_COMPONENT_INFORMATION { \
30 "COMPONENT_INFORMATION", \
32 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_component_information_t, time_boot_ms) }, \
33 { "metadata_type", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_component_information_t, metadata_type) }, \
34 { "metadata_uid", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_component_information_t, metadata_uid) }, \
35 { "metadata_uri", NULL, MAVLINK_TYPE_CHAR, 70, 16, offsetof(mavlink_component_information_t, metadata_uri) }, \
36 { "translation_uid", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_component_information_t, translation_uid) }, \
37 { "translation_uri", NULL, MAVLINK_TYPE_CHAR, 70, 86, offsetof(mavlink_component_information_t, translation_uri) }, \
41 #define MAVLINK_MESSAGE_INFO_COMPONENT_INFORMATION { \
42 "COMPONENT_INFORMATION", \
44 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_component_information_t, time_boot_ms) }, \
45 { "metadata_type", NULL, MAVLINK_TYPE_UINT32_T, 0, 4, offsetof(mavlink_component_information_t, metadata_type) }, \
46 { "metadata_uid", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_component_information_t, metadata_uid) }, \
47 { "metadata_uri", NULL, MAVLINK_TYPE_CHAR, 70, 16, offsetof(mavlink_component_information_t, metadata_uri) }, \
48 { "translation_uid", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_component_information_t, translation_uid) }, \
49 { "translation_uri", NULL, MAVLINK_TYPE_CHAR, 70, 86, offsetof(mavlink_component_information_t, translation_uri) }, \
55 * @brief Pack a component_information message
56 * @param system_id ID of this system
57 * @param component_id ID of this component (e.g. 200 for IMU)
58 * @param msg The MAVLink message to compress the data into
60 * @param time_boot_ms [ms] Timestamp (time since system boot).
61 * @param metadata_type The type of metadata being requested.
62 * @param metadata_uid Unique uid for this metadata which a gcs can use for created cached metadata and understanding whether it's cache it up to date or whether it needs to download new data.
63 * @param metadata_uri Component definition URI. If prefix mavlinkftp:// file is downloaded from vehicle over mavlink ftp protocol. If prefix http[s]:// file is downloaded over internet. Files are json format. They can end in .gz to indicate file is in gzip format.
64 * @param translation_uid Unique uid for the translation file associated with the metadata.
65 * @param translation_uri The translations for strings within the metadata file. If null the either do not exist or may be included in the metadata file itself. The translations specified here supercede any which may be in the metadata file itself. The uri format is the same as component_metadata_uri . Files are in Json Translation spec format. Empty string indicates no tranlsation file.
66 * @return length of the message in bytes (excluding serial stream start sign)
68 static inline uint16_t mavlink_msg_component_information_pack(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
,
69 uint32_t time_boot_ms
, uint32_t metadata_type
, uint32_t metadata_uid
, const char *metadata_uri
, uint32_t translation_uid
, const char *translation_uri
)
71 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
72 char buf
[MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
];
73 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
74 _mav_put_uint32_t(buf
, 4, metadata_type
);
75 _mav_put_uint32_t(buf
, 8, metadata_uid
);
76 _mav_put_uint32_t(buf
, 12, translation_uid
);
77 _mav_put_char_array(buf
, 16, metadata_uri
, 70);
78 _mav_put_char_array(buf
, 86, translation_uri
, 70);
79 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
);
81 mavlink_component_information_t packet
;
82 packet
.time_boot_ms
= time_boot_ms
;
83 packet
.metadata_type
= metadata_type
;
84 packet
.metadata_uid
= metadata_uid
;
85 packet
.translation_uid
= translation_uid
;
86 mav_array_memcpy(packet
.metadata_uri
, metadata_uri
, sizeof(char)*70);
87 mav_array_memcpy(packet
.translation_uri
, translation_uri
, sizeof(char)*70);
88 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
);
91 msg
->msgid
= MAVLINK_MSG_ID_COMPONENT_INFORMATION
;
92 return mavlink_finalize_message(msg
, system_id
, component_id
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC
);
96 * @brief Pack a component_information message on a channel
97 * @param system_id ID of this system
98 * @param component_id ID of this component (e.g. 200 for IMU)
99 * @param chan The MAVLink channel this message will be sent over
100 * @param msg The MAVLink message to compress the data into
101 * @param time_boot_ms [ms] Timestamp (time since system boot).
102 * @param metadata_type The type of metadata being requested.
103 * @param metadata_uid Unique uid for this metadata which a gcs can use for created cached metadata and understanding whether it's cache it up to date or whether it needs to download new data.
104 * @param metadata_uri Component definition URI. If prefix mavlinkftp:// file is downloaded from vehicle over mavlink ftp protocol. If prefix http[s]:// file is downloaded over internet. Files are json format. They can end in .gz to indicate file is in gzip format.
105 * @param translation_uid Unique uid for the translation file associated with the metadata.
106 * @param translation_uri The translations for strings within the metadata file. If null the either do not exist or may be included in the metadata file itself. The translations specified here supercede any which may be in the metadata file itself. The uri format is the same as component_metadata_uri . Files are in Json Translation spec format. Empty string indicates no tranlsation file.
107 * @return length of the message in bytes (excluding serial stream start sign)
109 static inline uint16_t mavlink_msg_component_information_pack_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
,
110 mavlink_message_t
* msg
,
111 uint32_t time_boot_ms
,uint32_t metadata_type
,uint32_t metadata_uid
,const char *metadata_uri
,uint32_t translation_uid
,const char *translation_uri
)
113 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
114 char buf
[MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
];
115 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
116 _mav_put_uint32_t(buf
, 4, metadata_type
);
117 _mav_put_uint32_t(buf
, 8, metadata_uid
);
118 _mav_put_uint32_t(buf
, 12, translation_uid
);
119 _mav_put_char_array(buf
, 16, metadata_uri
, 70);
120 _mav_put_char_array(buf
, 86, translation_uri
, 70);
121 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), buf
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
);
123 mavlink_component_information_t packet
;
124 packet
.time_boot_ms
= time_boot_ms
;
125 packet
.metadata_type
= metadata_type
;
126 packet
.metadata_uid
= metadata_uid
;
127 packet
.translation_uid
= translation_uid
;
128 mav_array_memcpy(packet
.metadata_uri
, metadata_uri
, sizeof(char)*70);
129 mav_array_memcpy(packet
.translation_uri
, translation_uri
, sizeof(char)*70);
130 memcpy(_MAV_PAYLOAD_NON_CONST(msg
), &packet
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
);
133 msg
->msgid
= MAVLINK_MSG_ID_COMPONENT_INFORMATION
;
134 return mavlink_finalize_message_chan(msg
, system_id
, component_id
, chan
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC
);
138 * @brief Encode a component_information struct
140 * @param system_id ID of this system
141 * @param component_id ID of this component (e.g. 200 for IMU)
142 * @param msg The MAVLink message to compress the data into
143 * @param component_information C-struct to read the message contents from
145 static inline uint16_t mavlink_msg_component_information_encode(uint8_t system_id
, uint8_t component_id
, mavlink_message_t
* msg
, const mavlink_component_information_t
* component_information
)
147 return mavlink_msg_component_information_pack(system_id
, component_id
, msg
, component_information
->time_boot_ms
, component_information
->metadata_type
, component_information
->metadata_uid
, component_information
->metadata_uri
, component_information
->translation_uid
, component_information
->translation_uri
);
151 * @brief Encode a component_information struct on a channel
153 * @param system_id ID of this system
154 * @param component_id ID of this component (e.g. 200 for IMU)
155 * @param chan The MAVLink channel this message will be sent over
156 * @param msg The MAVLink message to compress the data into
157 * @param component_information C-struct to read the message contents from
159 static inline uint16_t mavlink_msg_component_information_encode_chan(uint8_t system_id
, uint8_t component_id
, uint8_t chan
, mavlink_message_t
* msg
, const mavlink_component_information_t
* component_information
)
161 return mavlink_msg_component_information_pack_chan(system_id
, component_id
, chan
, msg
, component_information
->time_boot_ms
, component_information
->metadata_type
, component_information
->metadata_uid
, component_information
->metadata_uri
, component_information
->translation_uid
, component_information
->translation_uri
);
165 * @brief Send a component_information message
166 * @param chan MAVLink channel to send the message
168 * @param time_boot_ms [ms] Timestamp (time since system boot).
169 * @param metadata_type The type of metadata being requested.
170 * @param metadata_uid Unique uid for this metadata which a gcs can use for created cached metadata and understanding whether it's cache it up to date or whether it needs to download new data.
171 * @param metadata_uri Component definition URI. If prefix mavlinkftp:// file is downloaded from vehicle over mavlink ftp protocol. If prefix http[s]:// file is downloaded over internet. Files are json format. They can end in .gz to indicate file is in gzip format.
172 * @param translation_uid Unique uid for the translation file associated with the metadata.
173 * @param translation_uri The translations for strings within the metadata file. If null the either do not exist or may be included in the metadata file itself. The translations specified here supercede any which may be in the metadata file itself. The uri format is the same as component_metadata_uri . Files are in Json Translation spec format. Empty string indicates no tranlsation file.
175 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
177 static inline void mavlink_msg_component_information_send(mavlink_channel_t chan
, uint32_t time_boot_ms
, uint32_t metadata_type
, uint32_t metadata_uid
, const char *metadata_uri
, uint32_t translation_uid
, const char *translation_uri
)
179 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
180 char buf
[MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
];
181 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
182 _mav_put_uint32_t(buf
, 4, metadata_type
);
183 _mav_put_uint32_t(buf
, 8, metadata_uid
);
184 _mav_put_uint32_t(buf
, 12, translation_uid
);
185 _mav_put_char_array(buf
, 16, metadata_uri
, 70);
186 _mav_put_char_array(buf
, 86, translation_uri
, 70);
187 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_COMPONENT_INFORMATION
, buf
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC
);
189 mavlink_component_information_t packet
;
190 packet
.time_boot_ms
= time_boot_ms
;
191 packet
.metadata_type
= metadata_type
;
192 packet
.metadata_uid
= metadata_uid
;
193 packet
.translation_uid
= translation_uid
;
194 mav_array_memcpy(packet
.metadata_uri
, metadata_uri
, sizeof(char)*70);
195 mav_array_memcpy(packet
.translation_uri
, translation_uri
, sizeof(char)*70);
196 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_COMPONENT_INFORMATION
, (const char *)&packet
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC
);
201 * @brief Send a component_information message
202 * @param chan MAVLink channel to send the message
203 * @param struct The MAVLink struct to serialize
205 static inline void mavlink_msg_component_information_send_struct(mavlink_channel_t chan
, const mavlink_component_information_t
* component_information
)
207 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
208 mavlink_msg_component_information_send(chan
, component_information
->time_boot_ms
, component_information
->metadata_type
, component_information
->metadata_uid
, component_information
->metadata_uri
, component_information
->translation_uid
, component_information
->translation_uri
);
210 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_COMPONENT_INFORMATION
, (const char *)component_information
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC
);
214 #if MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
216 This varient of _send() can be used to save stack space by re-using
217 memory from the receive buffer. The caller provides a
218 mavlink_message_t which is the size of a full mavlink message. This
219 is usually the receive buffer for the channel, and allows a reply to an
220 incoming message with minimum stack space usage.
222 static inline void mavlink_msg_component_information_send_buf(mavlink_message_t
*msgbuf
, mavlink_channel_t chan
, uint32_t time_boot_ms
, uint32_t metadata_type
, uint32_t metadata_uid
, const char *metadata_uri
, uint32_t translation_uid
, const char *translation_uri
)
224 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
225 char *buf
= (char *)msgbuf
;
226 _mav_put_uint32_t(buf
, 0, time_boot_ms
);
227 _mav_put_uint32_t(buf
, 4, metadata_type
);
228 _mav_put_uint32_t(buf
, 8, metadata_uid
);
229 _mav_put_uint32_t(buf
, 12, translation_uid
);
230 _mav_put_char_array(buf
, 16, metadata_uri
, 70);
231 _mav_put_char_array(buf
, 86, translation_uri
, 70);
232 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_COMPONENT_INFORMATION
, buf
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC
);
234 mavlink_component_information_t
*packet
= (mavlink_component_information_t
*)msgbuf
;
235 packet
->time_boot_ms
= time_boot_ms
;
236 packet
->metadata_type
= metadata_type
;
237 packet
->metadata_uid
= metadata_uid
;
238 packet
->translation_uid
= translation_uid
;
239 mav_array_memcpy(packet
->metadata_uri
, metadata_uri
, sizeof(char)*70);
240 mav_array_memcpy(packet
->translation_uri
, translation_uri
, sizeof(char)*70);
241 _mav_finalize_message_chan_send(chan
, MAVLINK_MSG_ID_COMPONENT_INFORMATION
, (const char *)packet
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_MIN_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
, MAVLINK_MSG_ID_COMPONENT_INFORMATION_CRC
);
248 // MESSAGE COMPONENT_INFORMATION UNPACKING
252 * @brief Get field time_boot_ms from component_information message
254 * @return [ms] Timestamp (time since system boot).
256 static inline uint32_t mavlink_msg_component_information_get_time_boot_ms(const mavlink_message_t
* msg
)
258 return _MAV_RETURN_uint32_t(msg
, 0);
262 * @brief Get field metadata_type from component_information message
264 * @return The type of metadata being requested.
266 static inline uint32_t mavlink_msg_component_information_get_metadata_type(const mavlink_message_t
* msg
)
268 return _MAV_RETURN_uint32_t(msg
, 4);
272 * @brief Get field metadata_uid from component_information message
274 * @return Unique uid for this metadata which a gcs can use for created cached metadata and understanding whether it's cache it up to date or whether it needs to download new data.
276 static inline uint32_t mavlink_msg_component_information_get_metadata_uid(const mavlink_message_t
* msg
)
278 return _MAV_RETURN_uint32_t(msg
, 8);
282 * @brief Get field metadata_uri from component_information message
284 * @return Component definition URI. If prefix mavlinkftp:// file is downloaded from vehicle over mavlink ftp protocol. If prefix http[s]:// file is downloaded over internet. Files are json format. They can end in .gz to indicate file is in gzip format.
286 static inline uint16_t mavlink_msg_component_information_get_metadata_uri(const mavlink_message_t
* msg
, char *metadata_uri
)
288 return _MAV_RETURN_char_array(msg
, metadata_uri
, 70, 16);
292 * @brief Get field translation_uid from component_information message
294 * @return Unique uid for the translation file associated with the metadata.
296 static inline uint32_t mavlink_msg_component_information_get_translation_uid(const mavlink_message_t
* msg
)
298 return _MAV_RETURN_uint32_t(msg
, 12);
302 * @brief Get field translation_uri from component_information message
304 * @return The translations for strings within the metadata file. If null the either do not exist or may be included in the metadata file itself. The translations specified here supercede any which may be in the metadata file itself. The uri format is the same as component_metadata_uri . Files are in Json Translation spec format. Empty string indicates no tranlsation file.
306 static inline uint16_t mavlink_msg_component_information_get_translation_uri(const mavlink_message_t
* msg
, char *translation_uri
)
308 return _MAV_RETURN_char_array(msg
, translation_uri
, 70, 86);
312 * @brief Decode a component_information message into a struct
314 * @param msg The message to decode
315 * @param component_information C-struct to decode the message contents into
317 static inline void mavlink_msg_component_information_decode(const mavlink_message_t
* msg
, mavlink_component_information_t
* component_information
)
319 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
320 component_information
->time_boot_ms
= mavlink_msg_component_information_get_time_boot_ms(msg
);
321 component_information
->metadata_type
= mavlink_msg_component_information_get_metadata_type(msg
);
322 component_information
->metadata_uid
= mavlink_msg_component_information_get_metadata_uid(msg
);
323 component_information
->translation_uid
= mavlink_msg_component_information_get_translation_uid(msg
);
324 mavlink_msg_component_information_get_metadata_uri(msg
, component_information
->metadata_uri
);
325 mavlink_msg_component_information_get_translation_uri(msg
, component_information
->translation_uri
);
327 uint8_t len
= msg
->len
< MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
? msg
->len
: MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
;
328 memset(component_information
, 0, MAVLINK_MSG_ID_COMPONENT_INFORMATION_LEN
);
329 memcpy(component_information
, _MAV_PAYLOAD(msg
), len
);