diff options
author | Ram Periathiruvadi <ramperry@google.com> | 2017-05-09 21:31:44 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-09 21:31:44 +0000 |
commit | 4f65adf50921d5b3b3eadd0bac6aac588ef40a50 (patch) | |
tree | 4f8d5713838144252508e97ad78b55ebb9f7009b /automotive | |
parent | 92a3c3d75d1bd6c3af4372fc2f18e19a5fcd6da3 (diff) | |
parent | c63bdfbd7483addf3f1ffe432c2749d3ef04a0f9 (diff) | |
download | android_hardware_interfaces-4f65adf50921d5b3b3eadd0bac6aac588ef40a50.tar.gz android_hardware_interfaces-4f65adf50921d5b3b3eadd0bac6aac588ef40a50.tar.bz2 android_hardware_interfaces-4f65adf50921d5b3b3eadd0bac6aac588ef40a50.zip |
Merge "Add DOOR_LOCK to default config." into oc-dev
am: c63bdfbd74
Change-Id: I2386d09d237957da9f7ea146412b5a36cbf208a6
Diffstat (limited to 'automotive')
-rw-r--r-- | automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | 457 |
1 files changed, 204 insertions, 253 deletions
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index 4835288aa..fb63e3645 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h @@ -63,277 +63,228 @@ struct ConfigDeclaration { std::map<int32_t, VehiclePropValue::RawValue> initialAreaValues; }; -const ConfigDeclaration kVehicleProperties[] { - { - .config = { - .prop = toInt(VehicleProperty::INFO_MAKE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = { .stringValue = "Toy Vehicle" } - }, - { - .config = { - .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .minSampleRate = 1.0f, - .maxSampleRate = 1000.0f, - }, - .initialValue = { .floatValues = {0.0f} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::PERF_ODOMETER), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .floatValues = {0.0f} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::ENGINE_RPM), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 1000.0f, - }, - .initialValue = { .floatValues = {0.0f} }, - }, - - { - .config = { - .prop = toInt(VehicleProperty::CURRENT_GEAR), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .int32Values = { toInt(VehicleGear::GEAR_PARK) } } - }, - - { - .config = { - .prop = toInt(VehicleProperty::PARKING_BRAKE_ON), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .int32Values = {1} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .int32Values = {0} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::HVAC_POWER_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = toInt(VehicleAreaZone::ROW_1), - // TODO(bryaneyler): Ideally, this is generated dynamically from - // kHvacPowerProperties. - .configString = "0x12400500,0x12400501" // HVAC_FAN_SPEED,HVAC_FAN_DIRECTION - }, - .initialValue = { .int32Values = {1} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::HVAC_DEFROSTER), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = - VehicleAreaWindow::FRONT_WINDSHIELD - | VehicleAreaWindow::REAR_WINDSHIELD - }, - .initialValue = { .int32Values = {0} } // Will be used for all areas. - }, - - { - .config = { - .prop = toInt(VehicleProperty::HVAC_RECIRC_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = toInt(VehicleAreaZone::ROW_1) - }, - .initialValue = { .int32Values = {1} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::HVAC_AC_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = toInt(VehicleAreaZone::ROW_1) - }, - .initialValue = { .int32Values = {1} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::HVAC_AUTO_ON), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = toInt(VehicleAreaZone::ROW_1) - }, - .initialValue = { .int32Values = {1} } - }, +const ConfigDeclaration kVehicleProperties[]{ + {.config = + { + .prop = toInt(VehicleProperty::INFO_MAKE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.stringValue = "Toy Vehicle"}}, + {.config = + { + .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .minSampleRate = 1.0f, + .maxSampleRate = 1000.0f, + }, + .initialValue = {.floatValues = {0.0f}}}, + + {.config = + { + .prop = toInt(VehicleProperty::PERF_ODOMETER), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {0.0f}}}, { - .config = { - .prop = toInt(VehicleProperty::HVAC_FAN_SPEED), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = toInt(VehicleAreaZone::ROW_1), - .areaConfigs = { - VehicleAreaConfig { - .areaId = toInt(VehicleAreaZone::ROW_1), - .minInt32Value = 1, - .maxInt32Value = 7 - } - } - }, - .initialValue = { .int32Values = {3} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = toInt(VehicleAreaZone::ROW_1), - }, - .initialValue = { .int32Values = { toInt(VehicleHvacFanDirection::FACE) } } - }, - - { - .config = { - .prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .supportedAreas = - VehicleAreaZone::ROW_1_LEFT - | VehicleAreaZone::ROW_1_RIGHT, - .areaConfigs = { - VehicleAreaConfig { - .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), - .minFloatValue = 16, - .maxFloatValue = 32, - }, - VehicleAreaConfig { - .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT), - .minFloatValue = 16, - .maxFloatValue = 32, - } - } - }, - .initialAreaValues = { + .config = { - toInt(VehicleAreaZone::ROW_1_LEFT), - { .floatValues = {16} } - }, { - toInt(VehicleAreaZone::ROW_1_RIGHT), - { .floatValues = {20} } - } - } + .prop = toInt(VehicleProperty::ENGINE_RPM), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 1000.0f, + }, + .initialValue = {.floatValues = {0.0f}}, }, - { - .config = { - .prop = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE), - .access = VehiclePropertyAccess::READ, - // TODO(bryaneyler): Support ON_CHANGE as well. - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 1.0f, - .maxSampleRate = 2.0f, - }, - .initialValue = { .floatValues = {25.0f} } - }, + {.config = + { + .prop = toInt(VehicleProperty::CURRENT_GEAR), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, + + {.config = + { + .prop = toInt(VehicleProperty::PARKING_BRAKE_ON), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {1}}}, + + {.config = + { + .prop = toInt(VehicleProperty::FUEL_LEVEL_LOW), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(VehicleProperty::HVAC_POWER_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = toInt(VehicleAreaZone::ROW_1), + // TODO(bryaneyler): Ideally, this is generated dynamically from + // kHvacPowerProperties. + .configString = "0x12400500,0x12400501" // HVAC_FAN_SPEED,HVAC_FAN_DIRECTION + }, + .initialValue = {.int32Values = {1}}}, { - .config = { - .prop = toInt(VehicleProperty::NIGHT_MODE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .int32Values = {0} } + .config = {.prop = toInt(VehicleProperty::HVAC_DEFROSTER), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = + VehicleAreaWindow::FRONT_WINDSHIELD | VehicleAreaWindow::REAR_WINDSHIELD}, + .initialValue = {.int32Values = {0}} // Will be used for all areas. }, - { - .config = { - .prop = toInt(VehicleProperty::DRIVING_STATUS), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .int32Values = { toInt(VehicleDrivingStatus::UNRESTRICTED) } } - }, + {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = toInt(VehicleAreaZone::ROW_1)}, + .initialValue = {.int32Values = {1}}}, + + {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = toInt(VehicleAreaZone::ROW_1)}, + .initialValue = {.int32Values = {1}}}, + + {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = toInt(VehicleAreaZone::ROW_1)}, + .initialValue = {.int32Values = {1}}}, + + {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = toInt(VehicleAreaZone::ROW_1), + .areaConfigs = {VehicleAreaConfig{.areaId = toInt(VehicleAreaZone::ROW_1), + .minInt32Value = 1, + .maxInt32Value = 7}}}, + .initialValue = {.int32Values = {3}}}, + + {.config = + { + .prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = toInt(VehicleAreaZone::ROW_1), + }, + .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}}, + + {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .supportedAreas = VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT, + .areaConfigs = {VehicleAreaConfig{ + .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), + .minFloatValue = 16, + .maxFloatValue = 32, + }, + VehicleAreaConfig{ + .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT), + .minFloatValue = 16, + .maxFloatValue = 32, + }}}, + .initialAreaValues = {{toInt(VehicleAreaZone::ROW_1_LEFT), {.floatValues = {16}}}, + {toInt(VehicleAreaZone::ROW_1_RIGHT), {.floatValues = {20}}}}}, + + {.config = + { + .prop = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE), + .access = VehiclePropertyAccess::READ, + // TODO(bryaneyler): Support ON_CHANGE as well. + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 1.0f, + .maxSampleRate = 2.0f, + }, + .initialValue = {.floatValues = {25.0f}}}, + + {.config = + { + .prop = toInt(VehicleProperty::NIGHT_MODE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(VehicleProperty::DRIVING_STATUS), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(VehicleDrivingStatus::UNRESTRICTED)}}}, + + {.config = + { + .prop = toInt(VehicleProperty::GEAR_SELECTION), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, { - .config = { - .prop = toInt(VehicleProperty::GEAR_SELECTION), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .int32Values = { toInt(VehicleGear::GEAR_PARK) } } + .config = + { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.floatValues = {123000.0f}} // In Milliliters }, - { - .config = { - .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = { .floatValues = { 123000.0f } } // In Milliliters - }, + {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 10}}}, + .initialValue = {.int32Values = {7}}}, + + {.config = + { + .prop = toInt(VehicleProperty::IGNITION_STATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(VehicleIgnitionState::ON)}}}, + + {.config = + { + .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .minSampleRate = 0.1, // 0.1 Hz, every 10 seconds + .maxSampleRate = 10, // 10 Hz, every 100 ms + }, + .initialValue = {.floatValues = {101.0f}}}, { - .config = { - .prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = { - VehicleAreaConfig { - .minInt32Value = 0, - .maxInt32Value = 10 - } - } - }, - .initialValue = { .int32Values = {7} } - }, - - { - .config = { - .prop = toInt(VehicleProperty::IGNITION_STATE), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = { .int32Values = { toInt(VehicleIgnitionState::ON) } } + .config = + { + .prop = kGenerateFakeDataControllingProperty, + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, }, - { - .config = { - .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .minSampleRate = 0.1, // 0.1 Hz, every 10 seconds - .maxSampleRate = 10, // 10 Hz, every 100 ms - }, - .initialValue = { .floatValues = {101.0f} } - }, + {.config = + { + .prop = toInt(VehicleProperty::DOOR_LOCK), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {1}}} - { - .config = { - .prop = kGenerateFakeDataControllingProperty, - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - } }; } // impl |