1 /* 2 * Copyright (C) 2017 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.car.hardware; 18 19 import android.annotation.IntDef; 20 import java.lang.annotation.Retention; 21 import java.lang.annotation.RetentionPolicy; 22 23 /** 24 * This class is a container for the indices of integer and float diagnostic sensors. 25 * These values are extracted from types.hal by packages/services/Car/tools/update-obd2-sensors.py 26 * 27 * DO NOT EDIT MANUALLY 28 * 29 * @hide 30 */ 31 public final class CarDiagnosticSensorIndices { 32 public static final class Obd2IntegerSensorIndex { Obd2IntegerSensorIndex()33 private Obd2IntegerSensorIndex() {} 34 35 public static final int FUEL_SYSTEM_STATUS = 0; 36 public static final int MALFUNCTION_INDICATOR_LIGHT_ON = 1; 37 public static final int IGNITION_MONITORS_SUPPORTED = 2; 38 public static final int IGNITION_SPECIFIC_MONITORS = 3; 39 public static final int INTAKE_AIR_TEMPERATURE = 4; 40 public static final int COMMANDED_SECONDARY_AIR_STATUS = 5; 41 public static final int NUM_OXYGEN_SENSORS_PRESENT = 6; 42 public static final int RUNTIME_SINCE_ENGINE_START = 7; 43 public static final int DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8; 44 public static final int WARMUPS_SINCE_CODES_CLEARED = 9; 45 public static final int DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10; 46 public static final int ABSOLUTE_BAROMETRIC_PRESSURE = 11; 47 public static final int CONTROL_MODULE_VOLTAGE = 12; 48 public static final int AMBIENT_AIR_TEMPERATURE = 13; 49 public static final int TIME_WITH_MALFUNCTION_LIGHT_ON = 14; 50 public static final int TIME_SINCE_TROUBLE_CODES_CLEARED = 15; 51 public static final int MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16; 52 public static final int MAX_OXYGEN_SENSOR_VOLTAGE = 17; 53 public static final int MAX_OXYGEN_SENSOR_CURRENT = 18; 54 public static final int MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19; 55 public static final int MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20; 56 public static final int FUEL_TYPE = 21; 57 public static final int FUEL_RAIL_ABSOLUTE_PRESSURE = 22; 58 public static final int ENGINE_OIL_TEMPERATURE = 23; 59 public static final int DRIVER_DEMAND_PERCENT_TORQUE = 24; 60 public static final int ENGINE_ACTUAL_PERCENT_TORQUE = 25; 61 public static final int ENGINE_REFERENCE_PERCENT_TORQUE = 26; 62 public static final int ENGINE_PERCENT_TORQUE_DATA_IDLE = 27; 63 public static final int ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28; 64 public static final int ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29; 65 public static final int ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30; 66 public static final int ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31; 67 public static final int LAST_SYSTEM = ENGINE_PERCENT_TORQUE_DATA_POINT4; 68 public static final int VENDOR_START = LAST_SYSTEM + 1; 69 } 70 71 public static final class Obd2FloatSensorIndex { Obd2FloatSensorIndex()72 private Obd2FloatSensorIndex() {} 73 74 public static final int CALCULATED_ENGINE_LOAD = 0; 75 public static final int ENGINE_COOLANT_TEMPERATURE = 1; 76 public static final int SHORT_TERM_FUEL_TRIM_BANK1 = 2; 77 public static final int LONG_TERM_FUEL_TRIM_BANK1 = 3; 78 public static final int SHORT_TERM_FUEL_TRIM_BANK2 = 4; 79 public static final int LONG_TERM_FUEL_TRIM_BANK2 = 5; 80 public static final int FUEL_PRESSURE = 6; 81 public static final int INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7; 82 public static final int ENGINE_RPM = 8; 83 public static final int VEHICLE_SPEED = 9; 84 public static final int TIMING_ADVANCE = 10; 85 public static final int MAF_AIR_FLOW_RATE = 11; 86 public static final int THROTTLE_POSITION = 12; 87 public static final int OXYGEN_SENSOR1_VOLTAGE = 13; 88 public static final int OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14; 89 public static final int OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15; 90 public static final int OXYGEN_SENSOR2_VOLTAGE = 16; 91 public static final int OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17; 92 public static final int OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18; 93 public static final int OXYGEN_SENSOR3_VOLTAGE = 19; 94 public static final int OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20; 95 public static final int OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21; 96 public static final int OXYGEN_SENSOR4_VOLTAGE = 22; 97 public static final int OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23; 98 public static final int OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24; 99 public static final int OXYGEN_SENSOR5_VOLTAGE = 25; 100 public static final int OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26; 101 public static final int OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27; 102 public static final int OXYGEN_SENSOR6_VOLTAGE = 28; 103 public static final int OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29; 104 public static final int OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30; 105 public static final int OXYGEN_SENSOR7_VOLTAGE = 31; 106 public static final int OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32; 107 public static final int OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33; 108 public static final int OXYGEN_SENSOR8_VOLTAGE = 34; 109 public static final int OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35; 110 public static final int OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36; 111 public static final int FUEL_RAIL_PRESSURE = 37; 112 public static final int FUEL_RAIL_GAUGE_PRESSURE = 38; 113 public static final int COMMANDED_EXHAUST_GAS_RECIRCULATION = 39; 114 public static final int EXHAUST_GAS_RECIRCULATION_ERROR = 40; 115 public static final int COMMANDED_EVAPORATIVE_PURGE = 41; 116 public static final int FUEL_TANK_LEVEL_INPUT = 42; 117 public static final int EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43; 118 public static final int CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44; 119 public static final int CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45; 120 public static final int CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46; 121 public static final int CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47; 122 public static final int ABSOLUTE_LOAD_VALUE = 48; 123 public static final int FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49; 124 public static final int RELATIVE_THROTTLE_POSITION = 50; 125 public static final int ABSOLUTE_THROTTLE_POSITION_B = 51; 126 public static final int ABSOLUTE_THROTTLE_POSITION_C = 52; 127 public static final int ACCELERATOR_PEDAL_POSITION_D = 53; 128 public static final int ACCELERATOR_PEDAL_POSITION_E = 54; 129 public static final int ACCELERATOR_PEDAL_POSITION_F = 55; 130 public static final int COMMANDED_THROTTLE_ACTUATOR = 56; 131 public static final int ETHANOL_FUEL_PERCENTAGE = 57; 132 public static final int ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58; 133 public static final int SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59; 134 public static final int SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60; 135 public static final int SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61; 136 public static final int SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62; 137 public static final int LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63; 138 public static final int LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64; 139 public static final int LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65; 140 public static final int LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66; 141 public static final int RELATIVE_ACCELERATOR_PEDAL_POSITION = 67; 142 public static final int HYBRID_BATTERY_PACK_REMAINING_LIFE = 68; 143 public static final int FUEL_INJECTION_TIMING = 69; 144 public static final int ENGINE_FUEL_RATE = 70; 145 public static final int LAST_SYSTEM = ENGINE_FUEL_RATE; 146 public static final int VENDOR_START = LAST_SYSTEM + 1; 147 } 148 149 @Retention(RetentionPolicy.SOURCE) 150 @IntDef({ 151 Obd2IntegerSensorIndex.FUEL_SYSTEM_STATUS, 152 Obd2IntegerSensorIndex.MALFUNCTION_INDICATOR_LIGHT_ON, 153 Obd2IntegerSensorIndex.IGNITION_MONITORS_SUPPORTED, 154 Obd2IntegerSensorIndex.IGNITION_SPECIFIC_MONITORS, 155 Obd2IntegerSensorIndex.INTAKE_AIR_TEMPERATURE, 156 Obd2IntegerSensorIndex.COMMANDED_SECONDARY_AIR_STATUS, 157 Obd2IntegerSensorIndex.NUM_OXYGEN_SENSORS_PRESENT, 158 Obd2IntegerSensorIndex.RUNTIME_SINCE_ENGINE_START, 159 Obd2IntegerSensorIndex.DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 160 Obd2IntegerSensorIndex.WARMUPS_SINCE_CODES_CLEARED, 161 Obd2IntegerSensorIndex.DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 162 Obd2IntegerSensorIndex.ABSOLUTE_BAROMETRIC_PRESSURE, 163 Obd2IntegerSensorIndex.CONTROL_MODULE_VOLTAGE, 164 Obd2IntegerSensorIndex.AMBIENT_AIR_TEMPERATURE, 165 Obd2IntegerSensorIndex.TIME_WITH_MALFUNCTION_LIGHT_ON, 166 Obd2IntegerSensorIndex.TIME_SINCE_TROUBLE_CODES_CLEARED, 167 Obd2IntegerSensorIndex.MAX_FUEL_AIR_EQUIVALENCE_RATIO, 168 Obd2IntegerSensorIndex.MAX_OXYGEN_SENSOR_VOLTAGE, 169 Obd2IntegerSensorIndex.MAX_OXYGEN_SENSOR_CURRENT, 170 Obd2IntegerSensorIndex.MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 171 Obd2IntegerSensorIndex.MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR, 172 Obd2IntegerSensorIndex.FUEL_TYPE, 173 Obd2IntegerSensorIndex.FUEL_RAIL_ABSOLUTE_PRESSURE, 174 Obd2IntegerSensorIndex.ENGINE_OIL_TEMPERATURE, 175 Obd2IntegerSensorIndex.DRIVER_DEMAND_PERCENT_TORQUE, 176 Obd2IntegerSensorIndex.ENGINE_ACTUAL_PERCENT_TORQUE, 177 Obd2IntegerSensorIndex.ENGINE_REFERENCE_PERCENT_TORQUE, 178 Obd2IntegerSensorIndex.ENGINE_PERCENT_TORQUE_DATA_IDLE, 179 Obd2IntegerSensorIndex.ENGINE_PERCENT_TORQUE_DATA_POINT1, 180 Obd2IntegerSensorIndex.ENGINE_PERCENT_TORQUE_DATA_POINT2, 181 Obd2IntegerSensorIndex.ENGINE_PERCENT_TORQUE_DATA_POINT3, 182 Obd2IntegerSensorIndex.ENGINE_PERCENT_TORQUE_DATA_POINT4, 183 Obd2IntegerSensorIndex.LAST_SYSTEM, 184 Obd2IntegerSensorIndex.VENDOR_START, 185 }) 186 public @interface IntegerSensorIndex {} 187 188 @Retention(RetentionPolicy.SOURCE) 189 @IntDef({ 190 Obd2FloatSensorIndex.CALCULATED_ENGINE_LOAD, 191 Obd2FloatSensorIndex.ENGINE_COOLANT_TEMPERATURE, 192 Obd2FloatSensorIndex.SHORT_TERM_FUEL_TRIM_BANK1, 193 Obd2FloatSensorIndex.LONG_TERM_FUEL_TRIM_BANK1, 194 Obd2FloatSensorIndex.SHORT_TERM_FUEL_TRIM_BANK2, 195 Obd2FloatSensorIndex.LONG_TERM_FUEL_TRIM_BANK2, 196 Obd2FloatSensorIndex.FUEL_PRESSURE, 197 Obd2FloatSensorIndex.INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 198 Obd2FloatSensorIndex.ENGINE_RPM, 199 Obd2FloatSensorIndex.VEHICLE_SPEED, 200 Obd2FloatSensorIndex.TIMING_ADVANCE, 201 Obd2FloatSensorIndex.MAF_AIR_FLOW_RATE, 202 Obd2FloatSensorIndex.THROTTLE_POSITION, 203 Obd2FloatSensorIndex.OXYGEN_SENSOR1_VOLTAGE, 204 Obd2FloatSensorIndex.OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM, 205 Obd2FloatSensorIndex.OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO, 206 Obd2FloatSensorIndex.OXYGEN_SENSOR2_VOLTAGE, 207 Obd2FloatSensorIndex.OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM, 208 Obd2FloatSensorIndex.OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO, 209 Obd2FloatSensorIndex.OXYGEN_SENSOR3_VOLTAGE, 210 Obd2FloatSensorIndex.OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM, 211 Obd2FloatSensorIndex.OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO, 212 Obd2FloatSensorIndex.OXYGEN_SENSOR4_VOLTAGE, 213 Obd2FloatSensorIndex.OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM, 214 Obd2FloatSensorIndex.OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO, 215 Obd2FloatSensorIndex.OXYGEN_SENSOR5_VOLTAGE, 216 Obd2FloatSensorIndex.OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM, 217 Obd2FloatSensorIndex.OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO, 218 Obd2FloatSensorIndex.OXYGEN_SENSOR6_VOLTAGE, 219 Obd2FloatSensorIndex.OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM, 220 Obd2FloatSensorIndex.OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO, 221 Obd2FloatSensorIndex.OXYGEN_SENSOR7_VOLTAGE, 222 Obd2FloatSensorIndex.OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM, 223 Obd2FloatSensorIndex.OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO, 224 Obd2FloatSensorIndex.OXYGEN_SENSOR8_VOLTAGE, 225 Obd2FloatSensorIndex.OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM, 226 Obd2FloatSensorIndex.OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO, 227 Obd2FloatSensorIndex.FUEL_RAIL_PRESSURE, 228 Obd2FloatSensorIndex.FUEL_RAIL_GAUGE_PRESSURE, 229 Obd2FloatSensorIndex.COMMANDED_EXHAUST_GAS_RECIRCULATION, 230 Obd2FloatSensorIndex.EXHAUST_GAS_RECIRCULATION_ERROR, 231 Obd2FloatSensorIndex.COMMANDED_EVAPORATIVE_PURGE, 232 Obd2FloatSensorIndex.FUEL_TANK_LEVEL_INPUT, 233 Obd2FloatSensorIndex.EVAPORATION_SYSTEM_VAPOR_PRESSURE, 234 Obd2FloatSensorIndex.CATALYST_TEMPERATURE_BANK1_SENSOR1, 235 Obd2FloatSensorIndex.CATALYST_TEMPERATURE_BANK2_SENSOR1, 236 Obd2FloatSensorIndex.CATALYST_TEMPERATURE_BANK1_SENSOR2, 237 Obd2FloatSensorIndex.CATALYST_TEMPERATURE_BANK2_SENSOR2, 238 Obd2FloatSensorIndex.ABSOLUTE_LOAD_VALUE, 239 Obd2FloatSensorIndex.FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO, 240 Obd2FloatSensorIndex.RELATIVE_THROTTLE_POSITION, 241 Obd2FloatSensorIndex.ABSOLUTE_THROTTLE_POSITION_B, 242 Obd2FloatSensorIndex.ABSOLUTE_THROTTLE_POSITION_C, 243 Obd2FloatSensorIndex.ACCELERATOR_PEDAL_POSITION_D, 244 Obd2FloatSensorIndex.ACCELERATOR_PEDAL_POSITION_E, 245 Obd2FloatSensorIndex.ACCELERATOR_PEDAL_POSITION_F, 246 Obd2FloatSensorIndex.COMMANDED_THROTTLE_ACTUATOR, 247 Obd2FloatSensorIndex.ETHANOL_FUEL_PERCENTAGE, 248 Obd2FloatSensorIndex.ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE, 249 Obd2FloatSensorIndex.SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1, 250 Obd2FloatSensorIndex.SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2, 251 Obd2FloatSensorIndex.SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3, 252 Obd2FloatSensorIndex.SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4, 253 Obd2FloatSensorIndex.LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1, 254 Obd2FloatSensorIndex.LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2, 255 Obd2FloatSensorIndex.LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3, 256 Obd2FloatSensorIndex.LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4, 257 Obd2FloatSensorIndex.RELATIVE_ACCELERATOR_PEDAL_POSITION, 258 Obd2FloatSensorIndex.HYBRID_BATTERY_PACK_REMAINING_LIFE, 259 Obd2FloatSensorIndex.FUEL_INJECTION_TIMING, 260 Obd2FloatSensorIndex.ENGINE_FUEL_RATE, 261 Obd2FloatSensorIndex.LAST_SYSTEM, 262 Obd2FloatSensorIndex.VENDOR_START, 263 }) 264 public @interface FloatSensorIndex {} 265 266 } 267