Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_component_information_basic.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE COMPONENT_INFORMATION_BASIC PACKING
3
4#define MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC 396
5
6
8 uint64_t capabilities; /*< Component capability flags*/
9 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
10 uint32_t time_manufacture_s; /*< [s] Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.*/
11 char vendor_name[32]; /*< Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.*/
12 char model_name[32]; /*< Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.*/
13 char software_version[24]; /*< Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.*/
14 char hardware_version[24]; /*< Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.*/
15 char serial_number[32]; /*< Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.*/
16} mavlink_component_information_basic_t;
17
18#define MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN 160
19#define MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN 160
20#define MAVLINK_MSG_ID_396_LEN 160
21#define MAVLINK_MSG_ID_396_MIN_LEN 160
22
23#define MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_CRC 50
24#define MAVLINK_MSG_ID_396_CRC 50
25
26#define MAVLINK_MSG_COMPONENT_INFORMATION_BASIC_FIELD_VENDOR_NAME_LEN 32
27#define MAVLINK_MSG_COMPONENT_INFORMATION_BASIC_FIELD_MODEL_NAME_LEN 32
28#define MAVLINK_MSG_COMPONENT_INFORMATION_BASIC_FIELD_SOFTWARE_VERSION_LEN 24
29#define MAVLINK_MSG_COMPONENT_INFORMATION_BASIC_FIELD_HARDWARE_VERSION_LEN 24
30#define MAVLINK_MSG_COMPONENT_INFORMATION_BASIC_FIELD_SERIAL_NUMBER_LEN 32
31
32#if MAVLINK_COMMAND_24BIT
33#define MAVLINK_MESSAGE_INFO_COMPONENT_INFORMATION_BASIC {
34 396,
35 "COMPONENT_INFORMATION_BASIC",
36 8,
37 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_component_information_basic_t, time_boot_ms) },
38 { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_component_information_basic_t, capabilities) },
39 { "time_manufacture_s", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_component_information_basic_t, time_manufacture_s) },
40 { "vendor_name", NULL, MAVLINK_TYPE_CHAR, 32, 16, offsetof(mavlink_component_information_basic_t, vendor_name) },
41 { "model_name", NULL, MAVLINK_TYPE_CHAR, 32, 48, offsetof(mavlink_component_information_basic_t, model_name) },
42 { "software_version", NULL, MAVLINK_TYPE_CHAR, 24, 80, offsetof(mavlink_component_information_basic_t, software_version) },
43 { "hardware_version", NULL, MAVLINK_TYPE_CHAR, 24, 104, offsetof(mavlink_component_information_basic_t, hardware_version) },
44 { "serial_number", NULL, MAVLINK_TYPE_CHAR, 32, 128, offsetof(mavlink_component_information_basic_t, serial_number) },
45 } \
46}
47#else
48#define MAVLINK_MESSAGE_INFO_COMPONENT_INFORMATION_BASIC {
49 "COMPONENT_INFORMATION_BASIC",
50 8,
51 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_component_information_basic_t, time_boot_ms) },
52 { "capabilities", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_component_information_basic_t, capabilities) },
53 { "time_manufacture_s", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_component_information_basic_t, time_manufacture_s) },
54 { "vendor_name", NULL, MAVLINK_TYPE_CHAR, 32, 16, offsetof(mavlink_component_information_basic_t, vendor_name) },
55 { "model_name", NULL, MAVLINK_TYPE_CHAR, 32, 48, offsetof(mavlink_component_information_basic_t, model_name) },
56 { "software_version", NULL, MAVLINK_TYPE_CHAR, 24, 80, offsetof(mavlink_component_information_basic_t, software_version) },
57 { "hardware_version", NULL, MAVLINK_TYPE_CHAR, 24, 104, offsetof(mavlink_component_information_basic_t, hardware_version) },
58 { "serial_number", NULL, MAVLINK_TYPE_CHAR, 32, 128, offsetof(mavlink_component_information_basic_t, serial_number) },
59 } \
60}
61#endif
62
63/**
64 * @brief Pack a component_information_basic message
65 * @param system_id ID of this system
66 * @param component_id ID of this component (e.g. 200 for IMU)
67 * @param msg The MAVLink message to compress the data into
68 *
69 * @param time_boot_ms [ms] Timestamp (time since system boot).
70 * @param capabilities Component capability flags
71 * @param time_manufacture_s [s] Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.
72 * @param vendor_name Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.
73 * @param model_name Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.
74 * @param software_version Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
75 * @param hardware_version Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
76 * @param serial_number Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
77 * @return length of the message in bytes (excluding serial stream start sign)
78 */
79static inline uint16_t mavlink_msg_component_information_basic_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
80 uint32_t time_boot_ms, uint64_t capabilities, uint32_t time_manufacture_s, const char *vendor_name, const char *model_name, const char *software_version, const char *hardware_version, const char *serial_number)
81{
82#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
84 _mav_put_uint64_t(buf, 0, capabilities);
85 _mav_put_uint32_t(buf, 8, time_boot_ms);
86 _mav_put_uint32_t(buf, 12, time_manufacture_s);
87 _mav_put_char_array(buf, 16, vendor_name, 32);
88 _mav_put_char_array(buf, 48, model_name, 32);
89 _mav_put_char_array(buf, 80, software_version, 24);
90 _mav_put_char_array(buf, 104, hardware_version, 24);
91 _mav_put_char_array(buf, 128, serial_number, 32);
92 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
93#else
94 mavlink_component_information_basic_t packet;
95 packet.capabilities = capabilities;
96 packet.time_boot_ms = time_boot_ms;
97 packet.time_manufacture_s = time_manufacture_s;
98 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
99 mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
100 mav_array_memcpy(packet.software_version, software_version, sizeof(char)*24);
101 mav_array_memcpy(packet.hardware_version, hardware_version, sizeof(char)*24);
102 mav_array_memcpy(packet.serial_number, serial_number, sizeof(char)*32);
103 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
104#endif
105
108}
109
110/**
111 * @brief Pack a component_information_basic message
112 * @param system_id ID of this system
113 * @param component_id ID of this component (e.g. 200 for IMU)
114 * @param status MAVLink status structure
115 * @param msg The MAVLink message to compress the data into
116 *
117 * @param time_boot_ms [ms] Timestamp (time since system boot).
118 * @param capabilities Component capability flags
119 * @param time_manufacture_s [s] Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.
120 * @param vendor_name Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.
121 * @param model_name Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.
122 * @param software_version Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
123 * @param hardware_version Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
124 * @param serial_number Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
125 * @return length of the message in bytes (excluding serial stream start sign)
126 */
127static inline uint16_t mavlink_msg_component_information_basic_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
128 uint32_t time_boot_ms, uint64_t capabilities, uint32_t time_manufacture_s, const char *vendor_name, const char *model_name, const char *software_version, const char *hardware_version, const char *serial_number)
129{
130#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
132 _mav_put_uint64_t(buf, 0, capabilities);
133 _mav_put_uint32_t(buf, 8, time_boot_ms);
134 _mav_put_uint32_t(buf, 12, time_manufacture_s);
135 _mav_put_char_array(buf, 16, vendor_name, 32);
136 _mav_put_char_array(buf, 48, model_name, 32);
137 _mav_put_char_array(buf, 80, software_version, 24);
138 _mav_put_char_array(buf, 104, hardware_version, 24);
139 _mav_put_char_array(buf, 128, serial_number, 32);
140 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
141#else
142 mavlink_component_information_basic_t packet;
143 packet.capabilities = capabilities;
144 packet.time_boot_ms = time_boot_ms;
145 packet.time_manufacture_s = time_manufacture_s;
146 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
147 mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
148 mav_array_memcpy(packet.software_version, software_version, sizeof(char)*24);
149 mav_array_memcpy(packet.hardware_version, hardware_version, sizeof(char)*24);
150 mav_array_memcpy(packet.serial_number, serial_number, sizeof(char)*32);
151 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
152#endif
153
155#if MAVLINK_CRC_EXTRA
156 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_CRC);
157#else
158 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
159#endif
160}
161
162/**
163 * @brief Pack a component_information_basic message on a channel
164 * @param system_id ID of this system
165 * @param component_id ID of this component (e.g. 200 for IMU)
166 * @param chan The MAVLink channel this message will be sent over
167 * @param msg The MAVLink message to compress the data into
168 * @param time_boot_ms [ms] Timestamp (time since system boot).
169 * @param capabilities Component capability flags
170 * @param time_manufacture_s [s] Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.
171 * @param vendor_name Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.
172 * @param model_name Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.
173 * @param software_version Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
174 * @param hardware_version Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
175 * @param serial_number Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
176 * @return length of the message in bytes (excluding serial stream start sign)
177 */
178static inline uint16_t mavlink_msg_component_information_basic_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
179 mavlink_message_t* msg,
180 uint32_t time_boot_ms,uint64_t capabilities,uint32_t time_manufacture_s,const char *vendor_name,const char *model_name,const char *software_version,const char *hardware_version,const char *serial_number)
181{
182#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
184 _mav_put_uint64_t(buf, 0, capabilities);
185 _mav_put_uint32_t(buf, 8, time_boot_ms);
186 _mav_put_uint32_t(buf, 12, time_manufacture_s);
187 _mav_put_char_array(buf, 16, vendor_name, 32);
188 _mav_put_char_array(buf, 48, model_name, 32);
189 _mav_put_char_array(buf, 80, software_version, 24);
190 _mav_put_char_array(buf, 104, hardware_version, 24);
191 _mav_put_char_array(buf, 128, serial_number, 32);
192 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
193#else
194 mavlink_component_information_basic_t packet;
195 packet.capabilities = capabilities;
196 packet.time_boot_ms = time_boot_ms;
197 packet.time_manufacture_s = time_manufacture_s;
198 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
199 mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
200 mav_array_memcpy(packet.software_version, software_version, sizeof(char)*24);
201 mav_array_memcpy(packet.hardware_version, hardware_version, sizeof(char)*24);
202 mav_array_memcpy(packet.serial_number, serial_number, sizeof(char)*32);
203 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
204#endif
205
208}
209
210/**
211 * @brief Encode a component_information_basic struct
212 *
213 * @param system_id ID of this system
214 * @param component_id ID of this component (e.g. 200 for IMU)
215 * @param msg The MAVLink message to compress the data into
216 * @param component_information_basic C-struct to read the message contents from
217 */
218static inline uint16_t mavlink_msg_component_information_basic_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_component_information_basic_t* component_information_basic)
219{
220 return mavlink_msg_component_information_basic_pack(system_id, component_id, msg, component_information_basic->time_boot_ms, component_information_basic->capabilities, component_information_basic->time_manufacture_s, component_information_basic->vendor_name, component_information_basic->model_name, component_information_basic->software_version, component_information_basic->hardware_version, component_information_basic->serial_number);
221}
222
223/**
224 * @brief Encode a component_information_basic struct on a channel
225 *
226 * @param system_id ID of this system
227 * @param component_id ID of this component (e.g. 200 for IMU)
228 * @param chan The MAVLink channel this message will be sent over
229 * @param msg The MAVLink message to compress the data into
230 * @param component_information_basic C-struct to read the message contents from
231 */
232static inline uint16_t mavlink_msg_component_information_basic_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_component_information_basic_t* component_information_basic)
233{
234 return mavlink_msg_component_information_basic_pack_chan(system_id, component_id, chan, msg, component_information_basic->time_boot_ms, component_information_basic->capabilities, component_information_basic->time_manufacture_s, component_information_basic->vendor_name, component_information_basic->model_name, component_information_basic->software_version, component_information_basic->hardware_version, component_information_basic->serial_number);
235}
236
237/**
238 * @brief Encode a component_information_basic struct with provided status structure
239 *
240 * @param system_id ID of this system
241 * @param component_id ID of this component (e.g. 200 for IMU)
242 * @param status MAVLink status structure
243 * @param msg The MAVLink message to compress the data into
244 * @param component_information_basic C-struct to read the message contents from
245 */
246static inline uint16_t mavlink_msg_component_information_basic_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_component_information_basic_t* component_information_basic)
247{
248 return mavlink_msg_component_information_basic_pack_status(system_id, component_id, _status, msg, component_information_basic->time_boot_ms, component_information_basic->capabilities, component_information_basic->time_manufacture_s, component_information_basic->vendor_name, component_information_basic->model_name, component_information_basic->software_version, component_information_basic->hardware_version, component_information_basic->serial_number);
249}
250
251/**
252 * @brief Send a component_information_basic message
253 * @param chan MAVLink channel to send the message
254 *
255 * @param time_boot_ms [ms] Timestamp (time since system boot).
256 * @param capabilities Component capability flags
257 * @param time_manufacture_s [s] Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.
258 * @param vendor_name Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.
259 * @param model_name Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.
260 * @param software_version Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
261 * @param hardware_version Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
262 * @param serial_number Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
263 */
264#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
265
266static inline void mavlink_msg_component_information_basic_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t capabilities, uint32_t time_manufacture_s, const char *vendor_name, const char *model_name, const char *software_version, const char *hardware_version, const char *serial_number)
267{
268#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
269 char buf[MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN];
270 _mav_put_uint64_t(buf, 0, capabilities);
271 _mav_put_uint32_t(buf, 8, time_boot_ms);
272 _mav_put_uint32_t(buf, 12, time_manufacture_s);
273 _mav_put_char_array(buf, 16, vendor_name, 32);
274 _mav_put_char_array(buf, 48, model_name, 32);
275 _mav_put_char_array(buf, 80, software_version, 24);
276 _mav_put_char_array(buf, 104, hardware_version, 24);
277 _mav_put_char_array(buf, 128, serial_number, 32);
278 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC, buf, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_CRC);
279#else
280 mavlink_component_information_basic_t packet;
281 packet.capabilities = capabilities;
282 packet.time_boot_ms = time_boot_ms;
283 packet.time_manufacture_s = time_manufacture_s;
284 mav_array_memcpy(packet.vendor_name, vendor_name, sizeof(char)*32);
285 mav_array_memcpy(packet.model_name, model_name, sizeof(char)*32);
286 mav_array_memcpy(packet.software_version, software_version, sizeof(char)*24);
287 mav_array_memcpy(packet.hardware_version, hardware_version, sizeof(char)*24);
288 mav_array_memcpy(packet.serial_number, serial_number, sizeof(char)*32);
289 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC, (const char *)&packet, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_CRC);
290#endif
291}
292
293/**
294 * @brief Send a component_information_basic message
295 * @param chan MAVLink channel to send the message
296 * @param struct The MAVLink struct to serialize
297 */
298static inline void mavlink_msg_component_information_basic_send_struct(mavlink_channel_t chan, const mavlink_component_information_basic_t* component_information_basic)
299{
300#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
301 mavlink_msg_component_information_basic_send(chan, component_information_basic->time_boot_ms, component_information_basic->capabilities, component_information_basic->time_manufacture_s, component_information_basic->vendor_name, component_information_basic->model_name, component_information_basic->software_version, component_information_basic->hardware_version, component_information_basic->serial_number);
302#else
303 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC, (const char *)component_information_basic, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_CRC);
304#endif
305}
306
307#if MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN <= MAVLINK_MAX_PAYLOAD_LEN
308/*
309 This variant of _send() can be used to save stack space by reusing
310 memory from the receive buffer. The caller provides a
311 mavlink_message_t which is the size of a full mavlink message. This
312 is usually the receive buffer for the channel, and allows a reply to an
313 incoming message with minimum stack space usage.
314 */
315static inline void mavlink_msg_component_information_basic_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint64_t capabilities, uint32_t time_manufacture_s, const char *vendor_name, const char *model_name, const char *software_version, const char *hardware_version, const char *serial_number)
316{
317#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
318 char *buf = (char *)msgbuf;
319 _mav_put_uint64_t(buf, 0, capabilities);
320 _mav_put_uint32_t(buf, 8, time_boot_ms);
321 _mav_put_uint32_t(buf, 12, time_manufacture_s);
322 _mav_put_char_array(buf, 16, vendor_name, 32);
323 _mav_put_char_array(buf, 48, model_name, 32);
324 _mav_put_char_array(buf, 80, software_version, 24);
325 _mav_put_char_array(buf, 104, hardware_version, 24);
326 _mav_put_char_array(buf, 128, serial_number, 32);
327 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC, buf, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_CRC);
328#else
329 mavlink_component_information_basic_t *packet = (mavlink_component_information_basic_t *)msgbuf;
330 packet->capabilities = capabilities;
331 packet->time_boot_ms = time_boot_ms;
332 packet->time_manufacture_s = time_manufacture_s;
333 mav_array_memcpy(packet->vendor_name, vendor_name, sizeof(char)*32);
334 mav_array_memcpy(packet->model_name, model_name, sizeof(char)*32);
335 mav_array_memcpy(packet->software_version, software_version, sizeof(char)*24);
336 mav_array_memcpy(packet->hardware_version, hardware_version, sizeof(char)*24);
337 mav_array_memcpy(packet->serial_number, serial_number, sizeof(char)*32);
338 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC, (const char *)packet, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_MIN_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_CRC);
339#endif
340}
341#endif
342
343#endif
344
345// MESSAGE COMPONENT_INFORMATION_BASIC UNPACKING
346
347
348/**
349 * @brief Get field time_boot_ms from component_information_basic message
350 *
351 * @return [ms] Timestamp (time since system boot).
352 */
353static inline uint32_t mavlink_msg_component_information_basic_get_time_boot_ms(const mavlink_message_t* msg)
354{
355 return _MAV_RETURN_uint32_t(msg, 8);
356}
357
358/**
359 * @brief Get field capabilities from component_information_basic message
360 *
361 * @return Component capability flags
362 */
363static inline uint64_t mavlink_msg_component_information_basic_get_capabilities(const mavlink_message_t* msg)
364{
365 return _MAV_RETURN_uint64_t(msg, 0);
366}
367
368/**
369 * @brief Get field time_manufacture_s from component_information_basic message
370 *
371 * @return [s] Date of manufacture as a UNIX Epoch time (since 1.1.1970) in seconds.
372 */
373static inline uint32_t mavlink_msg_component_information_basic_get_time_manufacture_s(const mavlink_message_t* msg)
374{
375 return _MAV_RETURN_uint32_t(msg, 12);
376}
377
378/**
379 * @brief Get field vendor_name from component_information_basic message
380 *
381 * @return Name of the component vendor. Needs to be zero terminated. The field is optional and can be empty/all zeros.
382 */
383static inline uint16_t mavlink_msg_component_information_basic_get_vendor_name(const mavlink_message_t* msg, char *vendor_name)
384{
385 return _MAV_RETURN_char_array(msg, vendor_name, 32, 16);
386}
387
388/**
389 * @brief Get field model_name from component_information_basic message
390 *
391 * @return Name of the component model. Needs to be zero terminated. The field is optional and can be empty/all zeros.
392 */
393static inline uint16_t mavlink_msg_component_information_basic_get_model_name(const mavlink_message_t* msg, char *model_name)
394{
395 return _MAV_RETURN_char_array(msg, model_name, 32, 48);
396}
397
398/**
399 * @brief Get field software_version from component_information_basic message
400 *
401 * @return Software version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
402 */
403static inline uint16_t mavlink_msg_component_information_basic_get_software_version(const mavlink_message_t* msg, char *software_version)
404{
405 return _MAV_RETURN_char_array(msg, software_version, 24, 80);
406}
407
408/**
409 * @brief Get field hardware_version from component_information_basic message
410 *
411 * @return Hardware version. The recommended format is SEMVER: 'major.minor.patch' (any format may be used). The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
412 */
413static inline uint16_t mavlink_msg_component_information_basic_get_hardware_version(const mavlink_message_t* msg, char *hardware_version)
414{
415 return _MAV_RETURN_char_array(msg, hardware_version, 24, 104);
416}
417
418/**
419 * @brief Get field serial_number from component_information_basic message
420 *
421 * @return Hardware serial number. The field must be zero terminated if it has a value. The field is optional and can be empty/all zeros.
422 */
423static inline uint16_t mavlink_msg_component_information_basic_get_serial_number(const mavlink_message_t* msg, char *serial_number)
424{
425 return _MAV_RETURN_char_array(msg, serial_number, 32, 128);
426}
427
428/**
429 * @brief Decode a component_information_basic message into a struct
430 *
431 * @param msg The message to decode
432 * @param component_information_basic C-struct to decode the message contents into
433 */
434static inline void mavlink_msg_component_information_basic_decode(const mavlink_message_t* msg, mavlink_component_information_basic_t* component_information_basic)
435{
436#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
437 component_information_basic->capabilities = mavlink_msg_component_information_basic_get_capabilities(msg);
438 component_information_basic->time_boot_ms = mavlink_msg_component_information_basic_get_time_boot_ms(msg);
439 component_information_basic->time_manufacture_s = mavlink_msg_component_information_basic_get_time_manufacture_s(msg);
440 mavlink_msg_component_information_basic_get_vendor_name(msg, component_information_basic->vendor_name);
441 mavlink_msg_component_information_basic_get_model_name(msg, component_information_basic->model_name);
442 mavlink_msg_component_information_basic_get_software_version(msg, component_information_basic->software_version);
443 mavlink_msg_component_information_basic_get_hardware_version(msg, component_information_basic->hardware_version);
444 mavlink_msg_component_information_basic_get_serial_number(msg, component_information_basic->serial_number);
445#else
446 uint8_t len = msg->len < MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN? msg->len : MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN;
447 memset(component_information_basic, 0, MAVLINK_MSG_ID_COMPONENT_INFORMATION_BASIC_LEN);
448 memcpy(component_information_basic, _MAV_PAYLOAD(msg), len);
449#endif
450}