Merge "Rename the enums that are supposed to match OBD2 values to have an Obd2 prefix Rename the enums that contain a list of sensors and don't directly map to OBD2 to have a Diagnostic prefix" into oc-mr1-dev am: a732c00feb

am: 5517e5dbad

Change-Id: I487243e4b13ba5cf913f0808db702d01819491c6
This commit is contained in:
Enrico Granata 2017-07-28 20:53:08 +00:00 committed by android-build-merger
commit d10c9bb447
5 changed files with 118 additions and 112 deletions

View file

@ -18,9 +18,9 @@ LOCAL_JAVA_LIBRARIES := \
#
# Build types.hal (CommonIgnitionMonitors)
# Build types.hal (DiagnosticFloatSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CommonIgnitionMonitors.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -30,16 +30,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.CommonIgnitionMonitors
android.hardware.automotive.vehicle@2.1::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (CompressionIgnitionMonitors)
# Build types.hal (DiagnosticIntegerSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CompressionIgnitionMonitors.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -49,16 +49,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.CompressionIgnitionMonitors
android.hardware.automotive.vehicle@2.1::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (FuelSystemStatus)
# Build types.hal (Obd2CommonIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelSystemStatus.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -68,16 +68,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.FuelSystemStatus
android.hardware.automotive.vehicle@2.1::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (FuelType)
# Build types.hal (Obd2CompressionIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelType.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -87,16 +87,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.FuelType
android.hardware.automotive.vehicle@2.1::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (IgnitionMonitorKind)
# Build types.hal (Obd2FuelSystemStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IgnitionMonitorKind.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -106,16 +106,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.IgnitionMonitorKind
android.hardware.automotive.vehicle@2.1::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FloatSensorIndex)
# Build types.hal (Obd2FuelType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FloatSensorIndex.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -125,16 +125,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2FloatSensorIndex
android.hardware.automotive.vehicle@2.1::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2IntegerSensorIndex)
# Build types.hal (Obd2IgnitionMonitorKind)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IntegerSensorIndex.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -144,16 +144,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2IntegerSensorIndex
android.hardware.automotive.vehicle@2.1::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (SecondaryAirStatus)
# Build types.hal (Obd2SecondaryAirStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SecondaryAirStatus.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -163,16 +163,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.SecondaryAirStatus
android.hardware.automotive.vehicle@2.1::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (SparkIgnitionMonitors)
# Build types.hal (Obd2SparkIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SparkIgnitionMonitors.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -182,7 +182,7 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.SparkIgnitionMonitors
android.hardware.automotive.vehicle@2.1::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
@ -358,9 +358,9 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
#
# Build types.hal (CommonIgnitionMonitors)
# Build types.hal (DiagnosticFloatSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CommonIgnitionMonitors.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -370,16 +370,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.CommonIgnitionMonitors
android.hardware.automotive.vehicle@2.1::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (CompressionIgnitionMonitors)
# Build types.hal (DiagnosticIntegerSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/CompressionIgnitionMonitors.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -389,16 +389,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.CompressionIgnitionMonitors
android.hardware.automotive.vehicle@2.1::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (FuelSystemStatus)
# Build types.hal (Obd2CommonIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelSystemStatus.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -408,16 +408,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.FuelSystemStatus
android.hardware.automotive.vehicle@2.1::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (FuelType)
# Build types.hal (Obd2CompressionIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/FuelType.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -427,16 +427,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.FuelType
android.hardware.automotive.vehicle@2.1::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (IgnitionMonitorKind)
# Build types.hal (Obd2FuelSystemStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IgnitionMonitorKind.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -446,16 +446,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.IgnitionMonitorKind
android.hardware.automotive.vehicle@2.1::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FloatSensorIndex)
# Build types.hal (Obd2FuelType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FloatSensorIndex.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -465,16 +465,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2FloatSensorIndex
android.hardware.automotive.vehicle@2.1::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2IntegerSensorIndex)
# Build types.hal (Obd2IgnitionMonitorKind)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IntegerSensorIndex.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -484,16 +484,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2IntegerSensorIndex
android.hardware.automotive.vehicle@2.1::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (SecondaryAirStatus)
# Build types.hal (Obd2SecondaryAirStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SecondaryAirStatus.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -503,16 +503,16 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.SecondaryAirStatus
android.hardware.automotive.vehicle@2.1::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (SparkIgnitionMonitors)
# Build types.hal (Obd2SparkIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/SparkIgnitionMonitors.java
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
@ -522,7 +522,7 @@ $(GEN): PRIVATE_CUSTOM_TOOL = \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.SparkIgnitionMonitors
android.hardware.automotive.vehicle@2.1::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)

View file

@ -38,12 +38,12 @@ public:
size_t numVendorFloatSensors);
// Stores an integer-valued sensor.
V2_0::StatusCode setIntegerSensor(Obd2IntegerSensorIndex index, int32_t value);
V2_0::StatusCode setIntegerSensor(DiagnosticIntegerSensorIndex index, int32_t value);
// Stores an integer-valued sensor.
V2_0::StatusCode setIntegerSensor(size_t index, int32_t value);
// Stores a float-valued sensor.
V2_0::StatusCode setFloatSensor(Obd2FloatSensorIndex index, float value);
V2_0::StatusCode setFloatSensor(DiagnosticFloatSensorIndex index, float value);
// Stores a float-valued sensor.
V2_0::StatusCode setFloatSensor(size_t index, float value);

View file

@ -56,9 +56,12 @@ const std::vector<uint8_t>& Obd2SensorStore::BitmaskInVector::getBitmask() const
Obd2SensorStore::Obd2SensorStore(size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
using V2_0::toInt;
// because the last index is valid *inclusive*
const size_t numSystemIntegerSensors = V2_0::toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX)+1;
const size_t numSystemFloatSensors = V2_0::toInt(Obd2FloatSensorIndex::LAST_SYSTEM_INDEX)+1;
const size_t numSystemIntegerSensors =
toInt(DiagnosticIntegerSensorIndex::LAST_SYSTEM_INDEX)+1;
const size_t numSystemFloatSensors =
toInt(DiagnosticFloatSensorIndex::LAST_SYSTEM_INDEX)+1;
mIntegerSensors = std::vector<int32_t>(
numSystemIntegerSensors+numVendorIntegerSensors, 0);
mFloatSensors = std::vector<float>(
@ -66,11 +69,11 @@ Obd2SensorStore::Obd2SensorStore(size_t numVendorIntegerSensors,
mSensorsBitmask.resize(mIntegerSensors.size()+mFloatSensors.size());
}
V2_0::StatusCode Obd2SensorStore::setIntegerSensor(Obd2IntegerSensorIndex index,
V2_0::StatusCode Obd2SensorStore::setIntegerSensor(DiagnosticIntegerSensorIndex index,
int32_t value) {
return setIntegerSensor(V2_0::toInt(index), value);
}
V2_0::StatusCode Obd2SensorStore::setFloatSensor(Obd2FloatSensorIndex index,
V2_0::StatusCode Obd2SensorStore::setFloatSensor(DiagnosticFloatSensorIndex index,
float value) {
return setFloatSensor(V2_0::toInt(index), value);
}

View file

@ -37,85 +37,86 @@ namespace impl {
static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(
size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
using V2_0::toInt;
std::unique_ptr<Obd2SensorStore> sensorStore(new Obd2SensorStore(
numVendorIntegerSensors, numVendorFloatSensors));
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS,
V2_0::toInt(FuelSystemStatus::CLOSED_LOOP));
DiagnosticIntegerSensorIndex::FUEL_SYSTEM_STATUS,
toInt(Obd2FuelSystemStatus::CLOSED_LOOP));
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
DiagnosticIntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
V2_0::toInt(IgnitionMonitorKind::SPARK));
sensorStore->setIntegerSensor(Obd2IntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
CommonIgnitionMonitors::MISFIRE_AVAILABLE |
SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
DiagnosticIntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
toInt(Obd2IgnitionMonitorKind::SPARK));
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
Obd2CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
Obd2CommonIgnitionMonitors::MISFIRE_AVAILABLE |
Obd2SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
Obd2SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
DiagnosticIntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
V2_0::toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
DiagnosticIntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
toInt(Obd2SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
DiagnosticIntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
DiagnosticIntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
DiagnosticIntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
DiagnosticIntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
DiagnosticIntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
DiagnosticIntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
DiagnosticIntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
sensorStore->setIntegerSensor(
Obd2IntegerSensorIndex::FUEL_TYPE, V2_0::toInt(FuelType::GASOLINE));
DiagnosticIntegerSensorIndex::FUEL_TYPE, V2_0::toInt(Obd2FuelType::GASOLINE));
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
DiagnosticFloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
DiagnosticFloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::ENGINE_RPM, 1250.);
DiagnosticFloatSensorIndex::ENGINE_RPM, 1250.);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::VEHICLE_SPEED, 40.);
DiagnosticFloatSensorIndex::VEHICLE_SPEED, 40.);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::TIMING_ADVANCE, 2.5);
DiagnosticFloatSensorIndex::TIMING_ADVANCE, 2.5);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::THROTTLE_POSITION, 19.75);
DiagnosticFloatSensorIndex::THROTTLE_POSITION, 19.75);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
DiagnosticFloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
DiagnosticFloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
DiagnosticFloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
DiagnosticFloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
DiagnosticFloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
DiagnosticFloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
sensorStore->setFloatSensor(
Obd2FloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
DiagnosticFloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
return sensorStore;
}

View file

@ -260,8 +260,8 @@ enum VehicleProperty: @2.0::VehicleProperty {
| VehicleArea:GLOBAL),
};
/** The status of a fuel system as described by the OBD2 specification. */
enum FuelSystemStatus : int32_t {
/** The status of the vehicle's fuel system. */
enum Obd2FuelSystemStatus : int32_t {
OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1,
CLOSED_LOOP = 2,
OPEN_ENGINE_LOAD_OR_DECELERATION = 4,
@ -270,13 +270,13 @@ enum FuelSystemStatus : int32_t {
};
/** Defines which ignition monitors are available to be read. */
enum IgnitionMonitorKind : int32_t {
enum Obd2IgnitionMonitorKind : int32_t {
SPARK = 0,
COMPRESSION = 1,
};
/** These ignition monitors are common to both SPARK and COMPRESSION. */
enum CommonIgnitionMonitors : int32_t {
enum Obd2CommonIgnitionMonitors : int32_t {
COMPONENTS_AVAILABLE = 0x1 << 0,
COMPONENTS_INCOMPLETE = 0x1 << 1,
@ -288,7 +288,7 @@ enum CommonIgnitionMonitors : int32_t {
};
/** Ignition monitors available for SPARK vehicles. */
enum SparkIgnitionMonitors : CommonIgnitionMonitors {
enum Obd2SparkIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_AVAILABLE = 0x1 << 6,
EGR_INCOMPLETE = 0x1 << 7,
@ -315,7 +315,7 @@ enum SparkIgnitionMonitors : CommonIgnitionMonitors {
};
/** Ignition monitors only available for COMPRESSION vehicles. */
enum CompressionIgnitionMonitors : CommonIgnitionMonitors {
enum Obd2CompressionIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_OR_VVT_AVAILABLE = 0x1 << 6,
EGR_OR_VVT_INCOMPLETE = 0x1 << 7,
@ -335,14 +335,16 @@ enum CompressionIgnitionMonitors : CommonIgnitionMonitors {
NMHC_CATALYST_INCOMPLETE = 0x1 << 17,
};
enum SecondaryAirStatus : int32_t {
/** The status of the vehicle's secondary air system. */
enum Obd2SecondaryAirStatus : int32_t {
UPSTREAM = 1,
DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2,
FROM_OUTSIDE_OR_OFF = 4,
PUMP_ON_FOR_DIAGNOSTICS = 8,
};
enum FuelType : int32_t {
/** The fuel type(s) supported by a vehicle. */
enum Obd2FuelType : int32_t {
NOT_AVAILABLE = 0,
GASOLINE = 1,
METHANOL = 2,
@ -376,7 +378,7 @@ enum FuelType : int32_t {
* 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 {
enum DiagnosticIntegerSensorIndex : int32_t {
/** refer to FuelSystemStatus for a description of this value. */
FUEL_SYSTEM_STATUS = 0,
MALFUNCTION_INDICATOR_LIGHT_ON = 1,
@ -431,7 +433,7 @@ enum Obd2IntegerSensorIndex : int32_t {
* 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 {
enum DiagnosticFloatSensorIndex : int32_t {
CALCULATED_ENGINE_LOAD = 0,
ENGINE_COOLANT_TEMPERATURE = 1,
SHORT_TERM_FUEL_TRIM_BANK1 = 2,