summaryrefslogtreecommitdiffstats
path: root/automotive
diff options
context:
space:
mode:
authorSteve Paik <spaik@google.com>2018-05-18 13:06:54 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-05-18 13:06:54 -0700
commitb7480876c17d6ad938f7aa30ed386a327ed656c0 (patch)
treeb2f985d3f61c1379f98761efcf275dc5ec548860 /automotive
parentc9e570ac24dbacd496ba90021d1e0b4d0c588b23 (diff)
parent6bf62943fc1a51d475de875f97501bbd3a942be3 (diff)
downloadplatform_hardware_interfaces-b7480876c17d6ad938f7aa30ed386a327ed656c0.tar.gz
platform_hardware_interfaces-b7480876c17d6ad938f7aa30ed386a327ed656c0.tar.bz2
platform_hardware_interfaces-b7480876c17d6ad938f7aa30ed386a327ed656c0.zip
Merge "Update default config areaId's" into pi-dev
am: 6bf62943fc Change-Id: Ib51b473edd766df0b6c10ad6d2b48b3f51eae1ec
Diffstat (limited to 'automotive')
-rw-r--r--automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h47
-rw-r--r--automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp5
2 files changed, 21 insertions, 31 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 012af1e00c..c1f80f4180 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
@@ -41,6 +41,10 @@ constexpr int VEHICLE_MAP_SERVICE = (int)VehicleProperty::VEHICLE_MAP_SERVICE;
constexpr int WHEEL_TICK = (int)VehicleProperty::WHEEL_TICK;
constexpr int ALL_WHEELS =
(int)(Wheel::LEFT_FRONT | Wheel::RIGHT_FRONT | Wheel::LEFT_REAR | Wheel::RIGHT_REAR);
+constexpr int HVAC_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_2_LEFT |
+ VehicleAreaSeat::ROW_2_CENTER);
+constexpr int HVAC_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT | VehicleAreaSeat::ROW_2_RIGHT);
+constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT;
/**
* This property is used for test purpose to generate fake events. Here is the test package that
@@ -273,8 +277,7 @@ const ConfigDeclaration kVehicleProperties[]{
{.config = {.prop = toInt(VehicleProperty::HVAC_POWER_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}},
// TODO(bryaneyler): Ideally, this is generated dynamically from
// kHvacPowerProperties.
.configArray =
@@ -297,66 +300,56 @@ const ConfigDeclaration kVehicleProperties[]{
{.config = {.prop = toInt(VehicleProperty::HVAC_MAX_DEFROST_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {1}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {1}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_MAX_AC_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {1}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_DUAL_ON),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {0}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT),
- .minInt32Value = 1,
- .maxInt32Value = 7}}},
+ .areaId = HVAC_ALL, .minInt32Value = 1, .maxInt32Value = 7}}},
.initialValue = {.int32Values = {3}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION),
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
- .areaConfigs = {VehicleAreaConfig{
- .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}},
+ .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}},
.initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}},
{.config = {.prop = toInt(VehicleProperty::HVAC_STEERING_WHEEL_HEAT),
@@ -370,17 +363,13 @@ const ConfigDeclaration kVehicleProperties[]{
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.areaConfigs = {VehicleAreaConfig{
- .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT),
- .minFloatValue = 16,
- .maxFloatValue = 32,
+ .areaId = HVAC_LEFT, .minFloatValue = 16, .maxFloatValue = 32,
},
VehicleAreaConfig{
- .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT),
- .minFloatValue = 16,
- .maxFloatValue = 32,
+ .areaId = HVAC_RIGHT, .minFloatValue = 16, .maxFloatValue = 32,
}}},
- .initialAreaValues = {{toInt(VehicleAreaSeat::ROW_1_LEFT), {.floatValues = {16}}},
- {toInt(VehicleAreaSeat::ROW_1_RIGHT), {.floatValues = {20}}}}},
+ .initialAreaValues = {{HVAC_LEFT, {.floatValues = {16}}},
+ {HVAC_RIGHT, {.floatValues = {20}}}}},
{.config =
{
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
index fb54195852..07695bfe7e 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
@@ -139,10 +139,11 @@ StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) {
return status;
}
} else if (mHvacPowerProps.count(propValue.prop)) {
- // TODO(75328113): this should be handled by property status
auto hvacPowerOn = mPropStore->readValueOrNull(
toInt(VehicleProperty::HVAC_POWER_ON),
- (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT));
+ (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT |
+ VehicleAreaSeat::ROW_2_LEFT | VehicleAreaSeat::ROW_2_CENTER |
+ VehicleAreaSeat::ROW_2_RIGHT));
if (hvacPowerOn && hvacPowerOn->value.int32Values.size() == 1
&& hvacPowerOn->value.int32Values[0] == 0) {