Merge "Update default config areaId's" into pi-dev
am: 6bf62943fc
Change-Id: Ib51b473edd766df0b6c10ad6d2b48b3f51eae1ec
This commit is contained in:
commit
b7480876c1
2 changed files with 21 additions and 31 deletions
|
@ -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 =
|
||||
{
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue