From ec67aa40d7f6779ba650be8656bb49c9094bea6c Mon Sep 17 00:00:00 2001 From: Enrico Granata Date: Wed, 21 Dec 2016 11:15:19 -0800 Subject: [PATCH] Initial definition of data types and enumerations for OBD2-compatible diagnostic properties This commit defines a list of properties that we want to support in VHAL for the purpose of gathering vehicle diagnostics, and a data structure to contain the values of those properties in the form of a "snapshot" It does not yet define the property itself as that relies on a yet undefined hybrid type Test: build Change-Id: Ifa5bbf45c4aee2f93cbd82316d3399c04e3c34b4 --- vehicle/2.0/Android.mk | 342 +++++++++++++++++++++++++++++++++++++ vehicle/2.0/types.hal | 380 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 722 insertions(+) diff --git a/vehicle/2.0/Android.mk b/vehicle/2.0/Android.mk index 71b587b2e6..95449608c5 100644 --- a/vehicle/2.0/Android.mk +++ b/vehicle/2.0/Android.mk @@ -16,6 +16,177 @@ LOCAL_JAVA_LIBRARIES := \ android.hidl.base@1.0-java \ +# +# Build types.hal (CommonIgnitionMonitors) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/CommonIgnitionMonitors.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.CommonIgnitionMonitors + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (CompressionIgnitionMonitors) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/CompressionIgnitionMonitors.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.CompressionIgnitionMonitors + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (FuelSystemStatus) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/FuelSystemStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.FuelSystemStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (FuelType) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/FuelType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.FuelType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (IgnitionMonitorKind) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/IgnitionMonitorKind.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.IgnitionMonitorKind + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (Obd2FloatSensorIndex) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/Obd2FloatSensorIndex.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.Obd2FloatSensorIndex + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (Obd2IntegerSensorIndex) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/Obd2IntegerSensorIndex.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.Obd2IntegerSensorIndex + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (SecondaryAirStatus) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/SecondaryAirStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.SecondaryAirStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (SparkIgnitionMonitors) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/SparkIgnitionMonitors.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.SparkIgnitionMonitors + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (StatusCode) # @@ -969,6 +1140,177 @@ LOCAL_STATIC_JAVA_LIBRARIES := \ android.hidl.base@1.0-java-static \ +# +# Build types.hal (CommonIgnitionMonitors) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/CommonIgnitionMonitors.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.CommonIgnitionMonitors + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (CompressionIgnitionMonitors) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/CompressionIgnitionMonitors.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.CompressionIgnitionMonitors + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (FuelSystemStatus) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/FuelSystemStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.FuelSystemStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (FuelType) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/FuelType.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.FuelType + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (IgnitionMonitorKind) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/IgnitionMonitorKind.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.IgnitionMonitorKind + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (Obd2FloatSensorIndex) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/Obd2FloatSensorIndex.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.Obd2FloatSensorIndex + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (Obd2IntegerSensorIndex) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/Obd2IntegerSensorIndex.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.Obd2IntegerSensorIndex + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (SecondaryAirStatus) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/SecondaryAirStatus.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.SecondaryAirStatus + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + +# +# Build types.hal (SparkIgnitionMonitors) +# +GEN := $(intermediates)/android/hardware/vehicle/V2_0/SparkIgnitionMonitors.java +$(GEN): $(HIDL) +$(GEN): PRIVATE_HIDL := $(HIDL) +$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal +$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates) +$(GEN): PRIVATE_CUSTOM_TOOL = \ + $(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \ + -Ljava \ + -randroid.hardware:hardware/interfaces \ + -randroid.hidl:system/libhidl/transport \ + android.hardware.vehicle@2.0::types.SparkIgnitionMonitors + +$(GEN): $(LOCAL_PATH)/types.hal + $(transform-generated-source) +LOCAL_GENERATED_SOURCES += $(GEN) + # # Build types.hal (StatusCode) # diff --git a/vehicle/2.0/types.hal b/vehicle/2.0/types.hal index 28ccb78f47..d98a9823c8 100644 --- a/vehicle/2.0/types.hal +++ b/vehicle/2.0/types.hal @@ -2531,3 +2531,383 @@ enum StatusCode : int32_t { /* Something unexpected has happened in Vehicle HAL */ INTERNAL_ERROR = 5, }; + +/* The status of a fuel system as described by the OBD2 specification. */ +enum FuelSystemStatus : int32_t { + OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1, + + CLOSED_LOOP = 2, + + OPEN_ENGINE_LOAD_OR_DECELERATION = 4, + + OPEN_SYSTEM_FAILURE = 8, + + CLOSED_LOOP_BUT_FEEDBACK_FAULT = 16, +}; + +/* Defines which ignition monitors are available to be read. */ +enum IgnitionMonitorKind : int32_t { + SPARK = 0, + + COMPRESSION = 1, +}; + +/* These ignition monitors are common to both SPARK and COMPRESSION. */ +enum CommonIgnitionMonitors : int32_t { + COMPONENTS_AVAILABLE = 0x1 << 0, + COMPONENTS_INCOMPLETE = 0x1 << 1, + + FUEL_SYSTEM_AVAILABLE = 0x1 << 2, + FUEL_SYSTEM_INCOMPLETE = 0x1 << 3, + + MISFIRE_AVAILABLE = 0x1 << 4, + MISFIRE_INCOMPLETE = 0x1 << 5, +}; + +/* Ignition monitors available for SPARK vehicles. */ +enum SparkIgnitionMonitors : CommonIgnitionMonitors { + EGR_AVAILABLE = 0x1 << 6, + EGR_INCOMPLETE = 0x1 << 7, + + OXYGEN_SENSOR_HEATER_AVAILABLE = 0x1 << 8, + OXYGEN_SENSOR_HEATER_INCOMPLETE = 0x1 << 9, + + OXYGEN_SENSOR_AVAILABLE = 0x1 << 10, + OXYGEN_SENSOR_INCOMPLETE = 0x1 << 11, + + AC_REFRIGERANT_AVAILABLE = 0x1 << 12, + AC_REFRIGERANT_INCOMPLETE = 0x1 << 13, + + SECONDARY_AIR_SYSTEM_AVAILABLE = 0x1 << 14, + SECONDARY_AIR_SYSTEM_INCOMPLETE = 0x1 << 15, + + EVAPORATIVE_SYSTEM_AVAILABLE = 0x1 << 16, + EVAPORATIVE_SYSTEM_INCOMPLETE = 0x1 << 17, + + HEATED_CATALYST_AVAILABLE = 0x1 << 18, + HEATED_CATALYST_INCOMPLETE = 0x1 << 19, + + CATALYST_AVAILABLE = 0x1 << 20, + CATALYST_INCOMPLETE = 0x1 << 21, +}; + +/* Ignition monitors only available for COMPRESSION vehicles. */ +enum CompressionIgnitionMonitors : CommonIgnitionMonitors { + EGR_OR_VVT_AVAILABLE = 0x1 << 6, + EGR_OR_VVT_INCOMPLETE = 0x1 << 7, + + PM_FILTER_AVAILABLE = 0x1 << 8, + PM_FILTER_INCOMPLETE = 0x1 << 9, + + EXHAUST_GAS_SENSOR_AVAILABLE = 0x1 << 10, + EXHAUST_GAS_SENSOR_INCOMPLETE = 0x1 << 11, + + BOOST_PRESSURE_AVAILABLE = 0x1 << 12, + BOOST_PRESSURE_INCOMPLETE = 0x1 << 13, + + NOx_SCR__AVAILABLE = 0x1 << 14, + NOx_SCR_INCOMPLETE = 0x1 << 15, + + NMHC_CATALYST_AVAILABLE = 0x1 << 16, + NMHC_CATALYST_INCOMPLETE = 0x1 << 17, +}; + +enum SecondaryAirStatus : int32_t { + UPSTREAM = 1, + + DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2, + + FROM_OUTSIDE_OR_OFF = 4, + + PUMP_ON_FOR_DIAGNOSTICS = 8, +}; + +enum FuelType : int32_t { + NOT_AVAILABLE = 0, + + GASOLINE = 1, + + METHANOL = 2, + + ETHANOL = 3, + + DIESEL = 4, + + LPG = 5, + + CNG = 6, + + PROPANE = 7, + + ELECTRIC = 8, + + BIFUEL_RUNNING_GASOLINE = 9, + + BIFUEL_RUNNING_METHANOL = 10, + + BIFUEL_RUNNING_ETHANOL = 11, + + BIFUEL_RUNNING_LPG = 12, + + BIFUEL_RUNNING_CNG = 13, + + BIFUEL_RUNNING_PROPANE = 14, + + BIFUEL_RUNNING_ELECTRIC = 15, + + BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION = 16, + + HYBRID_GASOLINE = 17, + + HYBRID_ETHANOL = 18, + + HYBRID_DIESEL = 19, + + HYBRID_ELECTRIC = 20, + + HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION = 21, + + HYBRID_REGENERATIVE = 22, + + BIFUEL_RUNNING_DIESEL = 23, +}; + +/* + * This enum provides the canonical mapping for sensor properties that have an integer value. + * The ordering of the values is taken from the OBD2 specification. + * Some of the properties are represented as an integer mapping to another enum. In those cases + * expect a comment by the property definition describing the enum to look at for the mapping. + * Any value greater than the last reserved index is available to vendors to map their extensions. + */ +enum Obd2IntegerSensorIndex : int32_t { + /* refer to FuelSystemStatus for a description of this value. */ + FUEL_SYSTEM_STATUS = 0, + + MALFUNCTION_INDICATOR_LIGHT_ON = 1, + + /* refer to IgnitionMonitorKind for a description of this value. */ + IGNITION_MONITORS_SUPPORTED = 2, + + /* + * The value of this sensor is a bitmask that specifies whether ignition-specific + * tests are available and whether they are complete. The semantics of the individual + * bits in this value are given by, respectively, SparkIgnitionMonitors and + * CompressionIgnitionMonitors depending on the value of IGNITION_MONITORS_SUPPORTED. + /* + IGNITION_SPECIFIC_MONITORS = 3, + + INTAKE_AIR_TEMPERATURE = 4, + + /* refer to SecondaryAirStatus for a description of this value. */ + COMMANDED_SECONDARY_AIR_STATUS = 5, + + NUM_OXYGEN_SENSORS_PRESENT = 6, + + RUNTIME_SINCE_ENGINE_START = 7, + + DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, + + WARMUPS_SINCE_CODES_CLEARED = 9, + + DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, + + ABSOLUTE_BAROMETRIC_PRESSURE = 11, + + CONTROL_MODULE_VOLTAGE = 12, + + AMBIENT_AIR_TEMPERATURE = 13, + + TIME_WITH_MALFUNCTION_LIGHT_ON = 14, + + TIME_SINCE_TROUBLE_CODES_CLEARED = 15, + + MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, + + MAX_OXYGEN_SENSOR_VOLTAGE = 17, + + MAX_OXYGEN_SENSOR_CURRENT = 18, + + MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, + + MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, + + /* refer to FuelType for a description of this value. */ + FUEL_TYPE = 21, + + FUEL_RAIL_ABSOLUTE_PRESSURE = 22, + + ENGINE_OIL_TEMPERATURE = 23, + + DRIVER_DEMAND_PERCENT_TORQUE = 24, + + ENGINE_ACTUAL_PERCENT_TORQUE = 25, + + ENGINE_REFERENCE_PERCENT_TORQUE = 26, + + ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, + + ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, + + ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, + + ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, + + ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, + + LAST_SYSTEM_INDEX = ENGINE_PERCENT_TORQUE_DATA_POINT4, + + VENDOR_START_INDEX = LAST_SYSTEM_INDEX + 1, +}; + +/* + * This enum provides the canonical mapping for sensor properties that have a floating-point value. + * The ordering of the values is taken from the OBD2 specification. + * Any value greater than the last reserved index is available to vendors to map their extensions. + */ +enum Obd2FloatSensorIndex : int32_t { + CALCULATED_ENGINE_LOAD = 0, + + ENGINE_COOLANT_TEMPERATURE = 1, + + SHORT_TERM_FUEL_TRIM_BANK1 = 2, + + LONG_TERM_FUEL_TRIM_BANK1 = 3, + + SHORT_TERM_FUEL_TRIM_BANK2 = 4, + + LONG_TERM_FUEL_TRIM_BANK2 = 5, + + FUEL_PRESSURE = 6, + + INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, + + ENGINE_RPM = 8, + + VEHICLE_SPEED = 9, + + TIMING_ADVANCE = 10, + + MAF_AIR_FLOW_RATE = 11, + + THROTTLE_POSITION = 12, + + OXYGEN_SENSOR1_VOLTAGE = 13, + + OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, + + OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, + + OXYGEN_SENSOR2_VOLTAGE = 16, + + OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, + + OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, + + OXYGEN_SENSOR3_VOLTAGE = 19, + + OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, + + OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, + + OXYGEN_SENSOR4_VOLTAGE = 22, + + OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, + + OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, + + OXYGEN_SENSOR5_VOLTAGE = 25, + + OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, + + OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, + + OXYGEN_SENSOR6_VOLTAGE = 28, + + OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, + + OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, + + OXYGEN_SENSOR7_VOLTAGE = 31, + + OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, + + OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, + + OXYGEN_SENSOR8_VOLTAGE = 34, + + OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, + + OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, + + FUEL_RAIL_PRESSURE = 37, + + FUEL_RAIL_GAUGE_PRESSURE = 38, + + COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, + + EXHAUST_GAS_RECIRCULATION_ERROR = 40, + + COMMANDED_EVAPORATIVE_PURGE = 41, + + FUEL_TANK_LEVEL_INPUT = 42, + + EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, + + CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, + + CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, + + CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, + + CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, + + ABSOLUTE_LOAD_VALUE = 48, + + FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, + + RELATIVE_THROTTLE_POSITION = 50, + + ABSOLUTE_THROTTLE_POSITION_B = 51, + + ABSOLUTE_THROTTLE_POSITION_C = 52, + + ACCELERATOR_PEDAL_POSITION_D = 53, + + ACCELERATOR_PEDAL_POSITION_E = 54, + + ACCELERATOR_PEDAL_POSITION_F = 55, + + COMMANDED_THROTTLE_ACTUATOR = 56, + + ETHANOL_FUEL_PERCENTAGE = 57, + + ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, + + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, + + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, + + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61, + + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, + + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, + + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, + + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, + + LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, + + RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, + + HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, + + FUEL_INJECTION_TIMING = 69, + + ENGINE_FUEL_RATE = 70, + + LAST_SYSTEM_INDEX = ENGINE_FUEL_RATE, + + VENDOR_START_INDEX = LAST_SYSTEM_INDEX + 1, +};