Merge remote-tracking branch 'upstream/master' into abo_fw_alt_vel_control
[inav.git] / lib / main / MAVLink / common / mavlink_msg_storage_information.h
blob76d8afd57b0ffb997e88712c764939756a34c0a8
1 #pragma once
2 // MESSAGE STORAGE_INFORMATION PACKING
4 #define MAVLINK_MSG_ID_STORAGE_INFORMATION 261
7 typedef struct __mavlink_storage_information_t {
8 uint32_t time_boot_ms; /*< [ms] Timestamp (time since system boot).*/
9 float total_capacity; /*< [MiB] Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.*/
10 float used_capacity; /*< [MiB] Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.*/
11 float available_capacity; /*< [MiB] Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.*/
12 float read_speed; /*< [MiB/s] Read speed.*/
13 float write_speed; /*< [MiB/s] Write speed.*/
14 uint8_t storage_id; /*< Storage ID (1 for first, 2 for second, etc.)*/
15 uint8_t storage_count; /*< Number of storage devices*/
16 uint8_t status; /*< Status of storage*/
17 uint8_t type; /*< Type of storage*/
18 char name[32]; /*< Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user.*/
19 } mavlink_storage_information_t;
21 #define MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN 60
22 #define MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN 27
23 #define MAVLINK_MSG_ID_261_LEN 60
24 #define MAVLINK_MSG_ID_261_MIN_LEN 27
26 #define MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC 179
27 #define MAVLINK_MSG_ID_261_CRC 179
29 #define MAVLINK_MSG_STORAGE_INFORMATION_FIELD_NAME_LEN 32
31 #if MAVLINK_COMMAND_24BIT
32 #define MAVLINK_MESSAGE_INFO_STORAGE_INFORMATION { \
33 261, \
34 "STORAGE_INFORMATION", \
35 11, \
36 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_storage_information_t, time_boot_ms) }, \
37 { "storage_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_storage_information_t, storage_id) }, \
38 { "storage_count", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_storage_information_t, storage_count) }, \
39 { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_storage_information_t, status) }, \
40 { "total_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_storage_information_t, total_capacity) }, \
41 { "used_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_storage_information_t, used_capacity) }, \
42 { "available_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_storage_information_t, available_capacity) }, \
43 { "read_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_storage_information_t, read_speed) }, \
44 { "write_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_storage_information_t, write_speed) }, \
45 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_storage_information_t, type) }, \
46 { "name", NULL, MAVLINK_TYPE_CHAR, 32, 28, offsetof(mavlink_storage_information_t, name) }, \
47 } \
49 #else
50 #define MAVLINK_MESSAGE_INFO_STORAGE_INFORMATION { \
51 "STORAGE_INFORMATION", \
52 11, \
53 { { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 0, offsetof(mavlink_storage_information_t, time_boot_ms) }, \
54 { "storage_id", NULL, MAVLINK_TYPE_UINT8_T, 0, 24, offsetof(mavlink_storage_information_t, storage_id) }, \
55 { "storage_count", NULL, MAVLINK_TYPE_UINT8_T, 0, 25, offsetof(mavlink_storage_information_t, storage_count) }, \
56 { "status", NULL, MAVLINK_TYPE_UINT8_T, 0, 26, offsetof(mavlink_storage_information_t, status) }, \
57 { "total_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_storage_information_t, total_capacity) }, \
58 { "used_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_storage_information_t, used_capacity) }, \
59 { "available_capacity", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_storage_information_t, available_capacity) }, \
60 { "read_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_storage_information_t, read_speed) }, \
61 { "write_speed", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_storage_information_t, write_speed) }, \
62 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 27, offsetof(mavlink_storage_information_t, type) }, \
63 { "name", NULL, MAVLINK_TYPE_CHAR, 32, 28, offsetof(mavlink_storage_information_t, name) }, \
64 } \
66 #endif
68 /**
69 * @brief Pack a storage_information message
70 * @param system_id ID of this system
71 * @param component_id ID of this component (e.g. 200 for IMU)
72 * @param msg The MAVLink message to compress the data into
74 * @param time_boot_ms [ms] Timestamp (time since system boot).
75 * @param storage_id Storage ID (1 for first, 2 for second, etc.)
76 * @param storage_count Number of storage devices
77 * @param status Status of storage
78 * @param total_capacity [MiB] Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
79 * @param used_capacity [MiB] Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
80 * @param available_capacity [MiB] Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
81 * @param read_speed [MiB/s] Read speed.
82 * @param write_speed [MiB/s] Write speed.
83 * @param type Type of storage
84 * @param name Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user.
85 * @return length of the message in bytes (excluding serial stream start sign)
87 static inline uint16_t mavlink_msg_storage_information_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
88 uint32_t time_boot_ms, uint8_t storage_id, uint8_t storage_count, uint8_t status, float total_capacity, float used_capacity, float available_capacity, float read_speed, float write_speed, uint8_t type, const char *name)
90 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
91 char buf[MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN];
92 _mav_put_uint32_t(buf, 0, time_boot_ms);
93 _mav_put_float(buf, 4, total_capacity);
94 _mav_put_float(buf, 8, used_capacity);
95 _mav_put_float(buf, 12, available_capacity);
96 _mav_put_float(buf, 16, read_speed);
97 _mav_put_float(buf, 20, write_speed);
98 _mav_put_uint8_t(buf, 24, storage_id);
99 _mav_put_uint8_t(buf, 25, storage_count);
100 _mav_put_uint8_t(buf, 26, status);
101 _mav_put_uint8_t(buf, 27, type);
102 _mav_put_char_array(buf, 28, name, 32);
103 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN);
104 #else
105 mavlink_storage_information_t packet;
106 packet.time_boot_ms = time_boot_ms;
107 packet.total_capacity = total_capacity;
108 packet.used_capacity = used_capacity;
109 packet.available_capacity = available_capacity;
110 packet.read_speed = read_speed;
111 packet.write_speed = write_speed;
112 packet.storage_id = storage_id;
113 packet.storage_count = storage_count;
114 packet.status = status;
115 packet.type = type;
116 mav_array_memcpy(packet.name, name, sizeof(char)*32);
117 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN);
118 #endif
120 msg->msgid = MAVLINK_MSG_ID_STORAGE_INFORMATION;
121 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC);
125 * @brief Pack a storage_information message on a channel
126 * @param system_id ID of this system
127 * @param component_id ID of this component (e.g. 200 for IMU)
128 * @param chan The MAVLink channel this message will be sent over
129 * @param msg The MAVLink message to compress the data into
130 * @param time_boot_ms [ms] Timestamp (time since system boot).
131 * @param storage_id Storage ID (1 for first, 2 for second, etc.)
132 * @param storage_count Number of storage devices
133 * @param status Status of storage
134 * @param total_capacity [MiB] Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
135 * @param used_capacity [MiB] Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
136 * @param available_capacity [MiB] Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
137 * @param read_speed [MiB/s] Read speed.
138 * @param write_speed [MiB/s] Write speed.
139 * @param type Type of storage
140 * @param name Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user.
141 * @return length of the message in bytes (excluding serial stream start sign)
143 static inline uint16_t mavlink_msg_storage_information_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
144 mavlink_message_t* msg,
145 uint32_t time_boot_ms,uint8_t storage_id,uint8_t storage_count,uint8_t status,float total_capacity,float used_capacity,float available_capacity,float read_speed,float write_speed,uint8_t type,const char *name)
147 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
148 char buf[MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN];
149 _mav_put_uint32_t(buf, 0, time_boot_ms);
150 _mav_put_float(buf, 4, total_capacity);
151 _mav_put_float(buf, 8, used_capacity);
152 _mav_put_float(buf, 12, available_capacity);
153 _mav_put_float(buf, 16, read_speed);
154 _mav_put_float(buf, 20, write_speed);
155 _mav_put_uint8_t(buf, 24, storage_id);
156 _mav_put_uint8_t(buf, 25, storage_count);
157 _mav_put_uint8_t(buf, 26, status);
158 _mav_put_uint8_t(buf, 27, type);
159 _mav_put_char_array(buf, 28, name, 32);
160 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN);
161 #else
162 mavlink_storage_information_t packet;
163 packet.time_boot_ms = time_boot_ms;
164 packet.total_capacity = total_capacity;
165 packet.used_capacity = used_capacity;
166 packet.available_capacity = available_capacity;
167 packet.read_speed = read_speed;
168 packet.write_speed = write_speed;
169 packet.storage_id = storage_id;
170 packet.storage_count = storage_count;
171 packet.status = status;
172 packet.type = type;
173 mav_array_memcpy(packet.name, name, sizeof(char)*32);
174 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN);
175 #endif
177 msg->msgid = MAVLINK_MSG_ID_STORAGE_INFORMATION;
178 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC);
182 * @brief Encode a storage_information struct
184 * @param system_id ID of this system
185 * @param component_id ID of this component (e.g. 200 for IMU)
186 * @param msg The MAVLink message to compress the data into
187 * @param storage_information C-struct to read the message contents from
189 static inline uint16_t mavlink_msg_storage_information_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_storage_information_t* storage_information)
191 return mavlink_msg_storage_information_pack(system_id, component_id, msg, storage_information->time_boot_ms, storage_information->storage_id, storage_information->storage_count, storage_information->status, storage_information->total_capacity, storage_information->used_capacity, storage_information->available_capacity, storage_information->read_speed, storage_information->write_speed, storage_information->type, storage_information->name);
195 * @brief Encode a storage_information struct on a channel
197 * @param system_id ID of this system
198 * @param component_id ID of this component (e.g. 200 for IMU)
199 * @param chan The MAVLink channel this message will be sent over
200 * @param msg The MAVLink message to compress the data into
201 * @param storage_information C-struct to read the message contents from
203 static inline uint16_t mavlink_msg_storage_information_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_storage_information_t* storage_information)
205 return mavlink_msg_storage_information_pack_chan(system_id, component_id, chan, msg, storage_information->time_boot_ms, storage_information->storage_id, storage_information->storage_count, storage_information->status, storage_information->total_capacity, storage_information->used_capacity, storage_information->available_capacity, storage_information->read_speed, storage_information->write_speed, storage_information->type, storage_information->name);
209 * @brief Send a storage_information message
210 * @param chan MAVLink channel to send the message
212 * @param time_boot_ms [ms] Timestamp (time since system boot).
213 * @param storage_id Storage ID (1 for first, 2 for second, etc.)
214 * @param storage_count Number of storage devices
215 * @param status Status of storage
216 * @param total_capacity [MiB] Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
217 * @param used_capacity [MiB] Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
218 * @param available_capacity [MiB] Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
219 * @param read_speed [MiB/s] Read speed.
220 * @param write_speed [MiB/s] Write speed.
221 * @param type Type of storage
222 * @param name Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user.
224 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
226 static inline void mavlink_msg_storage_information_send(mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t storage_id, uint8_t storage_count, uint8_t status, float total_capacity, float used_capacity, float available_capacity, float read_speed, float write_speed, uint8_t type, const char *name)
228 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
229 char buf[MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN];
230 _mav_put_uint32_t(buf, 0, time_boot_ms);
231 _mav_put_float(buf, 4, total_capacity);
232 _mav_put_float(buf, 8, used_capacity);
233 _mav_put_float(buf, 12, available_capacity);
234 _mav_put_float(buf, 16, read_speed);
235 _mav_put_float(buf, 20, write_speed);
236 _mav_put_uint8_t(buf, 24, storage_id);
237 _mav_put_uint8_t(buf, 25, storage_count);
238 _mav_put_uint8_t(buf, 26, status);
239 _mav_put_uint8_t(buf, 27, type);
240 _mav_put_char_array(buf, 28, name, 32);
241 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STORAGE_INFORMATION, buf, MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC);
242 #else
243 mavlink_storage_information_t packet;
244 packet.time_boot_ms = time_boot_ms;
245 packet.total_capacity = total_capacity;
246 packet.used_capacity = used_capacity;
247 packet.available_capacity = available_capacity;
248 packet.read_speed = read_speed;
249 packet.write_speed = write_speed;
250 packet.storage_id = storage_id;
251 packet.storage_count = storage_count;
252 packet.status = status;
253 packet.type = type;
254 mav_array_memcpy(packet.name, name, sizeof(char)*32);
255 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STORAGE_INFORMATION, (const char *)&packet, MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC);
256 #endif
260 * @brief Send a storage_information message
261 * @param chan MAVLink channel to send the message
262 * @param struct The MAVLink struct to serialize
264 static inline void mavlink_msg_storage_information_send_struct(mavlink_channel_t chan, const mavlink_storage_information_t* storage_information)
266 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
267 mavlink_msg_storage_information_send(chan, storage_information->time_boot_ms, storage_information->storage_id, storage_information->storage_count, storage_information->status, storage_information->total_capacity, storage_information->used_capacity, storage_information->available_capacity, storage_information->read_speed, storage_information->write_speed, storage_information->type, storage_information->name);
268 #else
269 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STORAGE_INFORMATION, (const char *)storage_information, MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC);
270 #endif
273 #if MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN <= MAVLINK_MAX_PAYLOAD_LEN
275 This varient of _send() can be used to save stack space by re-using
276 memory from the receive buffer. The caller provides a
277 mavlink_message_t which is the size of a full mavlink message. This
278 is usually the receive buffer for the channel, and allows a reply to an
279 incoming message with minimum stack space usage.
281 static inline void mavlink_msg_storage_information_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint32_t time_boot_ms, uint8_t storage_id, uint8_t storage_count, uint8_t status, float total_capacity, float used_capacity, float available_capacity, float read_speed, float write_speed, uint8_t type, const char *name)
283 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
284 char *buf = (char *)msgbuf;
285 _mav_put_uint32_t(buf, 0, time_boot_ms);
286 _mav_put_float(buf, 4, total_capacity);
287 _mav_put_float(buf, 8, used_capacity);
288 _mav_put_float(buf, 12, available_capacity);
289 _mav_put_float(buf, 16, read_speed);
290 _mav_put_float(buf, 20, write_speed);
291 _mav_put_uint8_t(buf, 24, storage_id);
292 _mav_put_uint8_t(buf, 25, storage_count);
293 _mav_put_uint8_t(buf, 26, status);
294 _mav_put_uint8_t(buf, 27, type);
295 _mav_put_char_array(buf, 28, name, 32);
296 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STORAGE_INFORMATION, buf, MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC);
297 #else
298 mavlink_storage_information_t *packet = (mavlink_storage_information_t *)msgbuf;
299 packet->time_boot_ms = time_boot_ms;
300 packet->total_capacity = total_capacity;
301 packet->used_capacity = used_capacity;
302 packet->available_capacity = available_capacity;
303 packet->read_speed = read_speed;
304 packet->write_speed = write_speed;
305 packet->storage_id = storage_id;
306 packet->storage_count = storage_count;
307 packet->status = status;
308 packet->type = type;
309 mav_array_memcpy(packet->name, name, sizeof(char)*32);
310 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_STORAGE_INFORMATION, (const char *)packet, MAVLINK_MSG_ID_STORAGE_INFORMATION_MIN_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN, MAVLINK_MSG_ID_STORAGE_INFORMATION_CRC);
311 #endif
313 #endif
315 #endif
317 // MESSAGE STORAGE_INFORMATION UNPACKING
321 * @brief Get field time_boot_ms from storage_information message
323 * @return [ms] Timestamp (time since system boot).
325 static inline uint32_t mavlink_msg_storage_information_get_time_boot_ms(const mavlink_message_t* msg)
327 return _MAV_RETURN_uint32_t(msg, 0);
331 * @brief Get field storage_id from storage_information message
333 * @return Storage ID (1 for first, 2 for second, etc.)
335 static inline uint8_t mavlink_msg_storage_information_get_storage_id(const mavlink_message_t* msg)
337 return _MAV_RETURN_uint8_t(msg, 24);
341 * @brief Get field storage_count from storage_information message
343 * @return Number of storage devices
345 static inline uint8_t mavlink_msg_storage_information_get_storage_count(const mavlink_message_t* msg)
347 return _MAV_RETURN_uint8_t(msg, 25);
351 * @brief Get field status from storage_information message
353 * @return Status of storage
355 static inline uint8_t mavlink_msg_storage_information_get_status(const mavlink_message_t* msg)
357 return _MAV_RETURN_uint8_t(msg, 26);
361 * @brief Get field total_capacity from storage_information message
363 * @return [MiB] Total capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
365 static inline float mavlink_msg_storage_information_get_total_capacity(const mavlink_message_t* msg)
367 return _MAV_RETURN_float(msg, 4);
371 * @brief Get field used_capacity from storage_information message
373 * @return [MiB] Used capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
375 static inline float mavlink_msg_storage_information_get_used_capacity(const mavlink_message_t* msg)
377 return _MAV_RETURN_float(msg, 8);
381 * @brief Get field available_capacity from storage_information message
383 * @return [MiB] Available storage capacity. If storage is not ready (STORAGE_STATUS_READY) value will be ignored.
385 static inline float mavlink_msg_storage_information_get_available_capacity(const mavlink_message_t* msg)
387 return _MAV_RETURN_float(msg, 12);
391 * @brief Get field read_speed from storage_information message
393 * @return [MiB/s] Read speed.
395 static inline float mavlink_msg_storage_information_get_read_speed(const mavlink_message_t* msg)
397 return _MAV_RETURN_float(msg, 16);
401 * @brief Get field write_speed from storage_information message
403 * @return [MiB/s] Write speed.
405 static inline float mavlink_msg_storage_information_get_write_speed(const mavlink_message_t* msg)
407 return _MAV_RETURN_float(msg, 20);
411 * @brief Get field type from storage_information message
413 * @return Type of storage
415 static inline uint8_t mavlink_msg_storage_information_get_type(const mavlink_message_t* msg)
417 return _MAV_RETURN_uint8_t(msg, 27);
421 * @brief Get field name from storage_information message
423 * @return Textual storage name to be used in UI (microSD 1, Internal Memory, etc.) This is a NULL terminated string. If it is exactly 32 characters long, add a terminating NULL. If this string is empty, the generic type is shown to the user.
425 static inline uint16_t mavlink_msg_storage_information_get_name(const mavlink_message_t* msg, char *name)
427 return _MAV_RETURN_char_array(msg, name, 32, 28);
431 * @brief Decode a storage_information message into a struct
433 * @param msg The message to decode
434 * @param storage_information C-struct to decode the message contents into
436 static inline void mavlink_msg_storage_information_decode(const mavlink_message_t* msg, mavlink_storage_information_t* storage_information)
438 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
439 storage_information->time_boot_ms = mavlink_msg_storage_information_get_time_boot_ms(msg);
440 storage_information->total_capacity = mavlink_msg_storage_information_get_total_capacity(msg);
441 storage_information->used_capacity = mavlink_msg_storage_information_get_used_capacity(msg);
442 storage_information->available_capacity = mavlink_msg_storage_information_get_available_capacity(msg);
443 storage_information->read_speed = mavlink_msg_storage_information_get_read_speed(msg);
444 storage_information->write_speed = mavlink_msg_storage_information_get_write_speed(msg);
445 storage_information->storage_id = mavlink_msg_storage_information_get_storage_id(msg);
446 storage_information->storage_count = mavlink_msg_storage_information_get_storage_count(msg);
447 storage_information->status = mavlink_msg_storage_information_get_status(msg);
448 storage_information->type = mavlink_msg_storage_information_get_type(msg);
449 mavlink_msg_storage_information_get_name(msg, storage_information->name);
450 #else
451 uint8_t len = msg->len < MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN? msg->len : MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN;
452 memset(storage_information, 0, MAVLINK_MSG_ID_STORAGE_INFORMATION_LEN);
453 memcpy(storage_information, _MAV_PAYLOAD(msg), len);
454 #endif