rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
AemXSeriesLambda.h
Go to the documentation of this file.
1#pragma once
2
3#include "can_sensor.h"
4
6
7// Following codes "extend" wbo::Fault codes
8#define HACK_INVALID_AEM 7
9
10// todo: static_cast<uint8_t>(Fault::LegacyProtocol);
11
12#define RUSEFI_WIDEBAND_VERSION_MIN 0xA0
13
15public:
16 AemXSeriesWideband(uint8_t sensorIndex, SensorType type);
17
18 bool acceptFrame(const size_t busIndex, const CANRxFrame& frame) const override final;
19
20 void refreshState(void);
21
22 void refreshSmoothedLambda(float lambda);
23
24protected:
25 // Dispatches to one of the three decoders below
26 void decodeFrame(const CANRxFrame& frame, efitick_t nowNt) override;
27
28 // Decode an actual AEM controller, or a rusEFI controller sending AEM format
29 bool decodeAemXSeries(const CANRxFrame& frame, efitick_t nowNt);
30
31 // Decode rusEFI custom format
32 bool decodeRusefiStandard(const CANRxFrame& frame, efitick_t nowNt);
33 void decodeRusefiDiag(const CANRxFrame& frame);
34
35private:
37 uint32_t getReCanId() const;
38 uint32_t getAemCanId() const;
39 bool isHeaterAllowed();
40
41 const uint8_t m_sensorIndex;
42 // raw fault code from sensor
43 uint8_t m_faultCode;
44 // Used by both AEM and rusEFI WBO
46 // Used for AEM sensor only
48 // Last valid packed received, for wbo::Fault::CanSilent state
49 efitick_t m_lastUpdate = 0;
50};
void decodeRusefiDiag(const CANRxFrame &frame)
bool acceptFrame(const size_t busIndex, const CANRxFrame &frame) const override final
void refreshSmoothedLambda(float lambda)
bool decodeRusefiStandard(const CANRxFrame &frame, efitick_t nowNt)
can_wbo_type_e sensorType() const
uint32_t getAemCanId() const
uint32_t getReCanId() const
bool decodeAemXSeries(const CANRxFrame &frame, efitick_t nowNt)
const uint8_t m_sensorIndex
void decodeFrame(const CANRxFrame &frame, efitick_t nowNt) override
SensorType type() const
Definition sensor.h:162
can_wbo_type_e
SensorType
Definition sensor_type.h:18