rusEFI
The most advanced open source ECU
Loading...
Searching...
No Matches
Functions | Variables
sensor.cpp File Reference

Functions

SensorType findSensorTypeByName (const char *name)
 

Variables

static SensorRegistryEntry s_sensorRegistry [static_cast< size_t >(SensorType::PlaceholderLast)] = {}
 

Function Documentation

◆ findSensorTypeByName()

SensorType findSensorTypeByName ( const char name)

this is definitely not the fastest implementation possible but good enough for now? todo: some sort of hashmap in the future?

Definition at line 259 of file sensor.cpp.

259 {
260 using namespace rusefi::stringutil;
261
262 for (size_t i = 0;i < efi::size(s_sensorRegistry); i++) {
263 SensorType type = (SensorType)i;
264 const char *sensorName = getSensorType(type);
265 if (strEqualCaseInsensitive(sensorName, name)) {
266 return type;
267 }
268 }
269
270 return SensorType::Invalid;
271}
const char * getSensorType(SensorType value)
static SensorRegistryEntry s_sensorRegistry[static_cast< size_t >(SensorType::PlaceholderLast)]
Definition sensor.cpp:129
SensorType
Definition sensor_type.h:18

Referenced by findSensorByName(), and initSensorCli().

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ s_sensorRegistry

SensorRegistryEntry s_sensorRegistry[static_cast< size_t >(SensorType::PlaceholderLast)] = {}
static

Go to the source code of this file.