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 271 of file sensor.cpp.

271 {
272 using namespace rusefi::stringutil;
273
274 for (size_t i = 0;i < efi::size(s_sensorRegistry); i++) {
275 SensorType type = (SensorType)i;
276 const char *sensorName = getSensorType(type);
277 if (strEqualCaseInsensitive(sensorName, name)) {
278 return type;
279 }
280 }
281
282 return SensorType::Invalid;
283}
const char * getSensorType(SensorType value)
static SensorRegistryEntry s_sensorRegistry[static_cast< size_t >(SensorType::PlaceholderLast)]
Definition sensor.cpp:141
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.