Arduino Mavlink
Loading...
Searching...
No Matches
mavlink_msg_efi_status.h
Go to the documentation of this file.
1#pragma once
2// MESSAGE EFI_STATUS PACKING
3
4#define MAVLINK_MSG_ID_EFI_STATUS 225
5
6MAVPACKED(
7typedef struct __mavlink_efi_status_t {
8 float ecu_index; /*< ECU index*/
9 float rpm; /*< RPM*/
10 float fuel_consumed; /*< [cm^3] Fuel consumed*/
11 float fuel_flow; /*< [cm^3/min] Fuel flow rate*/
12 float engine_load; /*< [%] Engine load*/
13 float throttle_position; /*< [%] Throttle position*/
14 float spark_dwell_time; /*< [ms] Spark dwell time*/
15 float barometric_pressure; /*< [kPa] Barometric pressure*/
16 float intake_manifold_pressure; /*< [kPa] Intake manifold pressure(*/
17 float intake_manifold_temperature; /*< [degC] Intake manifold temperature*/
18 float cylinder_head_temperature; /*< [degC] Cylinder head temperature*/
19 float ignition_timing; /*< [deg] Ignition timing (Crank angle degrees)*/
20 float injection_time; /*< [ms] Injection time*/
21 float exhaust_gas_temperature; /*< [degC] Exhaust gas temperature*/
22 float throttle_out; /*< [%] Output throttle*/
23 float pt_compensation; /*< Pressure/temperature compensation*/
24 uint8_t health; /*< EFI health status*/
25 float ignition_voltage; /*< [V] Supply voltage to EFI sparking system. Zero in this value means "unknown", so if the supply voltage really is zero volts use 0.0001 instead.*/
26 float fuel_pressure; /*< [kPa] Fuel pressure. Zero in this value means "unknown", so if the fuel pressure really is zero kPa use 0.0001 instead.*/
27}) mavlink_efi_status_t;
28
29#define MAVLINK_MSG_ID_EFI_STATUS_LEN 73
30#define MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN 65
31#define MAVLINK_MSG_ID_225_LEN 73
32#define MAVLINK_MSG_ID_225_MIN_LEN 65
33
34#define MAVLINK_MSG_ID_EFI_STATUS_CRC 208
35#define MAVLINK_MSG_ID_225_CRC 208
36
37
38
39#if MAVLINK_COMMAND_24BIT
40#define MAVLINK_MESSAGE_INFO_EFI_STATUS {
41 225,
42 "EFI_STATUS",
43 19,
44 { { "health", NULL, MAVLINK_TYPE_UINT8_T, 0, 64, offsetof(mavlink_efi_status_t, health) },
45 { "ecu_index", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_efi_status_t, ecu_index) },
46 { "rpm", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_efi_status_t, rpm) },
47 { "fuel_consumed", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_efi_status_t, fuel_consumed) },
48 { "fuel_flow", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_efi_status_t, fuel_flow) },
49 { "engine_load", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_efi_status_t, engine_load) },
50 { "throttle_position", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_efi_status_t, throttle_position) },
51 { "spark_dwell_time", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_efi_status_t, spark_dwell_time) },
52 { "barometric_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_efi_status_t, barometric_pressure) },
53 { "intake_manifold_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_efi_status_t, intake_manifold_pressure) },
54 { "intake_manifold_temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_efi_status_t, intake_manifold_temperature) },
55 { "cylinder_head_temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_efi_status_t, cylinder_head_temperature) },
56 { "ignition_timing", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_efi_status_t, ignition_timing) },
57 { "injection_time", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_efi_status_t, injection_time) },
58 { "exhaust_gas_temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_efi_status_t, exhaust_gas_temperature) },
59 { "throttle_out", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_efi_status_t, throttle_out) },
60 { "pt_compensation", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_efi_status_t, pt_compensation) },
61 { "ignition_voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 65, offsetof(mavlink_efi_status_t, ignition_voltage) },
62 { "fuel_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 69, offsetof(mavlink_efi_status_t, fuel_pressure) },
63 } \
64}
65#else
66#define MAVLINK_MESSAGE_INFO_EFI_STATUS {
67 "EFI_STATUS",
68 19,
69 { { "health", NULL, MAVLINK_TYPE_UINT8_T, 0, 64, offsetof(mavlink_efi_status_t, health) },
70 { "ecu_index", NULL, MAVLINK_TYPE_FLOAT, 0, 0, offsetof(mavlink_efi_status_t, ecu_index) },
71 { "rpm", NULL, MAVLINK_TYPE_FLOAT, 0, 4, offsetof(mavlink_efi_status_t, rpm) },
72 { "fuel_consumed", NULL, MAVLINK_TYPE_FLOAT, 0, 8, offsetof(mavlink_efi_status_t, fuel_consumed) },
73 { "fuel_flow", NULL, MAVLINK_TYPE_FLOAT, 0, 12, offsetof(mavlink_efi_status_t, fuel_flow) },
74 { "engine_load", NULL, MAVLINK_TYPE_FLOAT, 0, 16, offsetof(mavlink_efi_status_t, engine_load) },
75 { "throttle_position", NULL, MAVLINK_TYPE_FLOAT, 0, 20, offsetof(mavlink_efi_status_t, throttle_position) },
76 { "spark_dwell_time", NULL, MAVLINK_TYPE_FLOAT, 0, 24, offsetof(mavlink_efi_status_t, spark_dwell_time) },
77 { "barometric_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_efi_status_t, barometric_pressure) },
78 { "intake_manifold_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_efi_status_t, intake_manifold_pressure) },
79 { "intake_manifold_temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_efi_status_t, intake_manifold_temperature) },
80 { "cylinder_head_temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_efi_status_t, cylinder_head_temperature) },
81 { "ignition_timing", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_efi_status_t, ignition_timing) },
82 { "injection_time", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_efi_status_t, injection_time) },
83 { "exhaust_gas_temperature", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_efi_status_t, exhaust_gas_temperature) },
84 { "throttle_out", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_efi_status_t, throttle_out) },
85 { "pt_compensation", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_efi_status_t, pt_compensation) },
86 { "ignition_voltage", NULL, MAVLINK_TYPE_FLOAT, 0, 65, offsetof(mavlink_efi_status_t, ignition_voltage) },
87 { "fuel_pressure", NULL, MAVLINK_TYPE_FLOAT, 0, 69, offsetof(mavlink_efi_status_t, fuel_pressure) },
88 } \
89}
90#endif
91
92/**
93 * @brief Pack a efi_status message
94 * @param system_id ID of this system
95 * @param component_id ID of this component (e.g. 200 for IMU)
96 * @param msg The MAVLink message to compress the data into
97 *
98 * @param health EFI health status
99 * @param ecu_index ECU index
100 * @param rpm RPM
101 * @param fuel_consumed [cm^3] Fuel consumed
102 * @param fuel_flow [cm^3/min] Fuel flow rate
103 * @param engine_load [%] Engine load
104 * @param throttle_position [%] Throttle position
105 * @param spark_dwell_time [ms] Spark dwell time
106 * @param barometric_pressure [kPa] Barometric pressure
107 * @param intake_manifold_pressure [kPa] Intake manifold pressure(
108 * @param intake_manifold_temperature [degC] Intake manifold temperature
109 * @param cylinder_head_temperature [degC] Cylinder head temperature
110 * @param ignition_timing [deg] Ignition timing (Crank angle degrees)
111 * @param injection_time [ms] Injection time
112 * @param exhaust_gas_temperature [degC] Exhaust gas temperature
113 * @param throttle_out [%] Output throttle
114 * @param pt_compensation Pressure/temperature compensation
115 * @param ignition_voltage [V] Supply voltage to EFI sparking system. Zero in this value means "unknown", so if the supply voltage really is zero volts use 0.0001 instead.
116 * @param fuel_pressure [kPa] Fuel pressure. Zero in this value means "unknown", so if the fuel pressure really is zero kPa use 0.0001 instead.
117 * @return length of the message in bytes (excluding serial stream start sign)
118 */
119static inline uint16_t mavlink_msg_efi_status_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
120 uint8_t health, float ecu_index, float rpm, float fuel_consumed, float fuel_flow, float engine_load, float throttle_position, float spark_dwell_time, float barometric_pressure, float intake_manifold_pressure, float intake_manifold_temperature, float cylinder_head_temperature, float ignition_timing, float injection_time, float exhaust_gas_temperature, float throttle_out, float pt_compensation, float ignition_voltage, float fuel_pressure)
121{
122#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
124 _mav_put_float(buf, 0, ecu_index);
125 _mav_put_float(buf, 4, rpm);
126 _mav_put_float(buf, 8, fuel_consumed);
127 _mav_put_float(buf, 12, fuel_flow);
128 _mav_put_float(buf, 16, engine_load);
129 _mav_put_float(buf, 20, throttle_position);
130 _mav_put_float(buf, 24, spark_dwell_time);
131 _mav_put_float(buf, 28, barometric_pressure);
132 _mav_put_float(buf, 32, intake_manifold_pressure);
133 _mav_put_float(buf, 36, intake_manifold_temperature);
134 _mav_put_float(buf, 40, cylinder_head_temperature);
135 _mav_put_float(buf, 44, ignition_timing);
136 _mav_put_float(buf, 48, injection_time);
137 _mav_put_float(buf, 52, exhaust_gas_temperature);
138 _mav_put_float(buf, 56, throttle_out);
139 _mav_put_float(buf, 60, pt_compensation);
140 _mav_put_uint8_t(buf, 64, health);
141 _mav_put_float(buf, 65, ignition_voltage);
142 _mav_put_float(buf, 69, fuel_pressure);
143
144 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EFI_STATUS_LEN);
145#else
146 mavlink_efi_status_t packet;
147 packet.ecu_index = ecu_index;
148 packet.rpm = rpm;
149 packet.fuel_consumed = fuel_consumed;
150 packet.fuel_flow = fuel_flow;
151 packet.engine_load = engine_load;
152 packet.throttle_position = throttle_position;
153 packet.spark_dwell_time = spark_dwell_time;
154 packet.barometric_pressure = barometric_pressure;
155 packet.intake_manifold_pressure = intake_manifold_pressure;
156 packet.intake_manifold_temperature = intake_manifold_temperature;
157 packet.cylinder_head_temperature = cylinder_head_temperature;
158 packet.ignition_timing = ignition_timing;
159 packet.injection_time = injection_time;
160 packet.exhaust_gas_temperature = exhaust_gas_temperature;
161 packet.throttle_out = throttle_out;
162 packet.pt_compensation = pt_compensation;
163 packet.health = health;
164 packet.ignition_voltage = ignition_voltage;
165 packet.fuel_pressure = fuel_pressure;
166
167 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EFI_STATUS_LEN);
168#endif
169
170 msg->msgid = MAVLINK_MSG_ID_EFI_STATUS;
171 return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
172}
173
174/**
175 * @brief Pack a efi_status message
176 * @param system_id ID of this system
177 * @param component_id ID of this component (e.g. 200 for IMU)
178 * @param status MAVLink status structure
179 * @param msg The MAVLink message to compress the data into
180 *
181 * @param health EFI health status
182 * @param ecu_index ECU index
183 * @param rpm RPM
184 * @param fuel_consumed [cm^3] Fuel consumed
185 * @param fuel_flow [cm^3/min] Fuel flow rate
186 * @param engine_load [%] Engine load
187 * @param throttle_position [%] Throttle position
188 * @param spark_dwell_time [ms] Spark dwell time
189 * @param barometric_pressure [kPa] Barometric pressure
190 * @param intake_manifold_pressure [kPa] Intake manifold pressure(
191 * @param intake_manifold_temperature [degC] Intake manifold temperature
192 * @param cylinder_head_temperature [degC] Cylinder head temperature
193 * @param ignition_timing [deg] Ignition timing (Crank angle degrees)
194 * @param injection_time [ms] Injection time
195 * @param exhaust_gas_temperature [degC] Exhaust gas temperature
196 * @param throttle_out [%] Output throttle
197 * @param pt_compensation Pressure/temperature compensation
198 * @param ignition_voltage [V] Supply voltage to EFI sparking system. Zero in this value means "unknown", so if the supply voltage really is zero volts use 0.0001 instead.
199 * @param fuel_pressure [kPa] Fuel pressure. Zero in this value means "unknown", so if the fuel pressure really is zero kPa use 0.0001 instead.
200 * @return length of the message in bytes (excluding serial stream start sign)
201 */
202static inline uint16_t mavlink_msg_efi_status_pack_status(uint8_t system_id, uint8_t component_id, mavlink_status_t *_status, mavlink_message_t* msg,
203 uint8_t health, float ecu_index, float rpm, float fuel_consumed, float fuel_flow, float engine_load, float throttle_position, float spark_dwell_time, float barometric_pressure, float intake_manifold_pressure, float intake_manifold_temperature, float cylinder_head_temperature, float ignition_timing, float injection_time, float exhaust_gas_temperature, float throttle_out, float pt_compensation, float ignition_voltage, float fuel_pressure)
204{
205#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
207 _mav_put_float(buf, 0, ecu_index);
208 _mav_put_float(buf, 4, rpm);
209 _mav_put_float(buf, 8, fuel_consumed);
210 _mav_put_float(buf, 12, fuel_flow);
211 _mav_put_float(buf, 16, engine_load);
212 _mav_put_float(buf, 20, throttle_position);
213 _mav_put_float(buf, 24, spark_dwell_time);
214 _mav_put_float(buf, 28, barometric_pressure);
215 _mav_put_float(buf, 32, intake_manifold_pressure);
216 _mav_put_float(buf, 36, intake_manifold_temperature);
217 _mav_put_float(buf, 40, cylinder_head_temperature);
218 _mav_put_float(buf, 44, ignition_timing);
219 _mav_put_float(buf, 48, injection_time);
220 _mav_put_float(buf, 52, exhaust_gas_temperature);
221 _mav_put_float(buf, 56, throttle_out);
222 _mav_put_float(buf, 60, pt_compensation);
223 _mav_put_uint8_t(buf, 64, health);
224 _mav_put_float(buf, 65, ignition_voltage);
225 _mav_put_float(buf, 69, fuel_pressure);
226
227 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EFI_STATUS_LEN);
228#else
229 mavlink_efi_status_t packet;
230 packet.ecu_index = ecu_index;
231 packet.rpm = rpm;
232 packet.fuel_consumed = fuel_consumed;
233 packet.fuel_flow = fuel_flow;
234 packet.engine_load = engine_load;
235 packet.throttle_position = throttle_position;
236 packet.spark_dwell_time = spark_dwell_time;
237 packet.barometric_pressure = barometric_pressure;
238 packet.intake_manifold_pressure = intake_manifold_pressure;
239 packet.intake_manifold_temperature = intake_manifold_temperature;
240 packet.cylinder_head_temperature = cylinder_head_temperature;
241 packet.ignition_timing = ignition_timing;
242 packet.injection_time = injection_time;
243 packet.exhaust_gas_temperature = exhaust_gas_temperature;
244 packet.throttle_out = throttle_out;
245 packet.pt_compensation = pt_compensation;
246 packet.health = health;
247 packet.ignition_voltage = ignition_voltage;
248 packet.fuel_pressure = fuel_pressure;
249
250 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EFI_STATUS_LEN);
251#endif
252
253 msg->msgid = MAVLINK_MSG_ID_EFI_STATUS;
254#if MAVLINK_CRC_EXTRA
255 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
256#else
257 return mavlink_finalize_message_buffer(msg, system_id, component_id, _status, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN);
258#endif
259}
260
261/**
262 * @brief Pack a efi_status message on a channel
263 * @param system_id ID of this system
264 * @param component_id ID of this component (e.g. 200 for IMU)
265 * @param chan The MAVLink channel this message will be sent over
266 * @param msg The MAVLink message to compress the data into
267 * @param health EFI health status
268 * @param ecu_index ECU index
269 * @param rpm RPM
270 * @param fuel_consumed [cm^3] Fuel consumed
271 * @param fuel_flow [cm^3/min] Fuel flow rate
272 * @param engine_load [%] Engine load
273 * @param throttle_position [%] Throttle position
274 * @param spark_dwell_time [ms] Spark dwell time
275 * @param barometric_pressure [kPa] Barometric pressure
276 * @param intake_manifold_pressure [kPa] Intake manifold pressure(
277 * @param intake_manifold_temperature [degC] Intake manifold temperature
278 * @param cylinder_head_temperature [degC] Cylinder head temperature
279 * @param ignition_timing [deg] Ignition timing (Crank angle degrees)
280 * @param injection_time [ms] Injection time
281 * @param exhaust_gas_temperature [degC] Exhaust gas temperature
282 * @param throttle_out [%] Output throttle
283 * @param pt_compensation Pressure/temperature compensation
284 * @param ignition_voltage [V] Supply voltage to EFI sparking system. Zero in this value means "unknown", so if the supply voltage really is zero volts use 0.0001 instead.
285 * @param fuel_pressure [kPa] Fuel pressure. Zero in this value means "unknown", so if the fuel pressure really is zero kPa use 0.0001 instead.
286 * @return length of the message in bytes (excluding serial stream start sign)
287 */
288static inline uint16_t mavlink_msg_efi_status_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
289 mavlink_message_t* msg,
290 uint8_t health,float ecu_index,float rpm,float fuel_consumed,float fuel_flow,float engine_load,float throttle_position,float spark_dwell_time,float barometric_pressure,float intake_manifold_pressure,float intake_manifold_temperature,float cylinder_head_temperature,float ignition_timing,float injection_time,float exhaust_gas_temperature,float throttle_out,float pt_compensation,float ignition_voltage,float fuel_pressure)
291{
292#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
294 _mav_put_float(buf, 0, ecu_index);
295 _mav_put_float(buf, 4, rpm);
296 _mav_put_float(buf, 8, fuel_consumed);
297 _mav_put_float(buf, 12, fuel_flow);
298 _mav_put_float(buf, 16, engine_load);
299 _mav_put_float(buf, 20, throttle_position);
300 _mav_put_float(buf, 24, spark_dwell_time);
301 _mav_put_float(buf, 28, barometric_pressure);
302 _mav_put_float(buf, 32, intake_manifold_pressure);
303 _mav_put_float(buf, 36, intake_manifold_temperature);
304 _mav_put_float(buf, 40, cylinder_head_temperature);
305 _mav_put_float(buf, 44, ignition_timing);
306 _mav_put_float(buf, 48, injection_time);
307 _mav_put_float(buf, 52, exhaust_gas_temperature);
308 _mav_put_float(buf, 56, throttle_out);
309 _mav_put_float(buf, 60, pt_compensation);
310 _mav_put_uint8_t(buf, 64, health);
311 _mav_put_float(buf, 65, ignition_voltage);
312 _mav_put_float(buf, 69, fuel_pressure);
313
314 memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_EFI_STATUS_LEN);
315#else
316 mavlink_efi_status_t packet;
317 packet.ecu_index = ecu_index;
318 packet.rpm = rpm;
319 packet.fuel_consumed = fuel_consumed;
320 packet.fuel_flow = fuel_flow;
321 packet.engine_load = engine_load;
322 packet.throttle_position = throttle_position;
323 packet.spark_dwell_time = spark_dwell_time;
324 packet.barometric_pressure = barometric_pressure;
325 packet.intake_manifold_pressure = intake_manifold_pressure;
326 packet.intake_manifold_temperature = intake_manifold_temperature;
327 packet.cylinder_head_temperature = cylinder_head_temperature;
328 packet.ignition_timing = ignition_timing;
329 packet.injection_time = injection_time;
330 packet.exhaust_gas_temperature = exhaust_gas_temperature;
331 packet.throttle_out = throttle_out;
332 packet.pt_compensation = pt_compensation;
333 packet.health = health;
334 packet.ignition_voltage = ignition_voltage;
335 packet.fuel_pressure = fuel_pressure;
336
337 memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_EFI_STATUS_LEN);
338#endif
339
340 msg->msgid = MAVLINK_MSG_ID_EFI_STATUS;
341 return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
342}
343
344/**
345 * @brief Encode a efi_status struct
346 *
347 * @param system_id ID of this system
348 * @param component_id ID of this component (e.g. 200 for IMU)
349 * @param msg The MAVLink message to compress the data into
350 * @param efi_status C-struct to read the message contents from
351 */
352static inline uint16_t mavlink_msg_efi_status_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_efi_status_t* efi_status)
353{
354 return mavlink_msg_efi_status_pack(system_id, component_id, msg, efi_status->health, efi_status->ecu_index, efi_status->rpm, efi_status->fuel_consumed, efi_status->fuel_flow, efi_status->engine_load, efi_status->throttle_position, efi_status->spark_dwell_time, efi_status->barometric_pressure, efi_status->intake_manifold_pressure, efi_status->intake_manifold_temperature, efi_status->cylinder_head_temperature, efi_status->ignition_timing, efi_status->injection_time, efi_status->exhaust_gas_temperature, efi_status->throttle_out, efi_status->pt_compensation, efi_status->ignition_voltage, efi_status->fuel_pressure);
355}
356
357/**
358 * @brief Encode a efi_status struct on a channel
359 *
360 * @param system_id ID of this system
361 * @param component_id ID of this component (e.g. 200 for IMU)
362 * @param chan The MAVLink channel this message will be sent over
363 * @param msg The MAVLink message to compress the data into
364 * @param efi_status C-struct to read the message contents from
365 */
366static inline uint16_t mavlink_msg_efi_status_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_efi_status_t* efi_status)
367{
368 return mavlink_msg_efi_status_pack_chan(system_id, component_id, chan, msg, efi_status->health, efi_status->ecu_index, efi_status->rpm, efi_status->fuel_consumed, efi_status->fuel_flow, efi_status->engine_load, efi_status->throttle_position, efi_status->spark_dwell_time, efi_status->barometric_pressure, efi_status->intake_manifold_pressure, efi_status->intake_manifold_temperature, efi_status->cylinder_head_temperature, efi_status->ignition_timing, efi_status->injection_time, efi_status->exhaust_gas_temperature, efi_status->throttle_out, efi_status->pt_compensation, efi_status->ignition_voltage, efi_status->fuel_pressure);
369}
370
371/**
372 * @brief Encode a efi_status struct with provided status structure
373 *
374 * @param system_id ID of this system
375 * @param component_id ID of this component (e.g. 200 for IMU)
376 * @param status MAVLink status structure
377 * @param msg The MAVLink message to compress the data into
378 * @param efi_status C-struct to read the message contents from
379 */
380static inline uint16_t mavlink_msg_efi_status_encode_status(uint8_t system_id, uint8_t component_id, mavlink_status_t* _status, mavlink_message_t* msg, const mavlink_efi_status_t* efi_status)
381{
382 return mavlink_msg_efi_status_pack_status(system_id, component_id, _status, msg, efi_status->health, efi_status->ecu_index, efi_status->rpm, efi_status->fuel_consumed, efi_status->fuel_flow, efi_status->engine_load, efi_status->throttle_position, efi_status->spark_dwell_time, efi_status->barometric_pressure, efi_status->intake_manifold_pressure, efi_status->intake_manifold_temperature, efi_status->cylinder_head_temperature, efi_status->ignition_timing, efi_status->injection_time, efi_status->exhaust_gas_temperature, efi_status->throttle_out, efi_status->pt_compensation, efi_status->ignition_voltage, efi_status->fuel_pressure);
383}
384
385/**
386 * @brief Send a efi_status message
387 * @param chan MAVLink channel to send the message
388 *
389 * @param health EFI health status
390 * @param ecu_index ECU index
391 * @param rpm RPM
392 * @param fuel_consumed [cm^3] Fuel consumed
393 * @param fuel_flow [cm^3/min] Fuel flow rate
394 * @param engine_load [%] Engine load
395 * @param throttle_position [%] Throttle position
396 * @param spark_dwell_time [ms] Spark dwell time
397 * @param barometric_pressure [kPa] Barometric pressure
398 * @param intake_manifold_pressure [kPa] Intake manifold pressure(
399 * @param intake_manifold_temperature [degC] Intake manifold temperature
400 * @param cylinder_head_temperature [degC] Cylinder head temperature
401 * @param ignition_timing [deg] Ignition timing (Crank angle degrees)
402 * @param injection_time [ms] Injection time
403 * @param exhaust_gas_temperature [degC] Exhaust gas temperature
404 * @param throttle_out [%] Output throttle
405 * @param pt_compensation Pressure/temperature compensation
406 * @param ignition_voltage [V] Supply voltage to EFI sparking system. Zero in this value means "unknown", so if the supply voltage really is zero volts use 0.0001 instead.
407 * @param fuel_pressure [kPa] Fuel pressure. Zero in this value means "unknown", so if the fuel pressure really is zero kPa use 0.0001 instead.
408 */
409#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS
410
411static inline void mavlink_msg_efi_status_send(mavlink_channel_t chan, uint8_t health, float ecu_index, float rpm, float fuel_consumed, float fuel_flow, float engine_load, float throttle_position, float spark_dwell_time, float barometric_pressure, float intake_manifold_pressure, float intake_manifold_temperature, float cylinder_head_temperature, float ignition_timing, float injection_time, float exhaust_gas_temperature, float throttle_out, float pt_compensation, float ignition_voltage, float fuel_pressure)
412{
413#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
414 char buf[MAVLINK_MSG_ID_EFI_STATUS_LEN];
415 _mav_put_float(buf, 0, ecu_index);
416 _mav_put_float(buf, 4, rpm);
417 _mav_put_float(buf, 8, fuel_consumed);
418 _mav_put_float(buf, 12, fuel_flow);
419 _mav_put_float(buf, 16, engine_load);
420 _mav_put_float(buf, 20, throttle_position);
421 _mav_put_float(buf, 24, spark_dwell_time);
422 _mav_put_float(buf, 28, barometric_pressure);
423 _mav_put_float(buf, 32, intake_manifold_pressure);
424 _mav_put_float(buf, 36, intake_manifold_temperature);
425 _mav_put_float(buf, 40, cylinder_head_temperature);
426 _mav_put_float(buf, 44, ignition_timing);
427 _mav_put_float(buf, 48, injection_time);
428 _mav_put_float(buf, 52, exhaust_gas_temperature);
429 _mav_put_float(buf, 56, throttle_out);
430 _mav_put_float(buf, 60, pt_compensation);
431 _mav_put_uint8_t(buf, 64, health);
432 _mav_put_float(buf, 65, ignition_voltage);
433 _mav_put_float(buf, 69, fuel_pressure);
434
435 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EFI_STATUS, buf, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
436#else
437 mavlink_efi_status_t packet;
438 packet.ecu_index = ecu_index;
439 packet.rpm = rpm;
440 packet.fuel_consumed = fuel_consumed;
441 packet.fuel_flow = fuel_flow;
442 packet.engine_load = engine_load;
443 packet.throttle_position = throttle_position;
444 packet.spark_dwell_time = spark_dwell_time;
445 packet.barometric_pressure = barometric_pressure;
446 packet.intake_manifold_pressure = intake_manifold_pressure;
447 packet.intake_manifold_temperature = intake_manifold_temperature;
448 packet.cylinder_head_temperature = cylinder_head_temperature;
449 packet.ignition_timing = ignition_timing;
450 packet.injection_time = injection_time;
451 packet.exhaust_gas_temperature = exhaust_gas_temperature;
452 packet.throttle_out = throttle_out;
453 packet.pt_compensation = pt_compensation;
454 packet.health = health;
455 packet.ignition_voltage = ignition_voltage;
456 packet.fuel_pressure = fuel_pressure;
457
458 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EFI_STATUS, (const char *)&packet, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
459#endif
460}
461
462/**
463 * @brief Send a efi_status message
464 * @param chan MAVLink channel to send the message
465 * @param struct The MAVLink struct to serialize
466 */
467static inline void mavlink_msg_efi_status_send_struct(mavlink_channel_t chan, const mavlink_efi_status_t* efi_status)
468{
469#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
470 mavlink_msg_efi_status_send(chan, efi_status->health, efi_status->ecu_index, efi_status->rpm, efi_status->fuel_consumed, efi_status->fuel_flow, efi_status->engine_load, efi_status->throttle_position, efi_status->spark_dwell_time, efi_status->barometric_pressure, efi_status->intake_manifold_pressure, efi_status->intake_manifold_temperature, efi_status->cylinder_head_temperature, efi_status->ignition_timing, efi_status->injection_time, efi_status->exhaust_gas_temperature, efi_status->throttle_out, efi_status->pt_compensation, efi_status->ignition_voltage, efi_status->fuel_pressure);
471#else
472 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EFI_STATUS, (const char *)efi_status, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
473#endif
474}
475
476#if MAVLINK_MSG_ID_EFI_STATUS_LEN <= MAVLINK_MAX_PAYLOAD_LEN
477/*
478 This variant of _send() can be used to save stack space by reusing
479 memory from the receive buffer. The caller provides a
480 mavlink_message_t which is the size of a full mavlink message. This
481 is usually the receive buffer for the channel, and allows a reply to an
482 incoming message with minimum stack space usage.
483 */
484static inline void mavlink_msg_efi_status_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan, uint8_t health, float ecu_index, float rpm, float fuel_consumed, float fuel_flow, float engine_load, float throttle_position, float spark_dwell_time, float barometric_pressure, float intake_manifold_pressure, float intake_manifold_temperature, float cylinder_head_temperature, float ignition_timing, float injection_time, float exhaust_gas_temperature, float throttle_out, float pt_compensation, float ignition_voltage, float fuel_pressure)
485{
486#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
487 char *buf = (char *)msgbuf;
488 _mav_put_float(buf, 0, ecu_index);
489 _mav_put_float(buf, 4, rpm);
490 _mav_put_float(buf, 8, fuel_consumed);
491 _mav_put_float(buf, 12, fuel_flow);
492 _mav_put_float(buf, 16, engine_load);
493 _mav_put_float(buf, 20, throttle_position);
494 _mav_put_float(buf, 24, spark_dwell_time);
495 _mav_put_float(buf, 28, barometric_pressure);
496 _mav_put_float(buf, 32, intake_manifold_pressure);
497 _mav_put_float(buf, 36, intake_manifold_temperature);
498 _mav_put_float(buf, 40, cylinder_head_temperature);
499 _mav_put_float(buf, 44, ignition_timing);
500 _mav_put_float(buf, 48, injection_time);
501 _mav_put_float(buf, 52, exhaust_gas_temperature);
502 _mav_put_float(buf, 56, throttle_out);
503 _mav_put_float(buf, 60, pt_compensation);
504 _mav_put_uint8_t(buf, 64, health);
505 _mav_put_float(buf, 65, ignition_voltage);
506 _mav_put_float(buf, 69, fuel_pressure);
507
508 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EFI_STATUS, buf, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
509#else
510 mavlink_efi_status_t *packet = (mavlink_efi_status_t *)msgbuf;
511 packet->ecu_index = ecu_index;
512 packet->rpm = rpm;
513 packet->fuel_consumed = fuel_consumed;
514 packet->fuel_flow = fuel_flow;
515 packet->engine_load = engine_load;
516 packet->throttle_position = throttle_position;
517 packet->spark_dwell_time = spark_dwell_time;
518 packet->barometric_pressure = barometric_pressure;
519 packet->intake_manifold_pressure = intake_manifold_pressure;
520 packet->intake_manifold_temperature = intake_manifold_temperature;
521 packet->cylinder_head_temperature = cylinder_head_temperature;
522 packet->ignition_timing = ignition_timing;
523 packet->injection_time = injection_time;
524 packet->exhaust_gas_temperature = exhaust_gas_temperature;
525 packet->throttle_out = throttle_out;
526 packet->pt_compensation = pt_compensation;
527 packet->health = health;
528 packet->ignition_voltage = ignition_voltage;
529 packet->fuel_pressure = fuel_pressure;
530
531 _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_EFI_STATUS, (const char *)packet, MAVLINK_MSG_ID_EFI_STATUS_MIN_LEN, MAVLINK_MSG_ID_EFI_STATUS_LEN, MAVLINK_MSG_ID_EFI_STATUS_CRC);
532#endif
533}
534#endif
535
536#endif
537
538// MESSAGE EFI_STATUS UNPACKING
539
540
541/**
542 * @brief Get field health from efi_status message
543 *
544 * @return EFI health status
545 */
546static inline uint8_t mavlink_msg_efi_status_get_health(const mavlink_message_t* msg)
547{
548 return _MAV_RETURN_uint8_t(msg, 64);
549}
550
551/**
552 * @brief Get field ecu_index from efi_status message
553 *
554 * @return ECU index
555 */
556static inline float mavlink_msg_efi_status_get_ecu_index(const mavlink_message_t* msg)
557{
558 return _MAV_RETURN_float(msg, 0);
559}
560
561/**
562 * @brief Get field rpm from efi_status message
563 *
564 * @return RPM
565 */
566static inline float mavlink_msg_efi_status_get_rpm(const mavlink_message_t* msg)
567{
568 return _MAV_RETURN_float(msg, 4);
569}
570
571/**
572 * @brief Get field fuel_consumed from efi_status message
573 *
574 * @return [cm^3] Fuel consumed
575 */
576static inline float mavlink_msg_efi_status_get_fuel_consumed(const mavlink_message_t* msg)
577{
578 return _MAV_RETURN_float(msg, 8);
579}
580
581/**
582 * @brief Get field fuel_flow from efi_status message
583 *
584 * @return [cm^3/min] Fuel flow rate
585 */
586static inline float mavlink_msg_efi_status_get_fuel_flow(const mavlink_message_t* msg)
587{
588 return _MAV_RETURN_float(msg, 12);
589}
590
591/**
592 * @brief Get field engine_load from efi_status message
593 *
594 * @return [%] Engine load
595 */
596static inline float mavlink_msg_efi_status_get_engine_load(const mavlink_message_t* msg)
597{
598 return _MAV_RETURN_float(msg, 16);
599}
600
601/**
602 * @brief Get field throttle_position from efi_status message
603 *
604 * @return [%] Throttle position
605 */
606static inline float mavlink_msg_efi_status_get_throttle_position(const mavlink_message_t* msg)
607{
608 return _MAV_RETURN_float(msg, 20);
609}
610
611/**
612 * @brief Get field spark_dwell_time from efi_status message
613 *
614 * @return [ms] Spark dwell time
615 */
616static inline float mavlink_msg_efi_status_get_spark_dwell_time(const mavlink_message_t* msg)
617{
618 return _MAV_RETURN_float(msg, 24);
619}
620
621/**
622 * @brief Get field barometric_pressure from efi_status message
623 *
624 * @return [kPa] Barometric pressure
625 */
626static inline float mavlink_msg_efi_status_get_barometric_pressure(const mavlink_message_t* msg)
627{
628 return _MAV_RETURN_float(msg, 28);
629}
630
631/**
632 * @brief Get field intake_manifold_pressure from efi_status message
633 *
634 * @return [kPa] Intake manifold pressure(
635 */
636static inline float mavlink_msg_efi_status_get_intake_manifold_pressure(const mavlink_message_t* msg)
637{
638 return _MAV_RETURN_float(msg, 32);
639}
640
641/**
642 * @brief Get field intake_manifold_temperature from efi_status message
643 *
644 * @return [degC] Intake manifold temperature
645 */
646static inline float mavlink_msg_efi_status_get_intake_manifold_temperature(const mavlink_message_t* msg)
647{
648 return _MAV_RETURN_float(msg, 36);
649}
650
651/**
652 * @brief Get field cylinder_head_temperature from efi_status message
653 *
654 * @return [degC] Cylinder head temperature
655 */
656static inline float mavlink_msg_efi_status_get_cylinder_head_temperature(const mavlink_message_t* msg)
657{
658 return _MAV_RETURN_float(msg, 40);
659}
660
661/**
662 * @brief Get field ignition_timing from efi_status message
663 *
664 * @return [deg] Ignition timing (Crank angle degrees)
665 */
666static inline float mavlink_msg_efi_status_get_ignition_timing(const mavlink_message_t* msg)
667{
668 return _MAV_RETURN_float(msg, 44);
669}
670
671/**
672 * @brief Get field injection_time from efi_status message
673 *
674 * @return [ms] Injection time
675 */
676static inline float mavlink_msg_efi_status_get_injection_time(const mavlink_message_t* msg)
677{
678 return _MAV_RETURN_float(msg, 48);
679}
680
681/**
682 * @brief Get field exhaust_gas_temperature from efi_status message
683 *
684 * @return [degC] Exhaust gas temperature
685 */
686static inline float mavlink_msg_efi_status_get_exhaust_gas_temperature(const mavlink_message_t* msg)
687{
688 return _MAV_RETURN_float(msg, 52);
689}
690
691/**
692 * @brief Get field throttle_out from efi_status message
693 *
694 * @return [%] Output throttle
695 */
696static inline float mavlink_msg_efi_status_get_throttle_out(const mavlink_message_t* msg)
697{
698 return _MAV_RETURN_float(msg, 56);
699}
700
701/**
702 * @brief Get field pt_compensation from efi_status message
703 *
704 * @return Pressure/temperature compensation
705 */
706static inline float mavlink_msg_efi_status_get_pt_compensation(const mavlink_message_t* msg)
707{
708 return _MAV_RETURN_float(msg, 60);
709}
710
711/**
712 * @brief Get field ignition_voltage from efi_status message
713 *
714 * @return [V] Supply voltage to EFI sparking system. Zero in this value means "unknown", so if the supply voltage really is zero volts use 0.0001 instead.
715 */
716static inline float mavlink_msg_efi_status_get_ignition_voltage(const mavlink_message_t* msg)
717{
718 return _MAV_RETURN_float(msg, 65);
719}
720
721/**
722 * @brief Get field fuel_pressure from efi_status message
723 *
724 * @return [kPa] Fuel pressure. Zero in this value means "unknown", so if the fuel pressure really is zero kPa use 0.0001 instead.
725 */
726static inline float mavlink_msg_efi_status_get_fuel_pressure(const mavlink_message_t* msg)
727{
728 return _MAV_RETURN_float(msg, 69);
729}
730
731/**
732 * @brief Decode a efi_status message into a struct
733 *
734 * @param msg The message to decode
735 * @param efi_status C-struct to decode the message contents into
736 */
737static inline void mavlink_msg_efi_status_decode(const mavlink_message_t* msg, mavlink_efi_status_t* efi_status)
738{
739#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
740 efi_status->ecu_index = mavlink_msg_efi_status_get_ecu_index(msg);
741 efi_status->rpm = mavlink_msg_efi_status_get_rpm(msg);
742 efi_status->fuel_consumed = mavlink_msg_efi_status_get_fuel_consumed(msg);
743 efi_status->fuel_flow = mavlink_msg_efi_status_get_fuel_flow(msg);
744 efi_status->engine_load = mavlink_msg_efi_status_get_engine_load(msg);
745 efi_status->throttle_position = mavlink_msg_efi_status_get_throttle_position(msg);
746 efi_status->spark_dwell_time = mavlink_msg_efi_status_get_spark_dwell_time(msg);
747 efi_status->barometric_pressure = mavlink_msg_efi_status_get_barometric_pressure(msg);
748 efi_status->intake_manifold_pressure = mavlink_msg_efi_status_get_intake_manifold_pressure(msg);
749 efi_status->intake_manifold_temperature = mavlink_msg_efi_status_get_intake_manifold_temperature(msg);
750 efi_status->cylinder_head_temperature = mavlink_msg_efi_status_get_cylinder_head_temperature(msg);
751 efi_status->ignition_timing = mavlink_msg_efi_status_get_ignition_timing(msg);
752 efi_status->injection_time = mavlink_msg_efi_status_get_injection_time(msg);
753 efi_status->exhaust_gas_temperature = mavlink_msg_efi_status_get_exhaust_gas_temperature(msg);
754 efi_status->throttle_out = mavlink_msg_efi_status_get_throttle_out(msg);
755 efi_status->pt_compensation = mavlink_msg_efi_status_get_pt_compensation(msg);
756 efi_status->health = mavlink_msg_efi_status_get_health(msg);
757 efi_status->ignition_voltage = mavlink_msg_efi_status_get_ignition_voltage(msg);
758 efi_status->fuel_pressure = mavlink_msg_efi_status_get_fuel_pressure(msg);
759#else
760 uint8_t len = msg->len < MAVLINK_MSG_ID_EFI_STATUS_LEN? msg->len : MAVLINK_MSG_ID_EFI_STATUS_LEN;
761 memset(efi_status, 0, MAVLINK_MSG_ID_EFI_STATUS_LEN);
762 memcpy(efi_status, _MAV_PAYLOAD(msg), len);
763#endif
764}