rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Public Member Functions
CanSensorBase Class Reference

#include <can_sensor.h>

Inheritance diagram for CanSensorBase:
Inheritance graph
[legend]
Collaboration diagram for CanSensorBase:
Collaboration graph
[legend]

Public Member Functions

 CanSensorBase (uint32_t eid, SensorType type, efidur_t timeout)
 
void showInfo (const char *sensorName) const override
 
- Public Member Functions inherited from StoredValueSensor
SensorResult get () const final override
 
 StoredValueSensor (SensorType type, efidur_t timeoutNt)
 
void invalidate ()
 
void invalidate (UnexpectedCode why)
 
void setValidValue (float value, efitick_t timestamp)
 
void showInfo (const char *sensorName) const override
 
virtual void setTimeout (int timeoutMs)
 
- Public Member Functions inherited from Sensor
bool Register ()
 
const chargetSensorName () const
 
virtual bool hasSensor () const
 
virtual float getRaw () const
 
virtual bool isRedundant () const
 
void unregister ()
 
SensorType type () const
 
- Public Member Functions inherited from CanListener
 CanListener (uint32_t id)
 
CanListenerprocessFrame (const size_t busIndex, const CANRxFrame &frame, efitick_t nowNt)
 
uint32_t getId ()
 
void setNext (CanListener *next)
 
virtual CanListenerrequest ()
 
bool hasNext () const
 
virtual bool acceptFrame (const size_t busIndex, const CANRxFrame &frame) const
 

Additional Inherited Members

- Static Public Member Functions inherited from Sensor
static void showAllSensorInfo ()
 
static void showInfo (SensorType type)
 
static void resetRegistry ()
 
static const SensorgetSensorOfType (SensorType type)
 
static SensorResult get (SensorType type)
 
static float getOrZero (SensorType type)
 
static float getRaw (SensorType type)
 
static bool isRedundant (SensorType type)
 
static bool hasSensor (SensorType type)
 
static void setMockValue (SensorType type, float value, bool mockRedundant=false)
 
static void setInvalidMockValue (SensorType type)
 
static void resetMockValue (SensorType type)
 
static void resetAllMocks ()
 
static void inhibitTimeouts (bool inhibit)
 
static const chargetSensorName (SensorType type)
 
- Protected Member Functions inherited from Sensor
 Sensor (SensorType type)
 
- Protected Member Functions inherited from CanListener
virtual void decodeFrame (const CANRxFrame &frame, efitick_t nowNt)=0
 
- Static Protected Attributes inherited from Sensor
static bool s_inhibitSensorTimeouts = false
 

Detailed Description

Sensor which reads it's value from CAN

Definition at line 20 of file can_sensor.h.

Constructor & Destructor Documentation

◆ CanSensorBase()

CanSensorBase::CanSensorBase ( uint32_t  eid,
SensorType  type,
efidur_t  timeout 
)
inline

Definition at line 22 of file can_sensor.h.

23 : StoredValueSensor(type, timeout)
24 , CanListener(eid)
25 {
26 }
SensorType type() const
Definition sensor.h:162
Base class for sensors that compute a value on one thread, and want to make it available to consumers...

Member Function Documentation

◆ showInfo()

void CanSensorBase::showInfo ( const char sensorName) const
overridevirtual

Implements Sensor.

Definition at line 44 of file sensor_info_printing.cpp.

44 {
45 const auto value = get();
46 efiPrintf("CAN Sensor \"%s\": valid: %s value: %.2f", sensorName, boolToString(value.Valid), value.Value);
47}
SensorResult get() const final override
const char * boolToString(bool value)
Definition efilib.cpp:19
Here is the call graph for this function:

The documentation for this class was generated from the following files: