4#define MAVLINK_MSG_ID_COMPONENT_METADATA 397
11} mavlink_component_metadata_t;
13#define MAVLINK_MSG_ID_COMPONENT_METADATA_LEN 108
14#define MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN 108
15#define MAVLINK_MSG_ID_397_LEN 108
16#define MAVLINK_MSG_ID_397_MIN_LEN 108
18#define MAVLINK_MSG_ID_COMPONENT_METADATA_CRC 182
19#define MAVLINK_MSG_ID_397_CRC 182
21#define MAVLINK_MSG_COMPONENT_METADATA_FIELD_URI_LEN 100
23#if MAVLINK_COMMAND_24BIT
24#define MAVLINK_MESSAGE_INFO_COMPONENT_METADATA {
28 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_component_metadata_t, time_boot_ms) },
29 { "file_crc", NULL, MAVLINK_TYPE_UINT32_T, 0
, 4
, offsetof(mavlink_component_metadata_t, file_crc) },
30 { "uri", NULL, MAVLINK_TYPE_CHAR, 100
, 8
, offsetof(mavlink_component_metadata_t, uri) },
32}
34#define MAVLINK_MESSAGE_INFO_COMPONENT_METADATA {
37 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0
, 0
, offsetof(mavlink_component_metadata_t, time_boot_ms) },
38 { "file_crc", NULL, MAVLINK_TYPE_UINT32_T, 0
, 4
, offsetof(mavlink_component_metadata_t, file_crc) },
39 { "uri", NULL, MAVLINK_TYPE_CHAR, 100
, 8
, offsetof(mavlink_component_metadata_t, uri) },
41}
45
46
47
48
49
50
51
52
53
54
55static inline uint16_t mavlink_msg_component_metadata_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
56 uint32_t time_boot_ms, uint32_t file_crc,
const char *uri)
58#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
60 _mav_put_uint32_t(buf, 0, time_boot_ms);
61 _mav_put_uint32_t(buf, 4, file_crc);
62 _mav_put_char_array(buf, 8, uri, 100);
65 mavlink_component_metadata_t packet;
66 packet.time_boot_ms = time_boot_ms;
67 packet.file_crc = file_crc;
68 mav_array_memcpy(packet.uri, uri,
sizeof(
char)*100);
69 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN);
77
78
79
80
81
82
83
84
85
86
87
88static inline uint16_t mavlink_msg_component_metadata_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
89 uint32_t time_boot_ms, uint32_t file_crc,
const char *uri)
91#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
93 _mav_put_uint32_t(buf, 0, time_boot_ms);
94 _mav_put_uint32_t(buf, 4, file_crc);
95 _mav_put_char_array(buf, 8, uri, 100);
98 mavlink_component_metadata_t packet;
99 packet.time_boot_ms = time_boot_ms;
100 packet.file_crc = file_crc;
101 mav_array_memcpy(packet.uri, uri,
sizeof(
char)*100);
102 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN);
107 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_CRC);
114
115
116
117
118
119
120
121
122
123
124static inline uint16_t mavlink_msg_component_metadata_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
125 mavlink_message_t* msg,
126 uint32_t time_boot_ms,uint32_t file_crc,
const char *uri)
128#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
130 _mav_put_uint32_t(buf, 0, time_boot_ms);
131 _mav_put_uint32_t(buf, 4, file_crc);
132 _mav_put_char_array(buf, 8, uri, 100);
135 mavlink_component_metadata_t packet;
136 packet.time_boot_ms = time_boot_ms;
137 packet.file_crc = file_crc;
138 mav_array_memcpy(packet.uri, uri,
sizeof(
char)*100);
139 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN);
147
148
149
150
151
152
153
154static inline uint16_t mavlink_msg_component_metadata_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
const mavlink_component_metadata_t* component_metadata)
156 return mavlink_msg_component_metadata_pack(system_id, component_id, msg, component_metadata->time_boot_ms, component_metadata->file_crc, component_metadata->uri);
160
161
162
163
164
165
166
167
168static inline uint16_t mavlink_msg_component_metadata_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg,
const mavlink_component_metadata_t* component_metadata)
170 return mavlink_msg_component_metadata_pack_chan(system_id, component_id, chan, msg, component_metadata->time_boot_ms, component_metadata->file_crc, component_metadata->uri);
174
175
176
177
178
179
180
181
182static inline uint16_t mavlink_msg_component_metadata_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg,
const mavlink_component_metadata_t* component_metadata)
184 return mavlink_msg_component_metadata_pack_status(system_id, component_id, _status, msg, component_metadata->time_boot_ms, component_metadata->file_crc, component_metadata->uri);
188
189
190
191
192
193
194
195#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
197static inline void mavlink_msg_component_metadata_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t file_crc,
const char *uri)
199#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
200 char buf[MAVLINK_MSG_ID_COMPONENT_METADATA_LEN];
201 _mav_put_uint32_t(buf, 0, time_boot_ms);
202 _mav_put_uint32_t(buf, 4, file_crc);
203 _mav_put_char_array(buf, 8, uri, 100);
204 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_METADATA, buf, MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_CRC);
206 mavlink_component_metadata_t packet;
207 packet.time_boot_ms = time_boot_ms;
208 packet.file_crc = file_crc;
209 mav_array_memcpy(packet.uri, uri,
sizeof(
char)*100);
210 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_METADATA, (
const char *)&packet, MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_CRC);
215
216
217
218
219static inline void mavlink_msg_component_metadata_send_struct(mavlink_channel_t chan,
const mavlink_component_metadata_t* component_metadata)
221#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
222 mavlink_msg_component_metadata_send(chan, component_metadata->time_boot_ms, component_metadata->file_crc, component_metadata->uri);
224 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_METADATA, (
const char *)component_metadata, MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_CRC);
228#if MAVLINK_MSG_ID_COMPONENT_METADATA_LEN <= MAVLINK_MAX_PAYLOAD_LEN
230
231
232
233
234
235
236static inline void mavlink_msg_component_metadata_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint32_t file_crc,
const char *uri)
238#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
239 char *buf = (
char *)msgbuf;
240 _mav_put_uint32_t(buf, 0, time_boot_ms);
241 _mav_put_uint32_t(buf, 4, file_crc);
242 _mav_put_char_array(buf, 8, uri, 100);
243 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_METADATA, buf, MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_CRC);
245 mavlink_component_metadata_t *packet = (mavlink_component_metadata_t *)msgbuf;
246 packet->time_boot_ms = time_boot_ms;
247 packet->file_crc = file_crc;
248 mav_array_memcpy(packet->uri, uri,
sizeof(
char)*100);
249 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_METADATA, (
const char *)packet, MAVLINK_MSG_ID_COMPONENT_METADATA_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN, MAVLINK_MSG_ID_COMPONENT_METADATA_CRC);
260
261
262
263
264static inline uint32_t mavlink_msg_component_metadata_get_time_boot_ms(
const mavlink_message_t* msg)
266 return _MAV_RETURN_uint32_t(msg, 0);
270
271
272
273
274static inline uint32_t mavlink_msg_component_metadata_get_file_crc(
const mavlink_message_t* msg)
276 return _MAV_RETURN_uint32_t(msg, 4);
280
281
282
283
284static inline uint16_t mavlink_msg_component_metadata_get_uri(
const mavlink_message_t* msg,
char *uri)
286 return _MAV_RETURN_char_array(msg, uri, 100, 8);
290
291
292
293
294
295static inline void mavlink_msg_component_metadata_decode(
const mavlink_message_t* msg, mavlink_component_metadata_t* component_metadata)
297#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
298 component_metadata->time_boot_ms = mavlink_msg_component_metadata_get_time_boot_ms(msg);
299 component_metadata->file_crc = mavlink_msg_component_metadata_get_file_crc(msg);
300 mavlink_msg_component_metadata_get_uri(msg, component_metadata->uri);
302 uint8_t len = msg->len < MAVLINK_MSG_ID_COMPONENT_METADATA_LEN? msg->len : MAVLINK_MSG_ID_COMPONENT_METADATA_LEN;
303 memset(component_metadata, 0, MAVLINK_MSG_ID_COMPONENT_METADATA_LEN);
304 memcpy(component_metadata, _MAV_PAYLOAD(msg), len);