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 #ifndef android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_ 18 #define android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_ 19 20 #include <android/hardware/automotive/vehicle/2.0/types.h> 21 #include <vhal_v2_0/VehicleUtils.h> 22 23 #include <map> 24 25 namespace android { 26 namespace hardware { 27 namespace automotive { 28 namespace vehicle { 29 namespace V2_0 { 30 31 namespace impl { 32 // 33 // Some handy constants to avoid conversions from enum to int. 34 constexpr int ABS_ACTIVE = (int)VehicleProperty::ABS_ACTIVE; 35 constexpr int AP_POWER_STATE_REQ = (int)VehicleProperty::AP_POWER_STATE_REQ; 36 constexpr int AP_POWER_STATE_REPORT = (int)VehicleProperty::AP_POWER_STATE_REPORT; 37 constexpr int DOOR_1_LEFT = (int)VehicleAreaDoor::ROW_1_LEFT; 38 constexpr int DOOR_1_RIGHT = (int)VehicleAreaDoor::ROW_1_RIGHT; 39 constexpr int DOOR_2_LEFT = (int)VehicleAreaDoor::ROW_2_LEFT; 40 constexpr int DOOR_2_RIGHT = (int)VehicleAreaDoor::ROW_2_RIGHT; 41 constexpr int DOOR_REAR = (int)VehicleAreaDoor::REAR; 42 constexpr int WINDOW_1_LEFT = (int)VehicleAreaWindow::ROW_1_LEFT; 43 constexpr int WINDOW_1_RIGHT = (int)VehicleAreaWindow::ROW_1_RIGHT; 44 constexpr int WINDOW_2_LEFT = (int)VehicleAreaWindow::ROW_2_LEFT; 45 constexpr int WINDOW_2_RIGHT = (int)VehicleAreaWindow::ROW_2_RIGHT; 46 constexpr int WINDOW_ROOF_TOP_1 = (int)VehicleAreaWindow::ROOF_TOP_1; 47 constexpr int FAN_DIRECTION_FACE = (int)VehicleHvacFanDirection::FACE; 48 constexpr int FAN_DIRECTION_FLOOR = (int)VehicleHvacFanDirection::FLOOR; 49 constexpr int OBD2_LIVE_FRAME = (int)VehicleProperty::OBD2_LIVE_FRAME; 50 constexpr int OBD2_FREEZE_FRAME = (int)VehicleProperty::OBD2_FREEZE_FRAME; 51 constexpr int OBD2_FREEZE_FRAME_INFO = (int)VehicleProperty::OBD2_FREEZE_FRAME_INFO; 52 constexpr int OBD2_FREEZE_FRAME_CLEAR = (int)VehicleProperty::OBD2_FREEZE_FRAME_CLEAR; 53 constexpr int TRACTION_CONTROL_ACTIVE = (int)VehicleProperty::TRACTION_CONTROL_ACTIVE; 54 constexpr int VEHICLE_MAP_SERVICE = (int)VehicleProperty::VEHICLE_MAP_SERVICE; 55 constexpr int WHEEL_TICK = (int)VehicleProperty::WHEEL_TICK; 56 constexpr int ALL_WHEELS = 57 (int)(VehicleAreaWheel::LEFT_FRONT | VehicleAreaWheel::RIGHT_FRONT | 58 VehicleAreaWheel::LEFT_REAR | VehicleAreaWheel::RIGHT_REAR); 59 constexpr int SEAT_1_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT); 60 constexpr int SEAT_1_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT); 61 constexpr int HVAC_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_2_LEFT | 62 VehicleAreaSeat::ROW_2_CENTER); 63 constexpr int HVAC_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT | VehicleAreaSeat::ROW_2_RIGHT); 64 constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT; 65 constexpr int VENDOR_EXTENSION_BOOLEAN_PROPERTY = 66 (int)(0x101 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::BOOLEAN | VehicleArea::DOOR); 67 constexpr int VENDOR_EXTENSION_FLOAT_PROPERTY = 68 (int)(0x102 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::FLOAT | VehicleArea::SEAT); 69 constexpr int VENDOR_EXTENSION_INT_PROPERTY = 70 (int)(0x103 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::INT32 | VehicleArea::WINDOW); 71 constexpr int VENDOR_EXTENSION_STRING_PROPERTY = 72 (int)(0x104 | VehiclePropertyGroup::VENDOR | VehiclePropertyType::STRING | VehicleArea::GLOBAL); 73 constexpr int FUEL_DOOR_REAR_LEFT = (int)PortLocationType::REAR_LEFT; 74 constexpr int CHARGE_PORT_FRONT_LEFT = (int)PortLocationType::FRONT_LEFT; 75 constexpr int CHARGE_PORT_REAR_LEFT = (int)PortLocationType::REAR_LEFT; 76 constexpr int LIGHT_STATE_ON = (int)VehicleLightState::ON; 77 constexpr int LIGHT_SWITCH_AUTO = (int)VehicleLightSwitch::AUTOMATIC; 78 constexpr int WHEEL_FRONT_LEFT = (int)VehicleAreaWheel::LEFT_FRONT; 79 constexpr int WHEEL_FRONT_RIGHT = (int)VehicleAreaWheel::RIGHT_FRONT; 80 constexpr int WHEEL_REAR_LEFT = (int)VehicleAreaWheel::LEFT_REAR; 81 constexpr int WHEEL_REAR_RIGHT = (int)VehicleAreaWheel::RIGHT_REAR; 82 83 /** 84 * This property is used for test purpose to generate fake events. Here is the test package that 85 * is referencing this property definition: packages/services/Car/tests/vehiclehal_test 86 */ 87 const int32_t kGenerateFakeDataControllingProperty = 88 0x0666 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; 89 90 /** 91 * This property is used for test purpose to set properties' value from vehicle. 92 * For example: Mocking hard button press triggering a HVAC fan speed change. 93 * Android set kSetPropertyFromVehicleForTest with an array of integer {HVAC_FAN_SPEED, value of 94 * fan speed} and a long value indicates the timestamp of the events . 95 * It only works with integer type properties. 96 */ 97 const int32_t kSetIntPropertyFromVehicleForTest = 98 0x1112 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; 99 /** 100 * This property is used for test purpose to set properties' value from vehicle. 101 * It only works with float type properties. 102 */ 103 const int32_t kSetFloatPropertyFromVehicleForTest = 104 0x1113 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; 105 /** 106 * This property is used for test purpose to set properties' value from vehicle. 107 * It only works with boolean type properties. 108 */ 109 const int32_t kSetBooleanPropertyFromVehicleForTest = 110 0x1114 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; 111 112 /** 113 * This property is used for test purpose. End to end tests use this property to test set and get 114 * method for MIXED type properties. 115 */ 116 const int32_t kMixedTypePropertyForTest = 117 0x1111 | VehiclePropertyGroup::VENDOR | VehicleArea::GLOBAL | VehiclePropertyType::MIXED; 118 /** 119 * FakeDataCommand enum defines the supported command type for kGenerateFakeDataControllingProperty. 120 * All those commands can be send independently with each other. And each will override the one sent 121 * previously. 122 * 123 * The controlling property has the following format: 124 * 125 * int32Values[0] - command enum defined in FakeDataCommand 126 * 127 * The format of the arguments is defined for each command type as below: 128 */ 129 enum class FakeDataCommand : int32_t { 130 /** 131 * Starts linear fake data generation. Caller must provide additional data: 132 * int32Values[1] - vehicle property to which command applies 133 * int64Values[0] - periodic interval in nanoseconds 134 * floatValues[0] - initial value 135 * floatValues[1] - dispersion defines the min/max value relative to initial value, where 136 * max = initial_value + dispersion, min = initial_value - dispersion. 137 * Dispersion should be non-negative, otherwise the behavior is undefined. 138 * floatValues[2] - increment, with every timer tick the value will be incremented by this 139 * amount. When reaching to max value, the current value will be set to 140 * min. It should be non-negative, otherwise the behavior is undefined. 141 */ 142 StartLinear = 0, 143 144 /** Stops linear fake data generation that was triggered by StartLinear commands. 145 * int32Values[1] - vehicle property to which command applies. VHAL will stop the 146 * corresponding linear generation for that property. 147 */ 148 StopLinear = 1, 149 150 /** 151 * Starts JSON-based fake data generation. It iterates through JSON-encoded VHAL events from a 152 * file and inject them to VHAL. The iteration can be repeated multiple times or infinitely. 153 * Caller must provide additional data: 154 * int32Values[1] - number of iterations. If it is not provided or -1. The iteration will be 155 * repeated infinite times. 156 * stringValue - path to the fake values JSON file 157 */ 158 StartJson = 2, 159 160 /** 161 * Stops JSON-based fake data generation. As multiple JSON-based generation can happen at the 162 * same time. Caller must provide the path of fake value JSON file to stop the corresponding 163 * generation: 164 * stringValue - path to the fake values JSON file 165 */ 166 StopJson = 3, 167 168 /** 169 * Injects key press event (HAL incorporates UP/DOWN acction and triggers 2 HAL events for every 170 * key-press). We set the enum with high number to leave space for future start/stop commands. 171 * Caller must provide the following data: 172 * int32Values[2] - Android key code 173 * int32Values[3] - target display (0 - for main display, 1 - for instrument cluster, see 174 * VehicleDisplay) 175 */ 176 KeyPress = 100, 177 }; 178 179 const int32_t kHvacPowerProperties[] = { 180 toInt(VehicleProperty::HVAC_FAN_SPEED), 181 toInt(VehicleProperty::HVAC_FAN_DIRECTION), 182 }; 183 184 struct ConfigDeclaration { 185 VehiclePropConfig config; 186 187 /* This value will be used as an initial value for the property. If this field is specified for 188 * property that supports multiple areas then it will be used for all areas unless particular 189 * area is overridden in initialAreaValue field. */ 190 VehiclePropValue::RawValue initialValue; 191 /* Use initialAreaValues if it is necessary to specify different values per each area. */ 192 std::map<int32_t, VehiclePropValue::RawValue> initialAreaValues; 193 }; 194 195 const ConfigDeclaration kVehicleProperties[]{ 196 {.config = 197 { 198 .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), 199 .access = VehiclePropertyAccess::READ, 200 .changeMode = VehiclePropertyChangeMode::STATIC, 201 }, 202 .initialValue = {.floatValues = {15000.0f}}}, 203 204 {.config = 205 { 206 .prop = toInt(VehicleProperty::INFO_FUEL_TYPE), 207 .access = VehiclePropertyAccess::READ, 208 .changeMode = VehiclePropertyChangeMode::STATIC, 209 }, 210 .initialValue = {.int32Values = {(int)FuelType::FUEL_TYPE_UNLEADED}}}, 211 212 {.config = 213 { 214 .prop = toInt(VehicleProperty::INFO_EV_BATTERY_CAPACITY), 215 .access = VehiclePropertyAccess::READ, 216 .changeMode = VehiclePropertyChangeMode::STATIC, 217 }, 218 .initialValue = {.floatValues = {150000.0f}}}, 219 220 {.config = 221 { 222 .prop = toInt(VehicleProperty::INFO_EV_CONNECTOR_TYPE), 223 .access = VehiclePropertyAccess::READ, 224 .changeMode = VehiclePropertyChangeMode::STATIC, 225 }, 226 .initialValue = {.int32Values = {(int)EvConnectorType::IEC_TYPE_1_AC}}}, 227 228 {.config = 229 { 230 .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT), 231 .access = VehiclePropertyAccess::READ, 232 .changeMode = VehiclePropertyChangeMode::STATIC, 233 }, 234 .initialValue = {.int32Values = {SEAT_1_LEFT}}}, 235 236 {.config = 237 { 238 .prop = toInt(VehicleProperty::INFO_FUEL_DOOR_LOCATION), 239 .access = VehiclePropertyAccess::READ, 240 .changeMode = VehiclePropertyChangeMode::STATIC, 241 }, 242 .initialValue = {.int32Values = {FUEL_DOOR_REAR_LEFT}}}, 243 244 {.config = 245 { 246 .prop = toInt(VehicleProperty::INFO_EV_PORT_LOCATION), 247 .access = VehiclePropertyAccess::READ, 248 .changeMode = VehiclePropertyChangeMode::STATIC, 249 }, 250 .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT}}}, 251 252 {.config = 253 { 254 .prop = toInt(VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS), 255 .access = VehiclePropertyAccess::READ, 256 .changeMode = VehiclePropertyChangeMode::STATIC, 257 }, 258 .initialValue = {.int32Values = {CHARGE_PORT_FRONT_LEFT, CHARGE_PORT_REAR_LEFT}}}, 259 260 {.config = 261 { 262 .prop = toInt(VehicleProperty::INFO_MAKE), 263 .access = VehiclePropertyAccess::READ, 264 .changeMode = VehiclePropertyChangeMode::STATIC, 265 }, 266 .initialValue = {.stringValue = "Toy Vehicle"}}, 267 {.config = 268 { 269 .prop = toInt(VehicleProperty::INFO_MODEL), 270 .access = VehiclePropertyAccess::READ, 271 .changeMode = VehiclePropertyChangeMode::STATIC, 272 }, 273 .initialValue = {.stringValue = "Speedy Model"}}, 274 {.config = 275 { 276 .prop = toInt(VehicleProperty::INFO_MODEL_YEAR), 277 .access = VehiclePropertyAccess::READ, 278 .changeMode = VehiclePropertyChangeMode::STATIC, 279 }, 280 .initialValue = {.int32Values = {2020}}}, 281 {.config = 282 { 283 .prop = toInt(VehicleProperty::INFO_EXTERIOR_DIMENSIONS), 284 .access = VehiclePropertyAccess::READ, 285 .changeMode = VehiclePropertyChangeMode::STATIC, 286 }, 287 .initialValue = {.floatValues = {1776, 4950, 2008, 2140, 2984, 1665, 1667, 11800}}}, 288 {.config = 289 { 290 .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED), 291 .access = VehiclePropertyAccess::READ, 292 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 293 .minSampleRate = 1.0f, 294 .maxSampleRate = 10.0f, 295 }, 296 .initialValue = {.floatValues = {0.0f}}}, 297 298 {.config = 299 { 300 .prop = toInt(VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS), 301 .access = VehiclePropertyAccess::READ_WRITE, 302 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 303 .configArray = {(int)VehicleUnit::METER_PER_SEC, 304 (int)VehicleUnit::MILES_PER_HOUR, 305 (int)VehicleUnit::KILOMETERS_PER_HOUR}, 306 }, 307 .initialValue = {.int32Values = {(int)VehicleUnit::KILOMETERS_PER_HOUR}}}, 308 309 {.config = 310 { 311 .prop = toInt(VehicleProperty::INFO_DRIVER_SEAT), 312 .access = VehiclePropertyAccess::READ, 313 .changeMode = VehiclePropertyChangeMode::STATIC, 314 // this was a zoned property on an old vhal, but it is meant to be global 315 .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, 316 }, 317 .initialValue = {.int32Values = {SEAT_1_LEFT}}}, 318 319 {.config = 320 { 321 .prop = toInt(VehicleProperty::PERF_ODOMETER), 322 .access = VehiclePropertyAccess::READ, 323 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 324 .minSampleRate = 0.0f, 325 .maxSampleRate = 10.0f, 326 }, 327 .initialValue = {.floatValues = {0.0f}}}, 328 {.config = 329 { 330 .prop = toInt(VehicleProperty::PERF_STEERING_ANGLE), 331 .access = VehiclePropertyAccess::READ, 332 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 333 .minSampleRate = 0.0f, 334 .maxSampleRate = 10.0f, 335 }, 336 .initialValue = {.floatValues = {0.0f}}}, 337 {.config = 338 { 339 .prop = toInt(VehicleProperty::PERF_REAR_STEERING_ANGLE), 340 .access = VehiclePropertyAccess::READ, 341 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 342 .minSampleRate = 0.0f, 343 .maxSampleRate = 10.0f, 344 }, 345 .initialValue = {.floatValues = {0.0f}}}, 346 { 347 .config = 348 { 349 .prop = toInt(VehicleProperty::ENGINE_RPM), 350 .access = VehiclePropertyAccess::READ, 351 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 352 .minSampleRate = 1.0f, 353 .maxSampleRate = 10.0f, 354 }, 355 .initialValue = {.floatValues = {0.0f}}, 356 }, 357 358 {.config = 359 { 360 .prop = toInt(VehicleProperty::FUEL_LEVEL), 361 .access = VehiclePropertyAccess::READ, 362 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 363 .minSampleRate = 0.0f, 364 .maxSampleRate = 100.0f, 365 }, 366 .initialValue = {.floatValues = {15000.0f}}}, 367 368 {.config = 369 { 370 .prop = toInt(VehicleProperty::FUEL_DOOR_OPEN), 371 .access = VehiclePropertyAccess::READ_WRITE, 372 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 373 }, 374 .initialValue = {.int32Values = {0}}}, 375 376 {.config = 377 { 378 .prop = toInt(VehicleProperty::EV_BATTERY_LEVEL), 379 .access = VehiclePropertyAccess::READ, 380 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 381 .minSampleRate = 0.0f, 382 .maxSampleRate = 100.0f, 383 }, 384 .initialValue = {.floatValues = {150000.0f}}}, 385 386 {.config = 387 { 388 .prop = toInt(VehicleProperty::EV_CHARGE_PORT_OPEN), 389 .access = VehiclePropertyAccess::READ_WRITE, 390 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 391 }, 392 .initialValue = {.int32Values = {0}}}, 393 394 {.config = 395 { 396 .prop = toInt(VehicleProperty::EV_CHARGE_PORT_CONNECTED), 397 .access = VehiclePropertyAccess::READ, 398 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 399 }, 400 .initialValue = {.int32Values = {0}}}, 401 402 {.config = 403 { 404 .prop = toInt(VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE), 405 .access = VehiclePropertyAccess::READ, 406 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 407 .minSampleRate = 1.0f, 408 .maxSampleRate = 10.0f, 409 }, 410 .initialValue = {.floatValues = {0.0f}}}, 411 412 {.config = 413 { 414 .prop = toInt(VehicleProperty::RANGE_REMAINING), 415 .access = VehiclePropertyAccess::READ_WRITE, 416 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 417 .minSampleRate = 1.0f, 418 .maxSampleRate = 2.0f, 419 }, 420 .initialValue = {.floatValues = {50000.0f}}}, // units in meters 421 422 {.config = 423 { 424 .prop = toInt(VehicleProperty::TIRE_PRESSURE), 425 .access = VehiclePropertyAccess::READ, 426 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 427 .areaConfigs = {VehicleAreaConfig{ 428 .areaId = WHEEL_FRONT_LEFT, 429 .minFloatValue = 100.0f, 430 .maxFloatValue = 300.0f, 431 }, 432 VehicleAreaConfig{ 433 .areaId = WHEEL_FRONT_RIGHT, 434 .minFloatValue = 100.0f, 435 .maxFloatValue = 300.0f, 436 }, 437 VehicleAreaConfig{ 438 .areaId = WHEEL_REAR_LEFT, 439 .minFloatValue = 100.0f, 440 .maxFloatValue = 300.0f, 441 }, 442 VehicleAreaConfig{ 443 .areaId = WHEEL_REAR_RIGHT, 444 .minFloatValue = 100.0f, 445 .maxFloatValue = 300.0f, 446 }}, 447 .minSampleRate = 1.0f, 448 .maxSampleRate = 2.0f, 449 }, 450 .initialValue = {.floatValues = {200.0f}}}, // units in kPa 451 452 {.config = 453 { 454 .prop = toInt(VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS), 455 .access = VehiclePropertyAccess::READ_WRITE, 456 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 457 .configArray = {(int)VehicleUnit::KILOPASCAL, (int)VehicleUnit::PSI, 458 (int)VehicleUnit::BAR}, 459 }, 460 .initialValue = {.int32Values = {toInt(VehicleUnit::PSI)}}}, 461 462 {.config = 463 { 464 .prop = toInt(VehicleProperty::CURRENT_GEAR), 465 .access = VehiclePropertyAccess::READ, 466 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 467 }, 468 .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, 469 470 {.config = 471 { 472 .prop = toInt(VehicleProperty::PARKING_BRAKE_ON), 473 .access = VehiclePropertyAccess::READ, 474 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 475 }, 476 .initialValue = {.int32Values = {1}}}, 477 478 {.config = 479 { 480 .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW), 481 .access = VehiclePropertyAccess::READ, 482 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 483 }, 484 .initialValue = {.int32Values = {0}}}, 485 486 {.config = 487 { 488 .prop = toInt(VehicleProperty::HW_KEY_INPUT), 489 .access = VehiclePropertyAccess::READ, 490 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 491 }, 492 .initialValue = {.int32Values = {0, 0, 0}}}, 493 494 {.config = 495 { 496 .prop = toInt(VehicleProperty::HW_ROTARY_INPUT), 497 .access = VehiclePropertyAccess::READ, 498 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 499 }, 500 .initialValue = {.int32Values = {0, 0, 0}}}, 501 502 {.config = {.prop = toInt(VehicleProperty::HVAC_POWER_ON), 503 .access = VehiclePropertyAccess::READ_WRITE, 504 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 505 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}, 506 // TODO(bryaneyler): Ideally, this is generated dynamically from 507 // kHvacPowerProperties. 508 .configArray = {toInt(VehicleProperty::HVAC_FAN_SPEED), 509 toInt(VehicleProperty::HVAC_FAN_DIRECTION)}}, 510 .initialValue = {.int32Values = {1}}}, 511 512 { 513 .config = {.prop = toInt(VehicleProperty::HVAC_DEFROSTER), 514 .access = VehiclePropertyAccess::READ_WRITE, 515 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 516 .areaConfigs = 517 {VehicleAreaConfig{ 518 .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)}, 519 VehicleAreaConfig{ 520 .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}}, 521 .initialValue = {.int32Values = {0}} // Will be used for all areas. 522 }, 523 { 524 .config = {.prop = toInt(VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON), 525 .access = VehiclePropertyAccess::READ_WRITE, 526 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 527 .areaConfigs = 528 {VehicleAreaConfig{ 529 .areaId = toInt(VehicleAreaWindow::FRONT_WINDSHIELD)}, 530 VehicleAreaConfig{ 531 .areaId = toInt(VehicleAreaWindow::REAR_WINDSHIELD)}}}, 532 .initialValue = {.int32Values = {0}} // Will be used for all areas. 533 }, 534 535 {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_DEFROST_ON), 536 .access = VehiclePropertyAccess::READ_WRITE, 537 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 538 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 539 .initialValue = {.int32Values = {0}}}, 540 541 {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON), 542 .access = VehiclePropertyAccess::READ_WRITE, 543 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 544 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 545 .initialValue = {.int32Values = {1}}}, 546 547 {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON), 548 .access = VehiclePropertyAccess::READ_WRITE, 549 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 550 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 551 .initialValue = {.int32Values = {0}}}, 552 553 {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON), 554 .access = VehiclePropertyAccess::READ_WRITE, 555 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 556 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 557 .initialValue = {.int32Values = {1}}}, 558 559 {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_AC_ON), 560 .access = VehiclePropertyAccess::READ_WRITE, 561 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 562 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 563 .initialValue = {.int32Values = {0}}}, 564 565 {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON), 566 .access = VehiclePropertyAccess::READ_WRITE, 567 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 568 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 569 .initialValue = {.int32Values = {1}}}, 570 571 {.config = {.prop = toInt(VehicleProperty::HVAC_DUAL_ON), 572 .access = VehiclePropertyAccess::READ_WRITE, 573 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 574 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 575 .initialValue = {.int32Values = {0}}}, 576 577 {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), 578 .access = VehiclePropertyAccess::READ_WRITE, 579 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 580 .areaConfigs = {VehicleAreaConfig{ 581 .areaId = HVAC_ALL, .minInt32Value = 1, .maxInt32Value = 7}}}, 582 .initialValue = {.int32Values = {3}}}, 583 584 {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION), 585 .access = VehiclePropertyAccess::READ_WRITE, 586 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 587 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 588 .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}}, 589 590 {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE), 591 .access = VehiclePropertyAccess::READ, 592 .changeMode = VehiclePropertyChangeMode::STATIC, 593 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, 594 .initialValue = {.int32Values = {FAN_DIRECTION_FACE, FAN_DIRECTION_FLOOR, 595 FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR}}}, 596 597 {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_VENTILATION), 598 .access = VehiclePropertyAccess::READ_WRITE, 599 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 600 .areaConfigs = {VehicleAreaConfig{ 601 .areaId = SEAT_1_LEFT, 602 .minInt32Value = 0, 603 .maxInt32Value = 3, 604 }, 605 VehicleAreaConfig{ 606 .areaId = SEAT_1_RIGHT, 607 .minInt32Value = 0, 608 .maxInt32Value = 3, 609 }}}, 610 .initialValue = 611 {.int32Values = {0}}}, // 0 is off and +ve values indicate ventilation level. 612 613 {.config = {.prop = toInt(VehicleProperty::HVAC_STEERING_WHEEL_HEAT), 614 .access = VehiclePropertyAccess::READ_WRITE, 615 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 616 .areaConfigs = {VehicleAreaConfig{ 617 .areaId = (0), .minInt32Value = -2, .maxInt32Value = 2}}}, 618 .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling 619 620 {.config = {.prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE), 621 .access = VehiclePropertyAccess::READ_WRITE, 622 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 623 .areaConfigs = {VehicleAreaConfig{ 624 .areaId = SEAT_1_LEFT, 625 .minInt32Value = -2, 626 .maxInt32Value = 2, 627 }, 628 VehicleAreaConfig{ 629 .areaId = SEAT_1_RIGHT, 630 .minInt32Value = -2, 631 .maxInt32Value = 2, 632 }}}, 633 .initialValue = {.int32Values = {0}}}, // +ve values for heating and -ve for cooling 634 635 {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), 636 .access = VehiclePropertyAccess::READ_WRITE, 637 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 638 .areaConfigs = {VehicleAreaConfig{ 639 .areaId = HVAC_LEFT, 640 .minFloatValue = 16, 641 .maxFloatValue = 32, 642 }, 643 VehicleAreaConfig{ 644 .areaId = HVAC_RIGHT, 645 .minFloatValue = 16, 646 .maxFloatValue = 32, 647 }}}, 648 .initialAreaValues = {{HVAC_LEFT, {.floatValues = {16}}}, 649 {HVAC_RIGHT, {.floatValues = {20}}}}}, 650 651 {.config = 652 { 653 .prop = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE), 654 .access = VehiclePropertyAccess::READ, 655 // TODO(bryaneyler): Support ON_CHANGE as well. 656 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 657 .minSampleRate = 1.0f, 658 .maxSampleRate = 2.0f, 659 }, 660 .initialValue = {.floatValues = {25.0f}}}, 661 662 {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS), 663 .access = VehiclePropertyAccess::READ_WRITE, 664 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 665 .configArray = {(int)VehicleUnit::FAHRENHEIT, (int)VehicleUnit::CELSIUS}}, 666 .initialValue = {.int32Values = {(int)VehicleUnit::FAHRENHEIT}}}, 667 668 {.config = 669 { 670 .prop = toInt(VehicleProperty::DISTANCE_DISPLAY_UNITS), 671 .access = VehiclePropertyAccess::READ_WRITE, 672 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 673 .areaConfigs = {VehicleAreaConfig{.areaId = (0)}}, 674 .configArray = {(int)VehicleUnit::KILOMETER, (int)VehicleUnit::MILE}, 675 }, 676 .initialValue = {.int32Values = {(int)VehicleUnit::MILE}}}, 677 678 {.config = 679 { 680 .prop = toInt(VehicleProperty::NIGHT_MODE), 681 .access = VehiclePropertyAccess::READ, 682 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 683 }, 684 .initialValue = {.int32Values = {0}}}, 685 686 {.config = 687 { 688 .prop = toInt(VehicleProperty::GEAR_SELECTION), 689 .access = VehiclePropertyAccess::READ, 690 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 691 .configArray = {(int)VehicleGear::GEAR_PARK, 692 (int)VehicleGear::GEAR_NEUTRAL, 693 (int)VehicleGear::GEAR_REVERSE, 694 (int)VehicleGear::GEAR_DRIVE, (int)VehicleGear::GEAR_1, 695 (int)VehicleGear::GEAR_2, (int)VehicleGear::GEAR_3, 696 (int)VehicleGear::GEAR_4, (int)VehicleGear::GEAR_5}, 697 }, 698 .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, 699 700 {.config = 701 { 702 .prop = toInt(VehicleProperty::TURN_SIGNAL_STATE), 703 .access = VehiclePropertyAccess::READ, 704 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 705 }, 706 .initialValue = {.int32Values = {toInt(VehicleTurnSignal::NONE)}}}, 707 708 {.config = 709 { 710 .prop = toInt(VehicleProperty::IGNITION_STATE), 711 .access = VehiclePropertyAccess::READ, 712 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 713 }, 714 .initialValue = {.int32Values = {toInt(VehicleIgnitionState::ON)}}}, 715 716 {.config = 717 { 718 .prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL), 719 .access = VehiclePropertyAccess::READ, 720 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 721 }, 722 .initialValue = {.int32Values = {toInt(VehicleOilLevel::NORMAL)}}}, 723 724 {.config = 725 { 726 .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP), 727 .access = VehiclePropertyAccess::READ, 728 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 729 .minSampleRate = 0.1, // 0.1 Hz, every 10 seconds 730 .maxSampleRate = 10, // 10 Hz, every 100 ms 731 }, 732 .initialValue = {.floatValues = {101.0f}}}, 733 734 { 735 .config = 736 { 737 .prop = kGenerateFakeDataControllingProperty, 738 .access = VehiclePropertyAccess::WRITE, 739 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 740 .configArray = {1, 0, 0, 2, 0, 0, 0, 0, 0}, 741 }, 742 }, 743 744 { 745 .config = 746 { 747 .prop = kSetIntPropertyFromVehicleForTest, 748 .access = VehiclePropertyAccess::WRITE, 749 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 750 .configArray = {0, 0, 0, 2, 1, 0, 0, 0, 0}, 751 }, 752 }, 753 754 { 755 .config = 756 { 757 .prop = kSetFloatPropertyFromVehicleForTest, 758 .access = VehiclePropertyAccess::WRITE, 759 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 760 .configArray = {0, 0, 1, 0, 1, 0, 1, 0, 0}, 761 }, 762 }, 763 764 { 765 .config = 766 { 767 .prop = kSetBooleanPropertyFromVehicleForTest, 768 .access = VehiclePropertyAccess::WRITE, 769 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 770 .configArray = {0, 1, 1, 0, 1, 0, 0, 0, 0}, 771 }, 772 }, 773 774 { 775 .config = {.prop = kMixedTypePropertyForTest, 776 .access = VehiclePropertyAccess::READ_WRITE, 777 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 778 .configArray = {1, 1, 0, 2, 0, 0, 1, 0, 0}}, 779 .initialValue = 780 { 781 .int32Values = {1 /* indicate TRUE boolean value */, 2, 3}, 782 .floatValues = {4.5f}, 783 .stringValue = "MIXED property", 784 }, 785 }, 786 787 {.config = {.prop = toInt(VehicleProperty::DOOR_LOCK), 788 .access = VehiclePropertyAccess::READ_WRITE, 789 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 790 .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT}, 791 VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, 792 VehicleAreaConfig{.areaId = DOOR_2_LEFT}, 793 VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, 794 .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, 795 {DOOR_1_RIGHT, {.int32Values = {1}}}, 796 {DOOR_2_LEFT, {.int32Values = {1}}}, 797 {DOOR_2_RIGHT, {.int32Values = {1}}}}}, 798 799 {.config = {.prop = toInt(VehicleProperty::DOOR_POS), 800 .access = VehiclePropertyAccess::READ_WRITE, 801 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 802 .areaConfigs = 803 {VehicleAreaConfig{ 804 .areaId = DOOR_1_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, 805 VehicleAreaConfig{.areaId = DOOR_1_RIGHT, 806 .minInt32Value = 0, 807 .maxInt32Value = 1}, 808 VehicleAreaConfig{ 809 .areaId = DOOR_2_LEFT, .minInt32Value = 0, .maxInt32Value = 1}, 810 VehicleAreaConfig{.areaId = DOOR_2_RIGHT, 811 .minInt32Value = 0, 812 .maxInt32Value = 1}, 813 VehicleAreaConfig{ 814 .areaId = DOOR_REAR, .minInt32Value = 0, .maxInt32Value = 1}}}, 815 .initialValue = {.int32Values = {0}}}, 816 817 {.config = {.prop = toInt(VehicleProperty::WINDOW_LOCK), 818 .access = VehiclePropertyAccess::READ_WRITE, 819 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 820 .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_RIGHT | WINDOW_2_LEFT | 821 WINDOW_2_RIGHT}}}, 822 .initialAreaValues = {{WINDOW_1_RIGHT | WINDOW_2_LEFT | WINDOW_2_RIGHT, 823 {.int32Values = {0}}}}}, 824 825 {.config = {.prop = toInt(VehicleProperty::WINDOW_POS), 826 .access = VehiclePropertyAccess::READ_WRITE, 827 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 828 .areaConfigs = {VehicleAreaConfig{.areaId = WINDOW_1_LEFT, 829 .minInt32Value = 0, 830 .maxInt32Value = 10}, 831 VehicleAreaConfig{.areaId = WINDOW_1_RIGHT, 832 .minInt32Value = 0, 833 .maxInt32Value = 10}, 834 VehicleAreaConfig{.areaId = WINDOW_2_LEFT, 835 .minInt32Value = 0, 836 .maxInt32Value = 10}, 837 VehicleAreaConfig{.areaId = WINDOW_2_RIGHT, 838 .minInt32Value = 0, 839 .maxInt32Value = 10}, 840 VehicleAreaConfig{.areaId = WINDOW_ROOF_TOP_1, 841 .minInt32Value = -10, 842 .maxInt32Value = 10}}}, 843 .initialValue = {.int32Values = {0}}}, 844 845 {.config = 846 { 847 .prop = WHEEL_TICK, 848 .access = VehiclePropertyAccess::READ, 849 .changeMode = VehiclePropertyChangeMode::CONTINUOUS, 850 .configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000}, 851 .minSampleRate = 1.0f, 852 .maxSampleRate = 10.0f, 853 }, 854 .initialValue = {.int64Values = {0, 100000, 200000, 300000, 400000}}}, 855 856 {.config = {.prop = ABS_ACTIVE, 857 .access = VehiclePropertyAccess::READ, 858 .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, 859 .initialValue = {.int32Values = {0}}}, 860 861 {.config = {.prop = TRACTION_CONTROL_ACTIVE, 862 .access = VehiclePropertyAccess::READ, 863 .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, 864 .initialValue = {.int32Values = {0}}}, 865 866 {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), 867 .access = VehiclePropertyAccess::READ, 868 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 869 .configArray = {3}}, 870 .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON), 0}}}, 871 872 {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), 873 .access = VehiclePropertyAccess::READ_WRITE, 874 .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, 875 .initialValue = {.int32Values = {toInt(VehicleApPowerStateReport::WAIT_FOR_VHAL), 0}}}, 876 877 {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), 878 .access = VehiclePropertyAccess::READ_WRITE, 879 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 880 .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 100}}}, 881 .initialValue = {.int32Values = {100}}}, 882 883 { 884 .config = {.prop = OBD2_LIVE_FRAME, 885 .access = VehiclePropertyAccess::READ, 886 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 887 .configArray = {0, 0}}, 888 }, 889 890 { 891 .config = {.prop = OBD2_FREEZE_FRAME, 892 .access = VehiclePropertyAccess::READ, 893 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 894 .configArray = {0, 0}}, 895 }, 896 897 { 898 .config = {.prop = OBD2_FREEZE_FRAME_INFO, 899 .access = VehiclePropertyAccess::READ, 900 .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, 901 }, 902 903 { 904 .config = {.prop = OBD2_FREEZE_FRAME_CLEAR, 905 .access = VehiclePropertyAccess::WRITE, 906 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 907 .configArray = {1}}, 908 }, 909 910 {.config = 911 { 912 .prop = toInt(VehicleProperty::HEADLIGHTS_STATE), 913 .access = VehiclePropertyAccess::READ, 914 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 915 }, 916 .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, 917 918 {.config = 919 { 920 .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_STATE), 921 .access = VehiclePropertyAccess::READ, 922 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 923 }, 924 .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, 925 926 {.config = 927 { 928 .prop = toInt(VehicleProperty::FOG_LIGHTS_STATE), 929 .access = VehiclePropertyAccess::READ, 930 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 931 }, 932 .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, 933 934 {.config = 935 { 936 .prop = toInt(VehicleProperty::HAZARD_LIGHTS_STATE), 937 .access = VehiclePropertyAccess::READ, 938 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 939 }, 940 .initialValue = {.int32Values = {LIGHT_STATE_ON}}}, 941 942 {.config = 943 { 944 .prop = toInt(VehicleProperty::HEADLIGHTS_SWITCH), 945 .access = VehiclePropertyAccess::READ_WRITE, 946 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 947 }, 948 .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, 949 950 {.config = 951 { 952 .prop = toInt(VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH), 953 .access = VehiclePropertyAccess::READ_WRITE, 954 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 955 }, 956 .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, 957 958 {.config = 959 { 960 .prop = toInt(VehicleProperty::FOG_LIGHTS_SWITCH), 961 .access = VehiclePropertyAccess::READ_WRITE, 962 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 963 }, 964 .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, 965 966 {.config = 967 { 968 .prop = toInt(VehicleProperty::HAZARD_LIGHTS_SWITCH), 969 .access = VehiclePropertyAccess::READ_WRITE, 970 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 971 }, 972 .initialValue = {.int32Values = {LIGHT_SWITCH_AUTO}}}, 973 974 {.config = {.prop = VEHICLE_MAP_SERVICE, 975 .access = VehiclePropertyAccess::READ_WRITE, 976 .changeMode = VehiclePropertyChangeMode::ON_CHANGE}}, 977 978 // Example Vendor Extension properties for testing 979 {.config = {.prop = VENDOR_EXTENSION_BOOLEAN_PROPERTY, 980 .access = VehiclePropertyAccess::READ_WRITE, 981 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 982 .areaConfigs = {VehicleAreaConfig{.areaId = DOOR_1_LEFT}, 983 VehicleAreaConfig{.areaId = DOOR_1_RIGHT}, 984 VehicleAreaConfig{.areaId = DOOR_2_LEFT}, 985 VehicleAreaConfig{.areaId = DOOR_2_RIGHT}}}, 986 .initialAreaValues = {{DOOR_1_LEFT, {.int32Values = {1}}}, 987 {DOOR_1_RIGHT, {.int32Values = {1}}}, 988 {DOOR_2_LEFT, {.int32Values = {0}}}, 989 {DOOR_2_RIGHT, {.int32Values = {0}}}}}, 990 991 {.config = {.prop = VENDOR_EXTENSION_FLOAT_PROPERTY, 992 .access = VehiclePropertyAccess::READ_WRITE, 993 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 994 .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_LEFT, 995 .minFloatValue = -10, 996 .maxFloatValue = 10}, 997 VehicleAreaConfig{.areaId = HVAC_RIGHT, 998 .minFloatValue = -10, 999 .maxFloatValue = 10}}}, 1000 .initialAreaValues = {{HVAC_LEFT, {.floatValues = {1}}}, 1001 {HVAC_RIGHT, {.floatValues = {2}}}}}, 1002 1003 {.config = {.prop = VENDOR_EXTENSION_INT_PROPERTY, 1004 .access = VehiclePropertyAccess::READ_WRITE, 1005 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 1006 .areaConfigs = 1007 {VehicleAreaConfig{.areaId = (int)VehicleAreaWindow::FRONT_WINDSHIELD, 1008 .minInt32Value = -100, 1009 .maxInt32Value = 100}, 1010 VehicleAreaConfig{.areaId = (int)VehicleAreaWindow::REAR_WINDSHIELD, 1011 .minInt32Value = -100, 1012 .maxInt32Value = 100}, 1013 VehicleAreaConfig{.areaId = (int)VehicleAreaWindow::ROOF_TOP_1, 1014 .minInt32Value = -100, 1015 .maxInt32Value = 100}}}, 1016 .initialAreaValues = {{(int)VehicleAreaWindow::FRONT_WINDSHIELD, {.int32Values = {1}}}, 1017 {(int)VehicleAreaWindow::REAR_WINDSHIELD, {.int32Values = {0}}}, 1018 {(int)VehicleAreaWindow::ROOF_TOP_1, {.int32Values = {-1}}}}}, 1019 1020 {.config = {.prop = VENDOR_EXTENSION_STRING_PROPERTY, 1021 .access = VehiclePropertyAccess::READ_WRITE, 1022 .changeMode = VehiclePropertyChangeMode::ON_CHANGE}, 1023 .initialValue = {.stringValue = "Vendor String Property"}}, 1024 1025 {.config = 1026 { 1027 .prop = toInt(VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION), 1028 .access = VehiclePropertyAccess::READ_WRITE, 1029 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 1030 .configArray = 1031 {kMixedTypePropertyForTest, 1032 (int)VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO, 1033 (int)VehicleVendorPermission::PERMISSION_SET_VENDOR_CATEGORY_INFO, 1034 VENDOR_EXTENSION_INT_PROPERTY, 1035 (int)VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_SEAT, 1036 (int)VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE, 1037 VENDOR_EXTENSION_FLOAT_PROPERTY, 1038 (int)VehicleVendorPermission::PERMISSION_DEFAULT, 1039 (int)VehicleVendorPermission::PERMISSION_DEFAULT}, 1040 }, 1041 .initialValue = {.int32Values = {1}}}, 1042 1043 { 1044 .config = 1045 { 1046 .prop = toInt(VehicleProperty::INITIAL_USER_INFO), 1047 .access = VehiclePropertyAccess::READ_WRITE, 1048 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 1049 }, 1050 }, 1051 { 1052 .config = 1053 { 1054 .prop = toInt(VehicleProperty::SWITCH_USER), 1055 .access = VehiclePropertyAccess::READ_WRITE, 1056 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 1057 }, 1058 }, 1059 { 1060 .config = 1061 { 1062 .prop = toInt(VehicleProperty::CREATE_USER), 1063 .access = VehiclePropertyAccess::READ_WRITE, 1064 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 1065 }, 1066 }, 1067 { 1068 .config = 1069 { 1070 .prop = toInt(VehicleProperty::REMOVE_USER), 1071 .access = VehiclePropertyAccess::READ_WRITE, 1072 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 1073 }, 1074 }, 1075 { 1076 .config = 1077 { 1078 .prop = toInt(VehicleProperty::USER_IDENTIFICATION_ASSOCIATION), 1079 .access = VehiclePropertyAccess::READ_WRITE, 1080 .changeMode = VehiclePropertyChangeMode::ON_CHANGE, 1081 }, 1082 }, 1083 }; 1084 1085 } // impl 1086 1087 } // namespace V2_0 1088 } // namespace vehicle 1089 } // namespace automotive 1090 } // namespace hardware 1091 } // namespace android 1092 1093 #endif // android_hardware_automotive_vehicle_V2_0_impl_DefaultConfig_H_ 1094