Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2016 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 | #include "DefaultVehicleHal.h" |
| 18 | |
Enrico Granata | adcb7c7 | 2017-01-25 12:07:15 -0800 | [diff] [blame] | 19 | #include <algorithm> |
| 20 | |
Yifan Hong | f9d3034 | 2016-11-30 13:45:34 -0800 | [diff] [blame] | 21 | #define LOG_TAG "default_vehicle" |
| 22 | #include <android/log.h> |
| 23 | |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 24 | namespace android { |
| 25 | namespace hardware { |
| 26 | namespace vehicle { |
| 27 | namespace V2_0 { |
| 28 | |
| 29 | namespace impl { |
| 30 | |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 31 | VehicleHal::VehiclePropValuePtr DefaultVehicleHal::get( |
| 32 | const VehiclePropValue& requestedPropValue, StatusCode* outStatus) { |
| 33 | *outStatus = StatusCode::OK; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 34 | |
| 35 | VehiclePropValuePtr v; |
Pavel Maltsev | 8e624b3 | 2017-02-01 16:30:25 -0800 | [diff] [blame] | 36 | auto property = static_cast<VehicleProperty>(requestedPropValue.prop); |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 37 | int32_t areaId = requestedPropValue.areaId; |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 38 | auto& pool = *getValuePool(); |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 39 | |
| 40 | switch (property) { |
| 41 | case VehicleProperty::INFO_MAKE: |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 42 | v = pool.obtainString("Default Car"); |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 43 | break; |
| 44 | case VehicleProperty::HVAC_FAN_SPEED: |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 45 | v = pool.obtainInt32(mFanSpeed); |
| 46 | break; |
| 47 | case VehicleProperty::HVAC_POWER_ON: |
| 48 | v = pool.obtainBoolean(mHvacPowerOn); |
| 49 | break; |
| 50 | case VehicleProperty::HVAC_RECIRC_ON: |
| 51 | v = pool.obtainBoolean(mHvacRecircOn); |
| 52 | break; |
| 53 | case VehicleProperty::HVAC_AC_ON: |
| 54 | v = pool.obtainBoolean(mHvacAcOn); |
| 55 | break; |
| 56 | case VehicleProperty::HVAC_AUTO_ON: |
| 57 | v = pool.obtainBoolean(mHvacAutoOn); |
| 58 | break; |
| 59 | case VehicleProperty::HVAC_FAN_DIRECTION: |
| 60 | v = pool.obtainInt32(toInt(mFanDirection)); |
| 61 | break; |
| 62 | case VehicleProperty::HVAC_DEFROSTER: |
| 63 | bool defroster; |
| 64 | *outStatus = getHvacDefroster(areaId, &defroster); |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 65 | if (StatusCode::OK == *outStatus) { |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 66 | v = pool.obtainBoolean(defroster); |
| 67 | } |
| 68 | break; |
| 69 | case VehicleProperty::HVAC_TEMPERATURE_SET: |
| 70 | float value; |
| 71 | *outStatus = getHvacTemperature(requestedPropValue.areaId, |
| 72 | &value); |
| 73 | if (StatusCode::OK == *outStatus) { |
| 74 | v = pool.obtainFloat(value); |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 75 | } |
| 76 | break; |
| 77 | case VehicleProperty::INFO_FUEL_CAPACITY: |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 78 | v = pool.obtainFloat(0.75f); |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 79 | break; |
| 80 | case VehicleProperty::DISPLAY_BRIGHTNESS: |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 81 | v = pool.obtainInt32(mBrightness); |
| 82 | break; |
| 83 | case VehicleProperty::NIGHT_MODE: |
| 84 | v = pool.obtainBoolean(false); |
| 85 | break; |
| 86 | case VehicleProperty::GEAR_SELECTION: |
| 87 | v = pool.obtainInt32(toInt(VehicleGear::GEAR_PARK)); |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 88 | break; |
Pavel Maltsev | b5e5109 | 2016-11-22 11:01:03 -0800 | [diff] [blame] | 89 | case VehicleProperty::DRIVING_STATUS: |
| 90 | v = pool.obtainInt32(toInt(VehicleDrivingStatus::UNRESTRICTED)); |
| 91 | break; |
Pavel Maltsev | d567a2a | 2016-12-14 16:07:29 -0800 | [diff] [blame] | 92 | case VehicleProperty::IGNITION_STATE: |
| 93 | v = pool.obtainInt32(toInt(VehicleIgnitionState::ACC)); |
| 94 | break; |
Enrico Granata | 4dcdf00 | 2017-01-11 11:47:37 -0800 | [diff] [blame] | 95 | case VehicleProperty::OBD2_LIVE_FRAME: |
| 96 | v = pool.obtainComplex(); |
| 97 | *outStatus = fillObd2LiveFrame(&v); |
| 98 | break; |
| 99 | case VehicleProperty::OBD2_FREEZE_FRAME: |
| 100 | v = pool.obtainComplex(); |
| 101 | *outStatus = fillObd2FreezeFrame(&v); |
| 102 | break; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 103 | default: |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 104 | *outStatus = StatusCode::INVALID_ARG; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 105 | } |
| 106 | |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 107 | if (StatusCode::OK == *outStatus && v.get() != nullptr) { |
Pavel Maltsev | 8e624b3 | 2017-02-01 16:30:25 -0800 | [diff] [blame] | 108 | v->prop = toInt(property); |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 109 | v->areaId = areaId; |
| 110 | v->timestamp = elapsedRealtimeNano(); |
| 111 | } |
| 112 | |
| 113 | return v; |
| 114 | } |
| 115 | |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 116 | StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) { |
Pavel Maltsev | 8e624b3 | 2017-02-01 16:30:25 -0800 | [diff] [blame] | 117 | auto property = static_cast<VehicleProperty>(propValue.prop); |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 118 | const auto& v = propValue.value; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 119 | |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 120 | StatusCode status = StatusCode::OK; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 121 | |
| 122 | switch (property) { |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 123 | case VehicleProperty::HVAC_POWER_ON: |
| 124 | mHvacPowerOn = v.int32Values[0] == 1; |
| 125 | break; |
| 126 | case VehicleProperty::HVAC_RECIRC_ON: |
| 127 | mHvacRecircOn = v.int32Values[0] == 1; |
| 128 | break; |
| 129 | case VehicleProperty::HVAC_AC_ON: |
| 130 | mHvacAcOn = v.int32Values[0] == 1; |
| 131 | break; |
| 132 | case VehicleProperty::HVAC_AUTO_ON: |
| 133 | mHvacAutoOn = v.int32Values[0] == 1; |
| 134 | break; |
| 135 | case VehicleProperty::HVAC_DEFROSTER: |
| 136 | status = setHvacDefroster(propValue.areaId, v.int32Values[0] == 1); |
| 137 | break; |
| 138 | case VehicleProperty::HVAC_FAN_DIRECTION: |
| 139 | mFanDirection = |
| 140 | static_cast<VehicleHvacFanDirection>(v.int32Values[0]); |
| 141 | break; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 142 | case VehicleProperty::HVAC_FAN_SPEED: |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 143 | mFanSpeed = v.int32Values[0]; |
| 144 | break; |
| 145 | case VehicleProperty::HVAC_TEMPERATURE_SET: |
| 146 | status = setHvacTemperature(propValue.areaId, v.floatValues[0]); |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 147 | break; |
| 148 | case VehicleProperty::DISPLAY_BRIGHTNESS: |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 149 | mBrightness = v.int32Values[0]; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 150 | break; |
| 151 | default: |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 152 | status = StatusCode::INVALID_ARG; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 153 | } |
| 154 | |
| 155 | return status; |
| 156 | } |
| 157 | |
Enrico Granata | adcb7c7 | 2017-01-25 12:07:15 -0800 | [diff] [blame] | 158 | void DefaultVehicleHal::onCreate() { |
| 159 | const auto& propConfigs(listProperties()); |
| 160 | auto obd2LiveFramePropConfig = std::find_if( |
| 161 | propConfigs.begin(), |
| 162 | propConfigs.end(), |
| 163 | [] (VehiclePropConfig config) -> bool { |
Martijn Coenen | ed6138f | 2017-02-03 09:15:25 +0100 | [diff] [blame] | 164 | return (config.prop == toInt(VehicleProperty::OBD2_LIVE_FRAME)); |
Enrico Granata | adcb7c7 | 2017-01-25 12:07:15 -0800 | [diff] [blame] | 165 | }); |
| 166 | mObd2SensorStore.reset(new Obd2SensorStore( |
| 167 | obd2LiveFramePropConfig->configArray[0], |
| 168 | obd2LiveFramePropConfig->configArray[1])); |
| 169 | // precalculate OBD2 sensor values |
| 170 | mObd2SensorStore->setIntegerSensor( |
| 171 | Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS, |
| 172 | toInt(FuelSystemStatus::CLOSED_LOOP)); |
| 173 | mObd2SensorStore->setIntegerSensor( |
| 174 | Obd2IntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0); |
| 175 | mObd2SensorStore->setIntegerSensor( |
| 176 | Obd2IntegerSensorIndex::IGNITION_MONITORS_SUPPORTED, |
| 177 | toInt(IgnitionMonitorKind::SPARK)); |
| 178 | mObd2SensorStore->setIntegerSensor(Obd2IntegerSensorIndex::IGNITION_SPECIFIC_MONITORS, |
| 179 | CommonIgnitionMonitors::COMPONENTS_AVAILABLE | |
| 180 | CommonIgnitionMonitors::MISFIRE_AVAILABLE | |
| 181 | SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE | |
| 182 | SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE); |
| 183 | mObd2SensorStore->setIntegerSensor( |
| 184 | Obd2IntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35); |
| 185 | mObd2SensorStore->setIntegerSensor( |
| 186 | Obd2IntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS, |
| 187 | toInt(SecondaryAirStatus::FROM_OUTSIDE_OR_OFF)); |
| 188 | mObd2SensorStore->setIntegerSensor( |
| 189 | Obd2IntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1); |
| 190 | mObd2SensorStore->setIntegerSensor( |
| 191 | Obd2IntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500); |
| 192 | mObd2SensorStore->setIntegerSensor( |
| 193 | Obd2IntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0); |
| 194 | mObd2SensorStore->setIntegerSensor( |
| 195 | Obd2IntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51); |
| 196 | mObd2SensorStore->setIntegerSensor( |
| 197 | Obd2IntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365); |
| 198 | mObd2SensorStore->setIntegerSensor( |
| 199 | Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30); |
| 200 | mObd2SensorStore->setIntegerSensor( |
| 201 | Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12); |
| 202 | mObd2SensorStore->setIntegerSensor( |
| 203 | Obd2IntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18); |
| 204 | mObd2SensorStore->setIntegerSensor( |
| 205 | Obd2IntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1); |
| 206 | mObd2SensorStore->setIntegerSensor( |
| 207 | Obd2IntegerSensorIndex::FUEL_TYPE, toInt(FuelType::GASOLINE)); |
| 208 | mObd2SensorStore->setFloatSensor( |
| 209 | Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153); |
| 210 | mObd2SensorStore->setFloatSensor( |
| 211 | Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16); |
| 212 | mObd2SensorStore->setFloatSensor( |
| 213 | Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16); |
| 214 | mObd2SensorStore->setFloatSensor( |
| 215 | Obd2FloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16); |
| 216 | mObd2SensorStore->setFloatSensor( |
| 217 | Obd2FloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16); |
| 218 | mObd2SensorStore->setFloatSensor( |
| 219 | Obd2FloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5); |
| 220 | mObd2SensorStore->setFloatSensor( |
| 221 | Obd2FloatSensorIndex::ENGINE_RPM, 1250.); |
| 222 | mObd2SensorStore->setFloatSensor( |
| 223 | Obd2FloatSensorIndex::VEHICLE_SPEED, 40.); |
| 224 | mObd2SensorStore->setFloatSensor( |
| 225 | Obd2FloatSensorIndex::TIMING_ADVANCE, 2.5); |
| 226 | mObd2SensorStore->setFloatSensor( |
| 227 | Obd2FloatSensorIndex::THROTTLE_POSITION, 19.75); |
| 228 | mObd2SensorStore->setFloatSensor( |
| 229 | Obd2FloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265); |
| 230 | mObd2SensorStore->setFloatSensor( |
| 231 | Obd2FloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824); |
| 232 | mObd2SensorStore->setFloatSensor( |
| 233 | Obd2FloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373); |
| 234 | mObd2SensorStore->setFloatSensor( |
| 235 | Obd2FloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.); |
| 236 | mObd2SensorStore->setFloatSensor( |
| 237 | Obd2FloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.); |
| 238 | mObd2SensorStore->setFloatSensor( |
| 239 | Obd2FloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306); |
| 240 | mObd2SensorStore->setFloatSensor( |
| 241 | Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188); |
| 242 | mObd2SensorStore->setFloatSensor( |
| 243 | Obd2FloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094); |
| 244 | mObd2SensorStore->setFloatSensor( |
| 245 | Obd2FloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024); |
| 246 | } |
| 247 | |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 248 | StatusCode DefaultVehicleHal::getHvacTemperature(int32_t areaId, |
| 249 | float* outValue) { |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 250 | if (areaId == toInt(VehicleAreaZone::ROW_1_LEFT)) { |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 251 | *outValue = mRow1LeftHvacTemperatureSet; |
| 252 | } else if (areaId == toInt(VehicleAreaZone::ROW_1_RIGHT)) { |
| 253 | *outValue = mRow1RightHvacTemperatureSet; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 254 | } else { |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 255 | return StatusCode::INVALID_ARG; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 256 | } |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 257 | return StatusCode::OK; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 258 | } |
| 259 | |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 260 | StatusCode DefaultVehicleHal::setHvacTemperature( |
| 261 | int32_t areaId, float value) { |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 262 | if (areaId == toInt(VehicleAreaZone::ROW_1_LEFT)) { |
Pavel Maltsev | 30c84c3 | 2016-11-14 16:23:36 -0800 | [diff] [blame] | 263 | mRow1LeftHvacTemperatureSet = value; |
| 264 | } else if (areaId == toInt(VehicleAreaZone::ROW_1_RIGHT)) { |
| 265 | mRow1RightHvacTemperatureSet = value; |
| 266 | } else { |
| 267 | return StatusCode::INVALID_ARG; |
| 268 | } |
| 269 | return StatusCode::OK; |
| 270 | } |
| 271 | |
| 272 | StatusCode DefaultVehicleHal::getHvacDefroster(int32_t areaId, |
| 273 | bool* outValue) { |
| 274 | ALOGI("Getting Hvac defroster for area: 0x%x", areaId); |
| 275 | |
| 276 | if (areaId == toInt(VehicleAreaWindow::FRONT_WINDSHIELD)) { |
| 277 | *outValue = mFrontDefroster; |
| 278 | } else if (areaId == toInt(VehicleAreaWindow::REAR_WINDSHIELD)) { |
| 279 | *outValue = mRearDefroster; |
| 280 | } else { |
| 281 | ALOGE("Unable to get hvac defroster for area: 0x%x", areaId); |
| 282 | return StatusCode::INVALID_ARG; |
| 283 | } |
| 284 | |
| 285 | ALOGI("Getting Hvac defroster for area: 0x%x, OK", areaId); |
| 286 | return StatusCode::OK; |
| 287 | } |
| 288 | |
| 289 | StatusCode DefaultVehicleHal::setHvacDefroster(int32_t areaId, bool value) { |
| 290 | if (areaId == toInt(VehicleAreaWindow::FRONT_WINDSHIELD)) { |
| 291 | mFrontDefroster = value; |
| 292 | } else if (areaId == toInt(VehicleAreaWindow::REAR_WINDSHIELD)) { |
| 293 | mRearDefroster = value; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 294 | } else { |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 295 | return StatusCode::INVALID_ARG; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 296 | } |
Pavel Maltsev | db179c5 | 2016-10-27 15:43:06 -0700 | [diff] [blame] | 297 | return StatusCode::OK; |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 298 | } |
| 299 | |
Enrico Granata | 4dcdf00 | 2017-01-11 11:47:37 -0800 | [diff] [blame] | 300 | StatusCode DefaultVehicleHal::fillObd2LiveFrame(VehiclePropValuePtr* v) { |
Enrico Granata | adcb7c7 | 2017-01-25 12:07:15 -0800 | [diff] [blame] | 301 | (*v)->value.int32Values = mObd2SensorStore->getIntegerSensors(); |
| 302 | (*v)->value.floatValues = mObd2SensorStore->getFloatSensors(); |
| 303 | (*v)->value.bytes = mObd2SensorStore->getSensorsBitmask(); |
Enrico Granata | 4dcdf00 | 2017-01-11 11:47:37 -0800 | [diff] [blame] | 304 | return StatusCode::OK; |
| 305 | } |
| 306 | |
| 307 | StatusCode DefaultVehicleHal::fillObd2FreezeFrame(VehiclePropValuePtr* v) { |
Enrico Granata | adcb7c7 | 2017-01-25 12:07:15 -0800 | [diff] [blame] | 308 | (*v)->value.int32Values = mObd2SensorStore->getIntegerSensors(); |
| 309 | (*v)->value.floatValues = mObd2SensorStore->getFloatSensors(); |
| 310 | (*v)->value.bytes = mObd2SensorStore->getSensorsBitmask(); |
Enrico Granata | 4dcdf00 | 2017-01-11 11:47:37 -0800 | [diff] [blame] | 311 | (*v)->value.stringValue = "P0010"; |
| 312 | return StatusCode::OK; |
| 313 | } |
| 314 | |
| 315 | |
Pavel Maltsev | e2603e3 | 2016-10-25 16:03:23 -0700 | [diff] [blame] | 316 | } // impl |
| 317 | |
| 318 | } // namespace V2_0 |
| 319 | } // namespace vehicle |
| 320 | } // namespace hardware |
| 321 | } // namespace android |