Merge pull request #10476 from radiolinkW/RADIOLINKF722
[inav.git] / lib / main / MAVLink / common / mavlink_msg_onboard_computer_status.h
blob6da2581423e01a304a42985126cd52e653947414
1 #pragma once
2 // MESSAGE ONBOARD_COMPUTER_STATUS PACKING
4 #define MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS 390
7 typedef struct __mavlink_onboard_computer_status_t {
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; /*< [ms] Time since system boot.*/
10 uint32_t ram_usage; /*< [MiB] Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused.*/
11 uint32_t ram_total; /*< [MiB] Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused.*/
12 uint32_t storage_type[4]; /*< Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused.*/
13 uint32_t storage_usage[4]; /*< [MiB] Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused.*/
14 uint32_t storage_total[4]; /*< [MiB] Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused.*/
15 uint32_t link_type[6]; /*< Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary*/
16 uint32_t link_tx_rate[6]; /*< [KiB/s] Network traffic from the component system. A value of UINT32_MAX implies the field is unused.*/
17 uint32_t link_rx_rate[6]; /*< [KiB/s] Network traffic to the component system. A value of UINT32_MAX implies the field is unused.*/
18 uint32_t link_tx_max[6]; /*< [KiB/s] Network capacity from the component system. A value of UINT32_MAX implies the field is unused.*/
19 uint32_t link_rx_max[6]; /*< [KiB/s] Network capacity to the component system. A value of UINT32_MAX implies the field is unused.*/
20 int16_t fan_speed[4]; /*< [rpm] Fan speeds. A value of INT16_MAX implies the field is unused.*/
21 uint8_t type; /*< Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers.*/
22 uint8_t cpu_cores[8]; /*< CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.*/
23 uint8_t cpu_combined[10]; /*< Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.*/
24 uint8_t gpu_cores[4]; /*< GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.*/
25 uint8_t gpu_combined[10]; /*< Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.*/
26 int8_t temperature_board; /*< [degC] Temperature of the board. A value of INT8_MAX implies the field is unused.*/
27 int8_t temperature_core[8]; /*< [degC] Temperature of the CPU core. A value of INT8_MAX implies the field is unused.*/
28 } mavlink_onboard_computer_status_t;
30 #define MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN 238
31 #define MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN 238
32 #define MAVLINK_MSG_ID_390_LEN 238
33 #define MAVLINK_MSG_ID_390_MIN_LEN 238
35 #define MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC 156
36 #define MAVLINK_MSG_ID_390_CRC 156
38 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_STORAGE_TYPE_LEN 4
39 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_STORAGE_USAGE_LEN 4
40 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_STORAGE_TOTAL_LEN 4
41 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_LINK_TYPE_LEN 6
42 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_LINK_TX_RATE_LEN 6
43 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_LINK_RX_RATE_LEN 6
44 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_LINK_TX_MAX_LEN 6
45 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_LINK_RX_MAX_LEN 6
46 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_FAN_SPEED_LEN 4
47 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_CPU_CORES_LEN 8
48 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_CPU_COMBINED_LEN 10
49 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_GPU_CORES_LEN 4
50 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_GPU_COMBINED_LEN 10
51 #define MAVLINK_MSG_ONBOARD_COMPUTER_STATUS_FIELD_TEMPERATURE_CORE_LEN 8
53 #if MAVLINK_COMMAND_24BIT
54 #define MAVLINK_MESSAGE_INFO_ONBOARD_COMPUTER_STATUS { \
55 390, \
56 "ONBOARD_COMPUTER_STATUS", \
57 20, \
58 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_onboard_computer_status_t, time_usec) }, \
59 { "uptime", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_onboard_computer_status_t, uptime) }, \
60 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 196, offsetof(mavlink_onboard_computer_status_t, type) }, \
61 { "cpu_cores", NULL, MAVLINK_TYPE_UINT8_T, 8, 197, offsetof(mavlink_onboard_computer_status_t, cpu_cores) }, \
62 { "cpu_combined", NULL, MAVLINK_TYPE_UINT8_T, 10, 205, offsetof(mavlink_onboard_computer_status_t, cpu_combined) }, \
63 { "gpu_cores", NULL, MAVLINK_TYPE_UINT8_T, 4, 215, offsetof(mavlink_onboard_computer_status_t, gpu_cores) }, \
64 { "gpu_combined", NULL, MAVLINK_TYPE_UINT8_T, 10, 219, offsetof(mavlink_onboard_computer_status_t, gpu_combined) }, \
65 { "temperature_board", NULL, MAVLINK_TYPE_INT8_T, 0, 229, offsetof(mavlink_onboard_computer_status_t, temperature_board) }, \
66 { "temperature_core", NULL, MAVLINK_TYPE_INT8_T, 8, 230, offsetof(mavlink_onboard_computer_status_t, temperature_core) }, \
67 { "fan_speed", NULL, MAVLINK_TYPE_INT16_T, 4, 188, offsetof(mavlink_onboard_computer_status_t, fan_speed) }, \
68 { "ram_usage", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_onboard_computer_status_t, ram_usage) }, \
69 { "ram_total", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_onboard_computer_status_t, ram_total) }, \
70 { "storage_type", NULL, MAVLINK_TYPE_UINT32_T, 4, 20, offsetof(mavlink_onboard_computer_status_t, storage_type) }, \
71 { "storage_usage", NULL, MAVLINK_TYPE_UINT32_T, 4, 36, offsetof(mavlink_onboard_computer_status_t, storage_usage) }, \
72 { "storage_total", NULL, MAVLINK_TYPE_UINT32_T, 4, 52, offsetof(mavlink_onboard_computer_status_t, storage_total) }, \
73 { "link_type", NULL, MAVLINK_TYPE_UINT32_T, 6, 68, offsetof(mavlink_onboard_computer_status_t, link_type) }, \
74 { "link_tx_rate", NULL, MAVLINK_TYPE_UINT32_T, 6, 92, offsetof(mavlink_onboard_computer_status_t, link_tx_rate) }, \
75 { "link_rx_rate", NULL, MAVLINK_TYPE_UINT32_T, 6, 116, offsetof(mavlink_onboard_computer_status_t, link_rx_rate) }, \
76 { "link_tx_max", NULL, MAVLINK_TYPE_UINT32_T, 6, 140, offsetof(mavlink_onboard_computer_status_t, link_tx_max) }, \
77 { "link_rx_max", NULL, MAVLINK_TYPE_UINT32_T, 6, 164, offsetof(mavlink_onboard_computer_status_t, link_rx_max) }, \
78 } \
80 #else
81 #define MAVLINK_MESSAGE_INFO_ONBOARD_COMPUTER_STATUS { \
82 "ONBOARD_COMPUTER_STATUS", \
83 20, \
84 { { "time_usec", NULL, MAVLINK_TYPE_UINT64_T, 0, 0, offsetof(mavlink_onboard_computer_status_t, time_usec) }, \
85 { "uptime", NULL, MAVLINK_TYPE_UINT32_T, 0, 8, offsetof(mavlink_onboard_computer_status_t, uptime) }, \
86 { "type", NULL, MAVLINK_TYPE_UINT8_T, 0, 196, offsetof(mavlink_onboard_computer_status_t, type) }, \
87 { "cpu_cores", NULL, MAVLINK_TYPE_UINT8_T, 8, 197, offsetof(mavlink_onboard_computer_status_t, cpu_cores) }, \
88 { "cpu_combined", NULL, MAVLINK_TYPE_UINT8_T, 10, 205, offsetof(mavlink_onboard_computer_status_t, cpu_combined) }, \
89 { "gpu_cores", NULL, MAVLINK_TYPE_UINT8_T, 4, 215, offsetof(mavlink_onboard_computer_status_t, gpu_cores) }, \
90 { "gpu_combined", NULL, MAVLINK_TYPE_UINT8_T, 10, 219, offsetof(mavlink_onboard_computer_status_t, gpu_combined) }, \
91 { "temperature_board", NULL, MAVLINK_TYPE_INT8_T, 0, 229, offsetof(mavlink_onboard_computer_status_t, temperature_board) }, \
92 { "temperature_core", NULL, MAVLINK_TYPE_INT8_T, 8, 230, offsetof(mavlink_onboard_computer_status_t, temperature_core) }, \
93 { "fan_speed", NULL, MAVLINK_TYPE_INT16_T, 4, 188, offsetof(mavlink_onboard_computer_status_t, fan_speed) }, \
94 { "ram_usage", NULL, MAVLINK_TYPE_UINT32_T, 0, 12, offsetof(mavlink_onboard_computer_status_t, ram_usage) }, \
95 { "ram_total", NULL, MAVLINK_TYPE_UINT32_T, 0, 16, offsetof(mavlink_onboard_computer_status_t, ram_total) }, \
96 { "storage_type", NULL, MAVLINK_TYPE_UINT32_T, 4, 20, offsetof(mavlink_onboard_computer_status_t, storage_type) }, \
97 { "storage_usage", NULL, MAVLINK_TYPE_UINT32_T, 4, 36, offsetof(mavlink_onboard_computer_status_t, storage_usage) }, \
98 { "storage_total", NULL, MAVLINK_TYPE_UINT32_T, 4, 52, offsetof(mavlink_onboard_computer_status_t, storage_total) }, \
99 { "link_type", NULL, MAVLINK_TYPE_UINT32_T, 6, 68, offsetof(mavlink_onboard_computer_status_t, link_type) }, \
100 { "link_tx_rate", NULL, MAVLINK_TYPE_UINT32_T, 6, 92, offsetof(mavlink_onboard_computer_status_t, link_tx_rate) }, \
101 { "link_rx_rate", NULL, MAVLINK_TYPE_UINT32_T, 6, 116, offsetof(mavlink_onboard_computer_status_t, link_rx_rate) }, \
102 { "link_tx_max", NULL, MAVLINK_TYPE_UINT32_T, 6, 140, offsetof(mavlink_onboard_computer_status_t, link_tx_max) }, \
103 { "link_rx_max", NULL, MAVLINK_TYPE_UINT32_T, 6, 164, offsetof(mavlink_onboard_computer_status_t, link_rx_max) }, \
106 #endif
109 * @brief Pack a onboard_computer_status message
110 * @param system_id ID of this system
111 * @param component_id ID of this component (e.g. 200 for IMU)
112 * @param msg The MAVLink message to compress the data into
114 * @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.
115 * @param uptime [ms] Time since system boot.
116 * @param type Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers.
117 * @param cpu_cores CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
118 * @param cpu_combined Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
119 * @param gpu_cores GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
120 * @param gpu_combined Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
121 * @param temperature_board [degC] Temperature of the board. A value of INT8_MAX implies the field is unused.
122 * @param temperature_core [degC] Temperature of the CPU core. A value of INT8_MAX implies the field is unused.
123 * @param fan_speed [rpm] Fan speeds. A value of INT16_MAX implies the field is unused.
124 * @param ram_usage [MiB] Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused.
125 * @param ram_total [MiB] Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused.
126 * @param storage_type Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused.
127 * @param storage_usage [MiB] Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused.
128 * @param storage_total [MiB] Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused.
129 * @param link_type Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary
130 * @param link_tx_rate [KiB/s] Network traffic from the component system. A value of UINT32_MAX implies the field is unused.
131 * @param link_rx_rate [KiB/s] Network traffic to the component system. A value of UINT32_MAX implies the field is unused.
132 * @param link_tx_max [KiB/s] Network capacity from the component system. A value of UINT32_MAX implies the field is unused.
133 * @param link_rx_max [KiB/s] Network capacity to the component system. A value of UINT32_MAX implies the field is unused.
134 * @return length of the message in bytes (excluding serial stream start sign)
136 static inline uint16_t mavlink_msg_onboard_computer_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
137 uint64_t time_usec, uint32_t uptime, uint8_t type, const uint8_t *cpu_cores, const uint8_t *cpu_combined, const uint8_t *gpu_cores, const uint8_t *gpu_combined, int8_t temperature_board, const int8_t *temperature_core, const int16_t *fan_speed, uint32_t ram_usage, uint32_t ram_total, const uint32_t *storage_type, const uint32_t *storage_usage, const uint32_t *storage_total, const uint32_t *link_type, const uint32_t *link_tx_rate, const uint32_t *link_rx_rate, const uint32_t *link_tx_max, const uint32_t *link_rx_max)
139 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
140 char buf[MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN];
141 _mav_put_uint64_t(buf, 0, time_usec);
142 _mav_put_uint32_t(buf, 8, uptime);
143 _mav_put_uint32_t(buf, 12, ram_usage);
144 _mav_put_uint32_t(buf, 16, ram_total);
145 _mav_put_uint8_t(buf, 196, type);
146 _mav_put_int8_t(buf, 229, temperature_board);
147 _mav_put_uint32_t_array(buf, 20, storage_type, 4);
148 _mav_put_uint32_t_array(buf, 36, storage_usage, 4);
149 _mav_put_uint32_t_array(buf, 52, storage_total, 4);
150 _mav_put_uint32_t_array(buf, 68, link_type, 6);
151 _mav_put_uint32_t_array(buf, 92, link_tx_rate, 6);
152 _mav_put_uint32_t_array(buf, 116, link_rx_rate, 6);
153 _mav_put_uint32_t_array(buf, 140, link_tx_max, 6);
154 _mav_put_uint32_t_array(buf, 164, link_rx_max, 6);
155 _mav_put_int16_t_array(buf, 188, fan_speed, 4);
156 _mav_put_uint8_t_array(buf, 197, cpu_cores, 8);
157 _mav_put_uint8_t_array(buf, 205, cpu_combined, 10);
158 _mav_put_uint8_t_array(buf, 215, gpu_cores, 4);
159 _mav_put_uint8_t_array(buf, 219, gpu_combined, 10);
160 _mav_put_int8_t_array(buf, 230, temperature_core, 8);
161 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN);
162 #else
163 mavlink_onboard_computer_status_t packet;
164 packet.time_usec = time_usec;
165 packet.uptime = uptime;
166 packet.ram_usage = ram_usage;
167 packet.ram_total = ram_total;
168 packet.type = type;
169 packet.temperature_board = temperature_board;
170 mav_array_memcpy(packet.storage_type, storage_type, sizeof(uint32_t)*4);
171 mav_array_memcpy(packet.storage_usage, storage_usage, sizeof(uint32_t)*4);
172 mav_array_memcpy(packet.storage_total, storage_total, sizeof(uint32_t)*4);
173 mav_array_memcpy(packet.link_type, link_type, sizeof(uint32_t)*6);
174 mav_array_memcpy(packet.link_tx_rate, link_tx_rate, sizeof(uint32_t)*6);
175 mav_array_memcpy(packet.link_rx_rate, link_rx_rate, sizeof(uint32_t)*6);
176 mav_array_memcpy(packet.link_tx_max, link_tx_max, sizeof(uint32_t)*6);
177 mav_array_memcpy(packet.link_rx_max, link_rx_max, sizeof(uint32_t)*6);
178 mav_array_memcpy(packet.fan_speed, fan_speed, sizeof(int16_t)*4);
179 mav_array_memcpy(packet.cpu_cores, cpu_cores, sizeof(uint8_t)*8);
180 mav_array_memcpy(packet.cpu_combined, cpu_combined, sizeof(uint8_t)*10);
181 mav_array_memcpy(packet.gpu_cores, gpu_cores, sizeof(uint8_t)*4);
182 mav_array_memcpy(packet.gpu_combined, gpu_combined, sizeof(uint8_t)*10);
183 mav_array_memcpy(packet.temperature_core, temperature_core, sizeof(int8_t)*8);
184 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN);
185 #endif
187 msg->msgid = MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS;
188 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC);
192 * @brief Pack a onboard_computer_status message on a channel
193 * @param system_id ID of this system
194 * @param component_id ID of this component (e.g. 200 for IMU)
195 * @param chan The MAVLink channel this message will be sent over
196 * @param msg The MAVLink message to compress the data into
197 * @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.
198 * @param uptime [ms] Time since system boot.
199 * @param type Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers.
200 * @param cpu_cores CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
201 * @param cpu_combined Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
202 * @param gpu_cores GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
203 * @param gpu_combined Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
204 * @param temperature_board [degC] Temperature of the board. A value of INT8_MAX implies the field is unused.
205 * @param temperature_core [degC] Temperature of the CPU core. A value of INT8_MAX implies the field is unused.
206 * @param fan_speed [rpm] Fan speeds. A value of INT16_MAX implies the field is unused.
207 * @param ram_usage [MiB] Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused.
208 * @param ram_total [MiB] Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused.
209 * @param storage_type Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused.
210 * @param storage_usage [MiB] Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused.
211 * @param storage_total [MiB] Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused.
212 * @param link_type Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary
213 * @param link_tx_rate [KiB/s] Network traffic from the component system. A value of UINT32_MAX implies the field is unused.
214 * @param link_rx_rate [KiB/s] Network traffic to the component system. A value of UINT32_MAX implies the field is unused.
215 * @param link_tx_max [KiB/s] Network capacity from the component system. A value of UINT32_MAX implies the field is unused.
216 * @param link_rx_max [KiB/s] Network capacity to the component system. A value of UINT32_MAX implies the field is unused.
217 * @return length of the message in bytes (excluding serial stream start sign)
219 static inline uint16_t mavlink_msg_onboard_computer_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
220 mavlink_message_t* msg,
221 uint64_t time_usec,uint32_t uptime,uint8_t type,const uint8_t *cpu_cores,const uint8_t *cpu_combined,const uint8_t *gpu_cores,const uint8_t *gpu_combined,int8_t temperature_board,const int8_t *temperature_core,const int16_t *fan_speed,uint32_t ram_usage,uint32_t ram_total,const uint32_t *storage_type,const uint32_t *storage_usage,const uint32_t *storage_total,const uint32_t *link_type,const uint32_t *link_tx_rate,const uint32_t *link_rx_rate,const uint32_t *link_tx_max,const uint32_t *link_rx_max)
223 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
224 char buf[MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN];
225 _mav_put_uint64_t(buf, 0, time_usec);
226 _mav_put_uint32_t(buf, 8, uptime);
227 _mav_put_uint32_t(buf, 12, ram_usage);
228 _mav_put_uint32_t(buf, 16, ram_total);
229 _mav_put_uint8_t(buf, 196, type);
230 _mav_put_int8_t(buf, 229, temperature_board);
231 _mav_put_uint32_t_array(buf, 20, storage_type, 4);
232 _mav_put_uint32_t_array(buf, 36, storage_usage, 4);
233 _mav_put_uint32_t_array(buf, 52, storage_total, 4);
234 _mav_put_uint32_t_array(buf, 68, link_type, 6);
235 _mav_put_uint32_t_array(buf, 92, link_tx_rate, 6);
236 _mav_put_uint32_t_array(buf, 116, link_rx_rate, 6);
237 _mav_put_uint32_t_array(buf, 140, link_tx_max, 6);
238 _mav_put_uint32_t_array(buf, 164, link_rx_max, 6);
239 _mav_put_int16_t_array(buf, 188, fan_speed, 4);
240 _mav_put_uint8_t_array(buf, 197, cpu_cores, 8);
241 _mav_put_uint8_t_array(buf, 205, cpu_combined, 10);
242 _mav_put_uint8_t_array(buf, 215, gpu_cores, 4);
243 _mav_put_uint8_t_array(buf, 219, gpu_combined, 10);
244 _mav_put_int8_t_array(buf, 230, temperature_core, 8);
245 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN);
246 #else
247 mavlink_onboard_computer_status_t packet;
248 packet.time_usec = time_usec;
249 packet.uptime = uptime;
250 packet.ram_usage = ram_usage;
251 packet.ram_total = ram_total;
252 packet.type = type;
253 packet.temperature_board = temperature_board;
254 mav_array_memcpy(packet.storage_type, storage_type, sizeof(uint32_t)*4);
255 mav_array_memcpy(packet.storage_usage, storage_usage, sizeof(uint32_t)*4);
256 mav_array_memcpy(packet.storage_total, storage_total, sizeof(uint32_t)*4);
257 mav_array_memcpy(packet.link_type, link_type, sizeof(uint32_t)*6);
258 mav_array_memcpy(packet.link_tx_rate, link_tx_rate, sizeof(uint32_t)*6);
259 mav_array_memcpy(packet.link_rx_rate, link_rx_rate, sizeof(uint32_t)*6);
260 mav_array_memcpy(packet.link_tx_max, link_tx_max, sizeof(uint32_t)*6);
261 mav_array_memcpy(packet.link_rx_max, link_rx_max, sizeof(uint32_t)*6);
262 mav_array_memcpy(packet.fan_speed, fan_speed, sizeof(int16_t)*4);
263 mav_array_memcpy(packet.cpu_cores, cpu_cores, sizeof(uint8_t)*8);
264 mav_array_memcpy(packet.cpu_combined, cpu_combined, sizeof(uint8_t)*10);
265 mav_array_memcpy(packet.gpu_cores, gpu_cores, sizeof(uint8_t)*4);
266 mav_array_memcpy(packet.gpu_combined, gpu_combined, sizeof(uint8_t)*10);
267 mav_array_memcpy(packet.temperature_core, temperature_core, sizeof(int8_t)*8);
268 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN);
269 #endif
271 msg->msgid = MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS;
272 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC);
276 * @brief Encode a onboard_computer_status struct
278 * @param system_id ID of this system
279 * @param component_id ID of this component (e.g. 200 for IMU)
280 * @param msg The MAVLink message to compress the data into
281 * @param onboard_computer_status C-struct to read the message contents from
283 static inline uint16_t mavlink_msg_onboard_computer_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_onboard_computer_status_t* onboard_computer_status)
285 return mavlink_msg_onboard_computer_status_pack(system_id, component_id, msg, onboard_computer_status->time_usec, onboard_computer_status->uptime, onboard_computer_status->type, onboard_computer_status->cpu_cores, onboard_computer_status->cpu_combined, onboard_computer_status->gpu_cores, onboard_computer_status->gpu_combined, onboard_computer_status->temperature_board, onboard_computer_status->temperature_core, onboard_computer_status->fan_speed, onboard_computer_status->ram_usage, onboard_computer_status->ram_total, onboard_computer_status->storage_type, onboard_computer_status->storage_usage, onboard_computer_status->storage_total, onboard_computer_status->link_type, onboard_computer_status->link_tx_rate, onboard_computer_status->link_rx_rate, onboard_computer_status->link_tx_max, onboard_computer_status->link_rx_max);
289 * @brief Encode a onboard_computer_status struct on a channel
291 * @param system_id ID of this system
292 * @param component_id ID of this component (e.g. 200 for IMU)
293 * @param chan The MAVLink channel this message will be sent over
294 * @param msg The MAVLink message to compress the data into
295 * @param onboard_computer_status C-struct to read the message contents from
297 static inline uint16_t mavlink_msg_onboard_computer_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_onboard_computer_status_t* onboard_computer_status)
299 return mavlink_msg_onboard_computer_status_pack_chan(system_id, component_id, chan, msg, onboard_computer_status->time_usec, onboard_computer_status->uptime, onboard_computer_status->type, onboard_computer_status->cpu_cores, onboard_computer_status->cpu_combined, onboard_computer_status->gpu_cores, onboard_computer_status->gpu_combined, onboard_computer_status->temperature_board, onboard_computer_status->temperature_core, onboard_computer_status->fan_speed, onboard_computer_status->ram_usage, onboard_computer_status->ram_total, onboard_computer_status->storage_type, onboard_computer_status->storage_usage, onboard_computer_status->storage_total, onboard_computer_status->link_type, onboard_computer_status->link_tx_rate, onboard_computer_status->link_rx_rate, onboard_computer_status->link_tx_max, onboard_computer_status->link_rx_max);
303 * @brief Send a onboard_computer_status message
304 * @param chan MAVLink channel to send the message
306 * @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.
307 * @param uptime [ms] Time since system boot.
308 * @param type Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers.
309 * @param cpu_cores CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
310 * @param cpu_combined Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
311 * @param gpu_cores GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
312 * @param gpu_combined Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
313 * @param temperature_board [degC] Temperature of the board. A value of INT8_MAX implies the field is unused.
314 * @param temperature_core [degC] Temperature of the CPU core. A value of INT8_MAX implies the field is unused.
315 * @param fan_speed [rpm] Fan speeds. A value of INT16_MAX implies the field is unused.
316 * @param ram_usage [MiB] Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused.
317 * @param ram_total [MiB] Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused.
318 * @param storage_type Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused.
319 * @param storage_usage [MiB] Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused.
320 * @param storage_total [MiB] Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused.
321 * @param link_type Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary
322 * @param link_tx_rate [KiB/s] Network traffic from the component system. A value of UINT32_MAX implies the field is unused.
323 * @param link_rx_rate [KiB/s] Network traffic to the component system. A value of UINT32_MAX implies the field is unused.
324 * @param link_tx_max [KiB/s] Network capacity from the component system. A value of UINT32_MAX implies the field is unused.
325 * @param link_rx_max [KiB/s] Network capacity to the component system. A value of UINT32_MAX implies the field is unused.
327 #ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
329 static inline void mavlink_msg_onboard_computer_status_send(mavlink_channel_t chan, uint64_t time_usec, uint32_t uptime, uint8_t type, const uint8_t *cpu_cores, const uint8_t *cpu_combined, const uint8_t *gpu_cores, const uint8_t *gpu_combined, int8_t temperature_board, const int8_t *temperature_core, const int16_t *fan_speed, uint32_t ram_usage, uint32_t ram_total, const uint32_t *storage_type, const uint32_t *storage_usage, const uint32_t *storage_total, const uint32_t *link_type, const uint32_t *link_tx_rate, const uint32_t *link_rx_rate, const uint32_t *link_tx_max, const uint32_t *link_rx_max)
331 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
332 char buf[MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN];
333 _mav_put_uint64_t(buf, 0, time_usec);
334 _mav_put_uint32_t(buf, 8, uptime);
335 _mav_put_uint32_t(buf, 12, ram_usage);
336 _mav_put_uint32_t(buf, 16, ram_total);
337 _mav_put_uint8_t(buf, 196, type);
338 _mav_put_int8_t(buf, 229, temperature_board);
339 _mav_put_uint32_t_array(buf, 20, storage_type, 4);
340 _mav_put_uint32_t_array(buf, 36, storage_usage, 4);
341 _mav_put_uint32_t_array(buf, 52, storage_total, 4);
342 _mav_put_uint32_t_array(buf, 68, link_type, 6);
343 _mav_put_uint32_t_array(buf, 92, link_tx_rate, 6);
344 _mav_put_uint32_t_array(buf, 116, link_rx_rate, 6);
345 _mav_put_uint32_t_array(buf, 140, link_tx_max, 6);
346 _mav_put_uint32_t_array(buf, 164, link_rx_max, 6);
347 _mav_put_int16_t_array(buf, 188, fan_speed, 4);
348 _mav_put_uint8_t_array(buf, 197, cpu_cores, 8);
349 _mav_put_uint8_t_array(buf, 205, cpu_combined, 10);
350 _mav_put_uint8_t_array(buf, 215, gpu_cores, 4);
351 _mav_put_uint8_t_array(buf, 219, gpu_combined, 10);
352 _mav_put_int8_t_array(buf, 230, temperature_core, 8);
353 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS, buf, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC);
354 #else
355 mavlink_onboard_computer_status_t packet;
356 packet.time_usec = time_usec;
357 packet.uptime = uptime;
358 packet.ram_usage = ram_usage;
359 packet.ram_total = ram_total;
360 packet.type = type;
361 packet.temperature_board = temperature_board;
362 mav_array_memcpy(packet.storage_type, storage_type, sizeof(uint32_t)*4);
363 mav_array_memcpy(packet.storage_usage, storage_usage, sizeof(uint32_t)*4);
364 mav_array_memcpy(packet.storage_total, storage_total, sizeof(uint32_t)*4);
365 mav_array_memcpy(packet.link_type, link_type, sizeof(uint32_t)*6);
366 mav_array_memcpy(packet.link_tx_rate, link_tx_rate, sizeof(uint32_t)*6);
367 mav_array_memcpy(packet.link_rx_rate, link_rx_rate, sizeof(uint32_t)*6);
368 mav_array_memcpy(packet.link_tx_max, link_tx_max, sizeof(uint32_t)*6);
369 mav_array_memcpy(packet.link_rx_max, link_rx_max, sizeof(uint32_t)*6);
370 mav_array_memcpy(packet.fan_speed, fan_speed, sizeof(int16_t)*4);
371 mav_array_memcpy(packet.cpu_cores, cpu_cores, sizeof(uint8_t)*8);
372 mav_array_memcpy(packet.cpu_combined, cpu_combined, sizeof(uint8_t)*10);
373 mav_array_memcpy(packet.gpu_cores, gpu_cores, sizeof(uint8_t)*4);
374 mav_array_memcpy(packet.gpu_combined, gpu_combined, sizeof(uint8_t)*10);
375 mav_array_memcpy(packet.temperature_core, temperature_core, sizeof(int8_t)*8);
376 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS, (const char *)&packet, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC);
377 #endif
381 * @brief Send a onboard_computer_status message
382 * @param chan MAVLink channel to send the message
383 * @param struct The MAVLink struct to serialize
385 static inline void mavlink_msg_onboard_computer_status_send_struct(mavlink_channel_t chan, const mavlink_onboard_computer_status_t* onboard_computer_status)
387 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
388 mavlink_msg_onboard_computer_status_send(chan, onboard_computer_status->time_usec, onboard_computer_status->uptime, onboard_computer_status->type, onboard_computer_status->cpu_cores, onboard_computer_status->cpu_combined, onboard_computer_status->gpu_cores, onboard_computer_status->gpu_combined, onboard_computer_status->temperature_board, onboard_computer_status->temperature_core, onboard_computer_status->fan_speed, onboard_computer_status->ram_usage, onboard_computer_status->ram_total, onboard_computer_status->storage_type, onboard_computer_status->storage_usage, onboard_computer_status->storage_total, onboard_computer_status->link_type, onboard_computer_status->link_tx_rate, onboard_computer_status->link_rx_rate, onboard_computer_status->link_tx_max, onboard_computer_status->link_rx_max);
389 #else
390 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS, (const char *)onboard_computer_status, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC);
391 #endif
394 #if MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
396 This varient of _send() can be used to save stack space by re-using
397 memory from the receive buffer. The caller provides a
398 mavlink_message_t which is the size of a full mavlink message. This
399 is usually the receive buffer for the channel, and allows a reply to an
400 incoming message with minimum stack space usage.
402 static inline void mavlink_msg_onboard_computer_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint64_t time_usec, uint32_t uptime, uint8_t type, const uint8_t *cpu_cores, const uint8_t *cpu_combined, const uint8_t *gpu_cores, const uint8_t *gpu_combined, int8_t temperature_board, const int8_t *temperature_core, const int16_t *fan_speed, uint32_t ram_usage, uint32_t ram_total, const uint32_t *storage_type, const uint32_t *storage_usage, const uint32_t *storage_total, const uint32_t *link_type, const uint32_t *link_tx_rate, const uint32_t *link_rx_rate, const uint32_t *link_tx_max, const uint32_t *link_rx_max)
404 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
405 char *buf = (char *)msgbuf;
406 _mav_put_uint64_t(buf, 0, time_usec);
407 _mav_put_uint32_t(buf, 8, uptime);
408 _mav_put_uint32_t(buf, 12, ram_usage);
409 _mav_put_uint32_t(buf, 16, ram_total);
410 _mav_put_uint8_t(buf, 196, type);
411 _mav_put_int8_t(buf, 229, temperature_board);
412 _mav_put_uint32_t_array(buf, 20, storage_type, 4);
413 _mav_put_uint32_t_array(buf, 36, storage_usage, 4);
414 _mav_put_uint32_t_array(buf, 52, storage_total, 4);
415 _mav_put_uint32_t_array(buf, 68, link_type, 6);
416 _mav_put_uint32_t_array(buf, 92, link_tx_rate, 6);
417 _mav_put_uint32_t_array(buf, 116, link_rx_rate, 6);
418 _mav_put_uint32_t_array(buf, 140, link_tx_max, 6);
419 _mav_put_uint32_t_array(buf, 164, link_rx_max, 6);
420 _mav_put_int16_t_array(buf, 188, fan_speed, 4);
421 _mav_put_uint8_t_array(buf, 197, cpu_cores, 8);
422 _mav_put_uint8_t_array(buf, 205, cpu_combined, 10);
423 _mav_put_uint8_t_array(buf, 215, gpu_cores, 4);
424 _mav_put_uint8_t_array(buf, 219, gpu_combined, 10);
425 _mav_put_int8_t_array(buf, 230, temperature_core, 8);
426 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS, buf, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC);
427 #else
428 mavlink_onboard_computer_status_t *packet = (mavlink_onboard_computer_status_t *)msgbuf;
429 packet->time_usec = time_usec;
430 packet->uptime = uptime;
431 packet->ram_usage = ram_usage;
432 packet->ram_total = ram_total;
433 packet->type = type;
434 packet->temperature_board = temperature_board;
435 mav_array_memcpy(packet->storage_type, storage_type, sizeof(uint32_t)*4);
436 mav_array_memcpy(packet->storage_usage, storage_usage, sizeof(uint32_t)*4);
437 mav_array_memcpy(packet->storage_total, storage_total, sizeof(uint32_t)*4);
438 mav_array_memcpy(packet->link_type, link_type, sizeof(uint32_t)*6);
439 mav_array_memcpy(packet->link_tx_rate, link_tx_rate, sizeof(uint32_t)*6);
440 mav_array_memcpy(packet->link_rx_rate, link_rx_rate, sizeof(uint32_t)*6);
441 mav_array_memcpy(packet->link_tx_max, link_tx_max, sizeof(uint32_t)*6);
442 mav_array_memcpy(packet->link_rx_max, link_rx_max, sizeof(uint32_t)*6);
443 mav_array_memcpy(packet->fan_speed, fan_speed, sizeof(int16_t)*4);
444 mav_array_memcpy(packet->cpu_cores, cpu_cores, sizeof(uint8_t)*8);
445 mav_array_memcpy(packet->cpu_combined, cpu_combined, sizeof(uint8_t)*10);
446 mav_array_memcpy(packet->gpu_cores, gpu_cores, sizeof(uint8_t)*4);
447 mav_array_memcpy(packet->gpu_combined, gpu_combined, sizeof(uint8_t)*10);
448 mav_array_memcpy(packet->temperature_core, temperature_core, sizeof(int8_t)*8);
449 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS, (const char *)packet, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_MIN_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_CRC);
450 #endif
452 #endif
454 #endif
456 // MESSAGE ONBOARD_COMPUTER_STATUS UNPACKING
460 * @brief Get field time_usec from onboard_computer_status message
462 * @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.
464 static inline uint64_t mavlink_msg_onboard_computer_status_get_time_usec(const mavlink_message_t* msg)
466 return _MAV_RETURN_uint64_t(msg, 0);
470 * @brief Get field uptime from onboard_computer_status message
472 * @return [ms] Time since system boot.
474 static inline uint32_t mavlink_msg_onboard_computer_status_get_uptime(const mavlink_message_t* msg)
476 return _MAV_RETURN_uint32_t(msg, 8);
480 * @brief Get field type from onboard_computer_status message
482 * @return Type of the onboard computer: 0: Mission computer primary, 1: Mission computer backup 1, 2: Mission computer backup 2, 3: Compute node, 4-5: Compute spares, 6-9: Payload computers.
484 static inline uint8_t mavlink_msg_onboard_computer_status_get_type(const mavlink_message_t* msg)
486 return _MAV_RETURN_uint8_t(msg, 196);
490 * @brief Get field cpu_cores from onboard_computer_status message
492 * @return CPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
494 static inline uint16_t mavlink_msg_onboard_computer_status_get_cpu_cores(const mavlink_message_t* msg, uint8_t *cpu_cores)
496 return _MAV_RETURN_uint8_t_array(msg, cpu_cores, 8, 197);
500 * @brief Get field cpu_combined from onboard_computer_status message
502 * @return Combined CPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
504 static inline uint16_t mavlink_msg_onboard_computer_status_get_cpu_combined(const mavlink_message_t* msg, uint8_t *cpu_combined)
506 return _MAV_RETURN_uint8_t_array(msg, cpu_combined, 10, 205);
510 * @brief Get field gpu_cores from onboard_computer_status message
512 * @return GPU usage on the component in percent (100 - idle). A value of UINT8_MAX implies the field is unused.
514 static inline uint16_t mavlink_msg_onboard_computer_status_get_gpu_cores(const mavlink_message_t* msg, uint8_t *gpu_cores)
516 return _MAV_RETURN_uint8_t_array(msg, gpu_cores, 4, 215);
520 * @brief Get field gpu_combined from onboard_computer_status message
522 * @return Combined GPU usage as the last 10 slices of 100 MS (a histogram). This allows to identify spikes in load that max out the system, but only for a short amount of time. A value of UINT8_MAX implies the field is unused.
524 static inline uint16_t mavlink_msg_onboard_computer_status_get_gpu_combined(const mavlink_message_t* msg, uint8_t *gpu_combined)
526 return _MAV_RETURN_uint8_t_array(msg, gpu_combined, 10, 219);
530 * @brief Get field temperature_board from onboard_computer_status message
532 * @return [degC] Temperature of the board. A value of INT8_MAX implies the field is unused.
534 static inline int8_t mavlink_msg_onboard_computer_status_get_temperature_board(const mavlink_message_t* msg)
536 return _MAV_RETURN_int8_t(msg, 229);
540 * @brief Get field temperature_core from onboard_computer_status message
542 * @return [degC] Temperature of the CPU core. A value of INT8_MAX implies the field is unused.
544 static inline uint16_t mavlink_msg_onboard_computer_status_get_temperature_core(const mavlink_message_t* msg, int8_t *temperature_core)
546 return _MAV_RETURN_int8_t_array(msg, temperature_core, 8, 230);
550 * @brief Get field fan_speed from onboard_computer_status message
552 * @return [rpm] Fan speeds. A value of INT16_MAX implies the field is unused.
554 static inline uint16_t mavlink_msg_onboard_computer_status_get_fan_speed(const mavlink_message_t* msg, int16_t *fan_speed)
556 return _MAV_RETURN_int16_t_array(msg, fan_speed, 4, 188);
560 * @brief Get field ram_usage from onboard_computer_status message
562 * @return [MiB] Amount of used RAM on the component system. A value of UINT32_MAX implies the field is unused.
564 static inline uint32_t mavlink_msg_onboard_computer_status_get_ram_usage(const mavlink_message_t* msg)
566 return _MAV_RETURN_uint32_t(msg, 12);
570 * @brief Get field ram_total from onboard_computer_status message
572 * @return [MiB] Total amount of RAM on the component system. A value of UINT32_MAX implies the field is unused.
574 static inline uint32_t mavlink_msg_onboard_computer_status_get_ram_total(const mavlink_message_t* msg)
576 return _MAV_RETURN_uint32_t(msg, 16);
580 * @brief Get field storage_type from onboard_computer_status message
582 * @return Storage type: 0: HDD, 1: SSD, 2: EMMC, 3: SD card (non-removable), 4: SD card (removable). A value of UINT32_MAX implies the field is unused.
584 static inline uint16_t mavlink_msg_onboard_computer_status_get_storage_type(const mavlink_message_t* msg, uint32_t *storage_type)
586 return _MAV_RETURN_uint32_t_array(msg, storage_type, 4, 20);
590 * @brief Get field storage_usage from onboard_computer_status message
592 * @return [MiB] Amount of used storage space on the component system. A value of UINT32_MAX implies the field is unused.
594 static inline uint16_t mavlink_msg_onboard_computer_status_get_storage_usage(const mavlink_message_t* msg, uint32_t *storage_usage)
596 return _MAV_RETURN_uint32_t_array(msg, storage_usage, 4, 36);
600 * @brief Get field storage_total from onboard_computer_status message
602 * @return [MiB] Total amount of storage space on the component system. A value of UINT32_MAX implies the field is unused.
604 static inline uint16_t mavlink_msg_onboard_computer_status_get_storage_total(const mavlink_message_t* msg, uint32_t *storage_total)
606 return _MAV_RETURN_uint32_t_array(msg, storage_total, 4, 52);
610 * @brief Get field link_type from onboard_computer_status message
612 * @return Link type: 0-9: UART, 10-19: Wired network, 20-29: Wifi, 30-39: Point-to-point proprietary, 40-49: Mesh proprietary
614 static inline uint16_t mavlink_msg_onboard_computer_status_get_link_type(const mavlink_message_t* msg, uint32_t *link_type)
616 return _MAV_RETURN_uint32_t_array(msg, link_type, 6, 68);
620 * @brief Get field link_tx_rate from onboard_computer_status message
622 * @return [KiB/s] Network traffic from the component system. A value of UINT32_MAX implies the field is unused.
624 static inline uint16_t mavlink_msg_onboard_computer_status_get_link_tx_rate(const mavlink_message_t* msg, uint32_t *link_tx_rate)
626 return _MAV_RETURN_uint32_t_array(msg, link_tx_rate, 6, 92);
630 * @brief Get field link_rx_rate from onboard_computer_status message
632 * @return [KiB/s] Network traffic to the component system. A value of UINT32_MAX implies the field is unused.
634 static inline uint16_t mavlink_msg_onboard_computer_status_get_link_rx_rate(const mavlink_message_t* msg, uint32_t *link_rx_rate)
636 return _MAV_RETURN_uint32_t_array(msg, link_rx_rate, 6, 116);
640 * @brief Get field link_tx_max from onboard_computer_status message
642 * @return [KiB/s] Network capacity from the component system. A value of UINT32_MAX implies the field is unused.
644 static inline uint16_t mavlink_msg_onboard_computer_status_get_link_tx_max(const mavlink_message_t* msg, uint32_t *link_tx_max)
646 return _MAV_RETURN_uint32_t_array(msg, link_tx_max, 6, 140);
650 * @brief Get field link_rx_max from onboard_computer_status message
652 * @return [KiB/s] Network capacity to the component system. A value of UINT32_MAX implies the field is unused.
654 static inline uint16_t mavlink_msg_onboard_computer_status_get_link_rx_max(const mavlink_message_t* msg, uint32_t *link_rx_max)
656 return _MAV_RETURN_uint32_t_array(msg, link_rx_max, 6, 164);
660 * @brief Decode a onboard_computer_status message into a struct
662 * @param msg The message to decode
663 * @param onboard_computer_status C-struct to decode the message contents into
665 static inline void mavlink_msg_onboard_computer_status_decode(const mavlink_message_t* msg, mavlink_onboard_computer_status_t* onboard_computer_status)
667 #if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
668 onboard_computer_status->time_usec = mavlink_msg_onboard_computer_status_get_time_usec(msg);
669 onboard_computer_status->uptime = mavlink_msg_onboard_computer_status_get_uptime(msg);
670 onboard_computer_status->ram_usage = mavlink_msg_onboard_computer_status_get_ram_usage(msg);
671 onboard_computer_status->ram_total = mavlink_msg_onboard_computer_status_get_ram_total(msg);
672 mavlink_msg_onboard_computer_status_get_storage_type(msg, onboard_computer_status->storage_type);
673 mavlink_msg_onboard_computer_status_get_storage_usage(msg, onboard_computer_status->storage_usage);
674 mavlink_msg_onboard_computer_status_get_storage_total(msg, onboard_computer_status->storage_total);
675 mavlink_msg_onboard_computer_status_get_link_type(msg, onboard_computer_status->link_type);
676 mavlink_msg_onboard_computer_status_get_link_tx_rate(msg, onboard_computer_status->link_tx_rate);
677 mavlink_msg_onboard_computer_status_get_link_rx_rate(msg, onboard_computer_status->link_rx_rate);
678 mavlink_msg_onboard_computer_status_get_link_tx_max(msg, onboard_computer_status->link_tx_max);
679 mavlink_msg_onboard_computer_status_get_link_rx_max(msg, onboard_computer_status->link_rx_max);
680 mavlink_msg_onboard_computer_status_get_fan_speed(msg, onboard_computer_status->fan_speed);
681 onboard_computer_status->type = mavlink_msg_onboard_computer_status_get_type(msg);
682 mavlink_msg_onboard_computer_status_get_cpu_cores(msg, onboard_computer_status->cpu_cores);
683 mavlink_msg_onboard_computer_status_get_cpu_combined(msg, onboard_computer_status->cpu_combined);
684 mavlink_msg_onboard_computer_status_get_gpu_cores(msg, onboard_computer_status->gpu_cores);
685 mavlink_msg_onboard_computer_status_get_gpu_combined(msg, onboard_computer_status->gpu_combined);
686 onboard_computer_status->temperature_board = mavlink_msg_onboard_computer_status_get_temperature_board(msg);
687 mavlink_msg_onboard_computer_status_get_temperature_core(msg, onboard_computer_status->temperature_core);
688 #else
689 uint8_t len = msg->len < MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN? msg->len : MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN;
690 memset(onboard_computer_status, 0, MAVLINK_MSG_ID_ONBOARD_COMPUTER_STATUS_LEN);
691 memcpy(onboard_computer_status, _MAV_PAYLOAD(msg), len);
692 #endif