Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_uavcan_node_info.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE UAVCAN_NODE_INFO PACKING
3
4#define MAVLINK_MSG_ID_UAVCAN_NODE_INFO 311
5
6
8 uint64_t time_usec; /*< [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.*/
9 uint32_t uptime_sec; /*< [s] Time since the start-up of the node.*/
10 uint32_t sw_vcs_commit; /*< Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown.*/
11 char name[80]; /*< Node name string. For example, "sapog.px4.io".*/
12 uint8_t hw_version_major; /*< Hardware major version number.*/
13 uint8_t hw_version_minor; /*< Hardware minor version number.*/
14 uint8_t hw_unique_id[16]; /*< Hardware unique 128-bit ID.*/
15 uint8_t sw_version_major; /*< Software major version number.*/
16 uint8_t sw_version_minor; /*< Software minor version number.*/
17} mavlink_uavcan_node_info_t;
18
19#define MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN 116
20#define MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN 116
21#define MAVLINK_MSG_ID_311_LEN 116
22#define MAVLINK_MSG_ID_311_MIN_LEN 116
23
24#define MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC 95
25#define MAVLINK_MSG_ID_311_CRC 95
26
27#define MAVLINK_MSG_UAVCAN_NODE_INFO_FIELD_NAME_LEN 80
28#define MAVLINK_MSG_UAVCAN_NODE_INFO_FIELD_HW_UNIQUE_ID_LEN 16
29
30#if MAVLINK_COMMAND_24BIT
31#define MAVLINK_MESSAGE_INFO_UAVCAN_NODE_INFO {
32 311,
33 "UAVCAN_NODE_INFO",
34 9,
35 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uavcan_node_info_t, time_usec) },
36 { "uptime_sec", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_uavcan_node_info_t, uptime_sec) },
37 { "name", NULL, MAVLINK_TYPE_CHAR, 80, 16, offsetof(mavlink_uavcan_node_info_t, name) },
38 { "hw_version_major", NULL, MAVLINK_TYPE_UINT8_T, 0, 96, offsetof(mavlink_uavcan_node_info_t, hw_version_major) },
39 { "hw_version_minor", NULL, MAVLINK_TYPE_UINT8_T, 0, 97, offsetof(mavlink_uavcan_node_info_t, hw_version_minor) },
40 { "hw_unique_id", NULL, MAVLINK_TYPE_UINT8_T, 16, 98, offsetof(mavlink_uavcan_node_info_t, hw_unique_id) },
41 { "sw_version_major", NULL, MAVLINK_TYPE_UINT8_T, 0, 114, offsetof(mavlink_uavcan_node_info_t, sw_version_major) },
42 { "sw_version_minor", NULL, MAVLINK_TYPE_UINT8_T, 0, 115, offsetof(mavlink_uavcan_node_info_t, sw_version_minor) },
43 { "sw_vcs_commit", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_uavcan_node_info_t, sw_vcs_commit) },
44 } \
45}
46#else
47#define MAVLINK_MESSAGE_INFO_UAVCAN_NODE_INFO {
48 "UAVCAN_NODE_INFO",
49 9,
50 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_uavcan_node_info_t, time_usec) },
51 { "uptime_sec", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_uavcan_node_info_t, uptime_sec) },
52 { "name", NULL, MAVLINK_TYPE_CHAR, 80, 16, offsetof(mavlink_uavcan_node_info_t, name) },
53 { "hw_version_major", NULL, MAVLINK_TYPE_UINT8_T, 0, 96, offsetof(mavlink_uavcan_node_info_t, hw_version_major) },
54 { "hw_version_minor", NULL, MAVLINK_TYPE_UINT8_T, 0, 97, offsetof(mavlink_uavcan_node_info_t, hw_version_minor) },
55 { "hw_unique_id", NULL, MAVLINK_TYPE_UINT8_T, 16, 98, offsetof(mavlink_uavcan_node_info_t, hw_unique_id) },
56 { "sw_version_major", NULL, MAVLINK_TYPE_UINT8_T, 0, 114, offsetof(mavlink_uavcan_node_info_t, sw_version_major) },
57 { "sw_version_minor", NULL, MAVLINK_TYPE_UINT8_T, 0, 115, offsetof(mavlink_uavcan_node_info_t, sw_version_minor) },
58 { "sw_vcs_commit", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_uavcan_node_info_t, sw_vcs_commit) },
59 } \
60}
61#endif
62
63/**
64 * @brief Pack a uavcan_node_info 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_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
70 * @param uptime_sec [s] Time since the start-up of the node.
71 * @param name Node name string. For example, "sapog.px4.io".
72 * @param hw_version_major Hardware major version number.
73 * @param hw_version_minor Hardware minor version number.
74 * @param hw_unique_id Hardware unique 128-bit ID.
75 * @param sw_version_major Software major version number.
76 * @param sw_version_minor Software minor version number.
77 * @param sw_vcs_commit Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown.
78 * @return length of the message in bytes (excluding serial stream start sign)
79 */
80static inline uint16_t mavlink_msg_uavcan_node_info_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
81 uint64_t time_usec, uint32_t uptime_sec, const char *name, uint8_t hw_version_major, uint8_t hw_version_minor, const uint8_t *hw_unique_id, uint8_t sw_version_major, uint8_t sw_version_minor, uint32_t sw_vcs_commit)
82{
83#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
85 _mav_put_uint64_t(buf, 0, time_usec);
86 _mav_put_uint32_t(buf, 8, uptime_sec);
87 _mav_put_uint32_t(buf, 12, sw_vcs_commit);
88 _mav_put_uint8_t(buf, 96, hw_version_major);
89 _mav_put_uint8_t(buf, 97, hw_version_minor);
90 _mav_put_uint8_t(buf, 114, sw_version_major);
91 _mav_put_uint8_t(buf, 115, sw_version_minor);
92 _mav_put_char_array(buf, 16, name, 80);
93 _mav_put_uint8_t_array(buf, 98, hw_unique_id, 16);
94 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
95#else
96 mavlink_uavcan_node_info_t packet;
97 packet.time_usec = time_usec;
98 packet.uptime_sec = uptime_sec;
99 packet.sw_vcs_commit = sw_vcs_commit;
100 packet.hw_version_major = hw_version_major;
101 packet.hw_version_minor = hw_version_minor;
102 packet.sw_version_major = sw_version_major;
103 packet.sw_version_minor = sw_version_minor;
104 mav_array_memcpy(packet.name, name, sizeof(char)*80);
105 mav_array_memcpy(packet.hw_unique_id, hw_unique_id, sizeof(uint8_t)*16);
106 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
107#endif
108
110 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
111}
112
113/**
114 * @brief Pack a uavcan_node_info message
115 * @param system_id ID of this system
116 * @param component_id ID of this component (e.g. 200 for IMU)
117 * @param status MAVLink status structure
118 * @param msg The MAVLink message to compress the data into
119 *
120 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
121 * @param uptime_sec [s] Time since the start-up of the node.
122 * @param name Node name string. For example, "sapog.px4.io".
123 * @param hw_version_major Hardware major version number.
124 * @param hw_version_minor Hardware minor version number.
125 * @param hw_unique_id Hardware unique 128-bit ID.
126 * @param sw_version_major Software major version number.
127 * @param sw_version_minor Software minor version number.
128 * @param sw_vcs_commit Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown.
129 * @return length of the message in bytes (excluding serial stream start sign)
130 */
131static inline uint16_t mavlink_msg_uavcan_node_info_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
132 uint64_t time_usec, uint32_t uptime_sec, const char *name, uint8_t hw_version_major, uint8_t hw_version_minor, const uint8_t *hw_unique_id, uint8_t sw_version_major, uint8_t sw_version_minor, uint32_t sw_vcs_commit)
133{
134#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
136 _mav_put_uint64_t(buf, 0, time_usec);
137 _mav_put_uint32_t(buf, 8, uptime_sec);
138 _mav_put_uint32_t(buf, 12, sw_vcs_commit);
139 _mav_put_uint8_t(buf, 96, hw_version_major);
140 _mav_put_uint8_t(buf, 97, hw_version_minor);
141 _mav_put_uint8_t(buf, 114, sw_version_major);
142 _mav_put_uint8_t(buf, 115, sw_version_minor);
143 _mav_put_char_array(buf, 16, name, 80);
144 _mav_put_uint8_t_array(buf, 98, hw_unique_id, 16);
145 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
146#else
147 mavlink_uavcan_node_info_t packet;
148 packet.time_usec = time_usec;
149 packet.uptime_sec = uptime_sec;
150 packet.sw_vcs_commit = sw_vcs_commit;
151 packet.hw_version_major = hw_version_major;
152 packet.hw_version_minor = hw_version_minor;
153 packet.sw_version_major = sw_version_major;
154 packet.sw_version_minor = sw_version_minor;
155 mav_array_memcpy(packet.name, name, sizeof(char)*80);
156 mav_array_memcpy(packet.hw_unique_id, hw_unique_id, sizeof(uint8_t)*16);
157 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
158#endif
159
161#if MAVLINK_CRC_EXTRA
162 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
163#else
164 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
165#endif
166}
167
168/**
169 * @brief Pack a uavcan_node_info message on a channel
170 * @param system_id ID of this system
171 * @param component_id ID of this component (e.g. 200 for IMU)
172 * @param chan The MAVLink channel this message will be sent over
173 * @param msg The MAVLink message to compress the data into
174 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
175 * @param uptime_sec [s] Time since the start-up of the node.
176 * @param name Node name string. For example, "sapog.px4.io".
177 * @param hw_version_major Hardware major version number.
178 * @param hw_version_minor Hardware minor version number.
179 * @param hw_unique_id Hardware unique 128-bit ID.
180 * @param sw_version_major Software major version number.
181 * @param sw_version_minor Software minor version number.
182 * @param sw_vcs_commit Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown.
183 * @return length of the message in bytes (excluding serial stream start sign)
184 */
185static inline uint16_t mavlink_msg_uavcan_node_info_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
186 mavlink_message_t* msg,
187 uint64_t time_usec,uint32_t uptime_sec,const char *name,uint8_t hw_version_major,uint8_t hw_version_minor,const uint8_t *hw_unique_id,uint8_t sw_version_major,uint8_t sw_version_minor,uint32_t sw_vcs_commit)
188{
189#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
191 _mav_put_uint64_t(buf, 0, time_usec);
192 _mav_put_uint32_t(buf, 8, uptime_sec);
193 _mav_put_uint32_t(buf, 12, sw_vcs_commit);
194 _mav_put_uint8_t(buf, 96, hw_version_major);
195 _mav_put_uint8_t(buf, 97, hw_version_minor);
196 _mav_put_uint8_t(buf, 114, sw_version_major);
197 _mav_put_uint8_t(buf, 115, sw_version_minor);
198 _mav_put_char_array(buf, 16, name, 80);
199 _mav_put_uint8_t_array(buf, 98, hw_unique_id, 16);
200 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
201#else
202 mavlink_uavcan_node_info_t packet;
203 packet.time_usec = time_usec;
204 packet.uptime_sec = uptime_sec;
205 packet.sw_vcs_commit = sw_vcs_commit;
206 packet.hw_version_major = hw_version_major;
207 packet.hw_version_minor = hw_version_minor;
208 packet.sw_version_major = sw_version_major;
209 packet.sw_version_minor = sw_version_minor;
210 mav_array_memcpy(packet.name, name, sizeof(char)*80);
211 mav_array_memcpy(packet.hw_unique_id, hw_unique_id, sizeof(uint8_t)*16);
212 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
213#endif
214
216 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
217}
218
219/**
220 * @brief Encode a uavcan_node_info struct
221 *
222 * @param system_id ID of this system
223 * @param component_id ID of this component (e.g. 200 for IMU)
224 * @param msg The MAVLink message to compress the data into
225 * @param uavcan_node_info C-struct to read the message contents from
226 */
227static inline uint16_t mavlink_msg_uavcan_node_info_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_uavcan_node_info_t* uavcan_node_info)
228{
229 return mavlink_msg_uavcan_node_info_pack(system_id, component_id, msg, uavcan_node_info->time_usec, uavcan_node_info->uptime_sec, uavcan_node_info->name, uavcan_node_info->hw_version_major, uavcan_node_info->hw_version_minor, uavcan_node_info->hw_unique_id, uavcan_node_info->sw_version_major, uavcan_node_info->sw_version_minor, uavcan_node_info->sw_vcs_commit);
230}
231
232/**
233 * @brief Encode a uavcan_node_info struct on a channel
234 *
235 * @param system_id ID of this system
236 * @param component_id ID of this component (e.g. 200 for IMU)
237 * @param chan The MAVLink channel this message will be sent over
238 * @param msg The MAVLink message to compress the data into
239 * @param uavcan_node_info C-struct to read the message contents from
240 */
241static inline uint16_t mavlink_msg_uavcan_node_info_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_uavcan_node_info_t* uavcan_node_info)
242{
243 return mavlink_msg_uavcan_node_info_pack_chan(system_id, component_id, chan, msg, uavcan_node_info->time_usec, uavcan_node_info->uptime_sec, uavcan_node_info->name, uavcan_node_info->hw_version_major, uavcan_node_info->hw_version_minor, uavcan_node_info->hw_unique_id, uavcan_node_info->sw_version_major, uavcan_node_info->sw_version_minor, uavcan_node_info->sw_vcs_commit);
244}
245
246/**
247 * @brief Encode a uavcan_node_info struct with provided status structure
248 *
249 * @param system_id ID of this system
250 * @param component_id ID of this component (e.g. 200 for IMU)
251 * @param status MAVLink status structure
252 * @param msg The MAVLink message to compress the data into
253 * @param uavcan_node_info C-struct to read the message contents from
254 */
255static inline uint16_t mavlink_msg_uavcan_node_info_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_uavcan_node_info_t* uavcan_node_info)
256{
257 return mavlink_msg_uavcan_node_info_pack_status(system_id, component_id, _status, msg, uavcan_node_info->time_usec, uavcan_node_info->uptime_sec, uavcan_node_info->name, uavcan_node_info->hw_version_major, uavcan_node_info->hw_version_minor, uavcan_node_info->hw_unique_id, uavcan_node_info->sw_version_major, uavcan_node_info->sw_version_minor, uavcan_node_info->sw_vcs_commit);
258}
259
260/**
261 * @brief Send a uavcan_node_info message
262 * @param chan MAVLink channel to send the message
263 *
264 * @param time_usec [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
265 * @param uptime_sec [s] Time since the start-up of the node.
266 * @param name Node name string. For example, "sapog.px4.io".
267 * @param hw_version_major Hardware major version number.
268 * @param hw_version_minor Hardware minor version number.
269 * @param hw_unique_id Hardware unique 128-bit ID.
270 * @param sw_version_major Software major version number.
271 * @param sw_version_minor Software minor version number.
272 * @param sw_vcs_commit Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown.
273 */
274#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
275
276static inline void mavlink_msg_uavcan_node_info_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t uptime_sec, const char *name, uint8_t hw_version_major, uint8_t hw_version_minor, const uint8_t *hw_unique_id, uint8_t sw_version_major, uint8_t sw_version_minor, uint32_t sw_vcs_commit)
277{
278#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
279 char buf[MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN];
280 _mav_put_uint64_t(buf, 0, time_usec);
281 _mav_put_uint32_t(buf, 8, uptime_sec);
282 _mav_put_uint32_t(buf, 12, sw_vcs_commit);
283 _mav_put_uint8_t(buf, 96, hw_version_major);
284 _mav_put_uint8_t(buf, 97, hw_version_minor);
285 _mav_put_uint8_t(buf, 114, sw_version_major);
286 _mav_put_uint8_t(buf, 115, sw_version_minor);
287 _mav_put_char_array(buf, 16, name, 80);
288 _mav_put_uint8_t_array(buf, 98, hw_unique_id, 16);
289 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVCAN_NODE_INFO, buf, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
290#else
291 mavlink_uavcan_node_info_t packet;
292 packet.time_usec = time_usec;
293 packet.uptime_sec = uptime_sec;
294 packet.sw_vcs_commit = sw_vcs_commit;
295 packet.hw_version_major = hw_version_major;
296 packet.hw_version_minor = hw_version_minor;
297 packet.sw_version_major = sw_version_major;
298 packet.sw_version_minor = sw_version_minor;
299 mav_array_memcpy(packet.name, name, sizeof(char)*80);
300 mav_array_memcpy(packet.hw_unique_id, hw_unique_id, sizeof(uint8_t)*16);
301 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVCAN_NODE_INFO, (const char *)&packet, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
302#endif
303}
304
305/**
306 * @brief Send a uavcan_node_info message
307 * @param chan MAVLink channel to send the message
308 * @param struct The MAVLink struct to serialize
309 */
310static inline void mavlink_msg_uavcan_node_info_send_struct(mavlink_channel_t chan, const mavlink_uavcan_node_info_t* uavcan_node_info)
311{
312#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
313 mavlink_msg_uavcan_node_info_send(chan, uavcan_node_info->time_usec, uavcan_node_info->uptime_sec, uavcan_node_info->name, uavcan_node_info->hw_version_major, uavcan_node_info->hw_version_minor, uavcan_node_info->hw_unique_id, uavcan_node_info->sw_version_major, uavcan_node_info->sw_version_minor, uavcan_node_info->sw_vcs_commit);
314#else
315 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVCAN_NODE_INFO, (const char *)uavcan_node_info, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
316#endif
317}
318
319#if MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN <= MAVLINK_MAX_PAYLOAD_LEN
320/*
321 This variant of _send() can be used to save stack space by reusing
322 memory from the receive buffer. The caller provides a
323 mavlink_message_t which is the size of a full mavlink message. This
324 is usually the receive buffer for the channel, and allows a reply to an
325 incoming message with minimum stack space usage.
326 */
327static inline void mavlink_msg_uavcan_node_info_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint32_t uptime_sec, const char *name, uint8_t hw_version_major, uint8_t hw_version_minor, const uint8_t *hw_unique_id, uint8_t sw_version_major, uint8_t sw_version_minor, uint32_t sw_vcs_commit)
328{
329#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
330 char *buf = (char *)msgbuf;
331 _mav_put_uint64_t(buf, 0, time_usec);
332 _mav_put_uint32_t(buf, 8, uptime_sec);
333 _mav_put_uint32_t(buf, 12, sw_vcs_commit);
334 _mav_put_uint8_t(buf, 96, hw_version_major);
335 _mav_put_uint8_t(buf, 97, hw_version_minor);
336 _mav_put_uint8_t(buf, 114, sw_version_major);
337 _mav_put_uint8_t(buf, 115, sw_version_minor);
338 _mav_put_char_array(buf, 16, name, 80);
339 _mav_put_uint8_t_array(buf, 98, hw_unique_id, 16);
340 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVCAN_NODE_INFO, buf, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
341#else
342 mavlink_uavcan_node_info_t *packet = (mavlink_uavcan_node_info_t *)msgbuf;
343 packet->time_usec = time_usec;
344 packet->uptime_sec = uptime_sec;
345 packet->sw_vcs_commit = sw_vcs_commit;
346 packet->hw_version_major = hw_version_major;
347 packet->hw_version_minor = hw_version_minor;
348 packet->sw_version_major = sw_version_major;
349 packet->sw_version_minor = sw_version_minor;
350 mav_array_memcpy(packet->name, name, sizeof(char)*80);
351 mav_array_memcpy(packet->hw_unique_id, hw_unique_id, sizeof(uint8_t)*16);
352 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_UAVCAN_NODE_INFO, (const char *)packet, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_MIN_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_CRC);
353#endif
354}
355#endif
356
357#endif
358
359// MESSAGE UAVCAN_NODE_INFO UNPACKING
360
361
362/**
363 * @brief Get field time_usec from uavcan_node_info message
364 *
365 * @return [us] Timestamp (UNIX Epoch time or time since system boot). The receiving end can infer timestamp format (since 1.1.1970 or since system boot) by checking for the magnitude of the number.
366 */
367static inline uint64_t mavlink_msg_uavcan_node_info_get_time_usec(const mavlink_message_t* msg)
368{
369 return _MAV_RETURN_uint64_t(msg, 0);
370}
371
372/**
373 * @brief Get field uptime_sec from uavcan_node_info message
374 *
375 * @return [s] Time since the start-up of the node.
376 */
377static inline uint32_t mavlink_msg_uavcan_node_info_get_uptime_sec(const mavlink_message_t* msg)
378{
379 return _MAV_RETURN_uint32_t(msg, 8);
380}
381
382/**
383 * @brief Get field name from uavcan_node_info message
384 *
385 * @return Node name string. For example, "sapog.px4.io".
386 */
387static inline uint16_t mavlink_msg_uavcan_node_info_get_name(const mavlink_message_t* msg, char *name)
388{
389 return _MAV_RETURN_char_array(msg, name, 80, 16);
390}
391
392/**
393 * @brief Get field hw_version_major from uavcan_node_info message
394 *
395 * @return Hardware major version number.
396 */
397static inline uint8_t mavlink_msg_uavcan_node_info_get_hw_version_major(const mavlink_message_t* msg)
398{
399 return _MAV_RETURN_uint8_t(msg, 96);
400}
401
402/**
403 * @brief Get field hw_version_minor from uavcan_node_info message
404 *
405 * @return Hardware minor version number.
406 */
407static inline uint8_t mavlink_msg_uavcan_node_info_get_hw_version_minor(const mavlink_message_t* msg)
408{
409 return _MAV_RETURN_uint8_t(msg, 97);
410}
411
412/**
413 * @brief Get field hw_unique_id from uavcan_node_info message
414 *
415 * @return Hardware unique 128-bit ID.
416 */
417static inline uint16_t mavlink_msg_uavcan_node_info_get_hw_unique_id(const mavlink_message_t* msg, uint8_t *hw_unique_id)
418{
419 return _MAV_RETURN_uint8_t_array(msg, hw_unique_id, 16, 98);
420}
421
422/**
423 * @brief Get field sw_version_major from uavcan_node_info message
424 *
425 * @return Software major version number.
426 */
427static inline uint8_t mavlink_msg_uavcan_node_info_get_sw_version_major(const mavlink_message_t* msg)
428{
429 return _MAV_RETURN_uint8_t(msg, 114);
430}
431
432/**
433 * @brief Get field sw_version_minor from uavcan_node_info message
434 *
435 * @return Software minor version number.
436 */
437static inline uint8_t mavlink_msg_uavcan_node_info_get_sw_version_minor(const mavlink_message_t* msg)
438{
439 return _MAV_RETURN_uint8_t(msg, 115);
440}
441
442/**
443 * @brief Get field sw_vcs_commit from uavcan_node_info message
444 *
445 * @return Version control system (VCS) revision identifier (e.g. git short commit hash). 0 if unknown.
446 */
447static inline uint32_t mavlink_msg_uavcan_node_info_get_sw_vcs_commit(const mavlink_message_t* msg)
448{
449 return _MAV_RETURN_uint32_t(msg, 12);
450}
451
452/**
453 * @brief Decode a uavcan_node_info message into a struct
454 *
455 * @param msg The message to decode
456 * @param uavcan_node_info C-struct to decode the message contents into
457 */
458static inline void mavlink_msg_uavcan_node_info_decode(const mavlink_message_t* msg, mavlink_uavcan_node_info_t* uavcan_node_info)
459{
460#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
461 uavcan_node_info->time_usec = mavlink_msg_uavcan_node_info_get_time_usec(msg);
462 uavcan_node_info->uptime_sec = mavlink_msg_uavcan_node_info_get_uptime_sec(msg);
463 uavcan_node_info->sw_vcs_commit = mavlink_msg_uavcan_node_info_get_sw_vcs_commit(msg);
464 mavlink_msg_uavcan_node_info_get_name(msg, uavcan_node_info->name);
465 uavcan_node_info->hw_version_major = mavlink_msg_uavcan_node_info_get_hw_version_major(msg);
466 uavcan_node_info->hw_version_minor = mavlink_msg_uavcan_node_info_get_hw_version_minor(msg);
467 mavlink_msg_uavcan_node_info_get_hw_unique_id(msg, uavcan_node_info->hw_unique_id);
468 uavcan_node_info->sw_version_major = mavlink_msg_uavcan_node_info_get_sw_version_major(msg);
469 uavcan_node_info->sw_version_minor = mavlink_msg_uavcan_node_info_get_sw_version_minor(msg);
470#else
471 uint8_t len = msg->len < MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN? msg->len : MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN;
472 memset(uavcan_node_info, 0, MAVLINK_MSG_ID_UAVCAN_NODE_INFO_LEN);
473 memcpy(uavcan_node_info, _MAV_PAYLOAD(msg), len);
474#endif
475}