diff options
author | Steve Paik | 2018-05-18 15:06:54 -0500 |
---|---|---|
committer | android-build-merger | 2018-05-18 15:06:54 -0500 |
commit | b7480876c17d6ad938f7aa30ed386a327ed656c0 (patch) | |
tree | b2f985d3f61c1379f98761efcf275dc5ec548860 /automotive | |
parent | c9e570ac24dbacd496ba90021d1e0b4d0c588b23 (diff) | |
parent | 6bf62943fc1a51d475de875f97501bbd3a942be3 (diff) | |
download | platform-hardware-interfaces-b7480876c17d6ad938f7aa30ed386a327ed656c0.tar.gz platform-hardware-interfaces-b7480876c17d6ad938f7aa30ed386a327ed656c0.tar.xz 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.h | 47 | ||||
-rw-r--r-- | automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp | 5 |
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 012af1e0..c1f80f41 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; | |||
41 | constexpr int WHEEL_TICK = (int)VehicleProperty::WHEEL_TICK; | 41 | constexpr int WHEEL_TICK = (int)VehicleProperty::WHEEL_TICK; |
42 | constexpr int ALL_WHEELS = | 42 | constexpr int ALL_WHEELS = |
43 | (int)(Wheel::LEFT_FRONT | Wheel::RIGHT_FRONT | Wheel::LEFT_REAR | Wheel::RIGHT_REAR); | 43 | (int)(Wheel::LEFT_FRONT | Wheel::RIGHT_FRONT | Wheel::LEFT_REAR | Wheel::RIGHT_REAR); |
44 | constexpr int HVAC_LEFT = (int)(VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_2_LEFT | | ||
45 | VehicleAreaSeat::ROW_2_CENTER); | ||
46 | constexpr int HVAC_RIGHT = (int)(VehicleAreaSeat::ROW_1_RIGHT | VehicleAreaSeat::ROW_2_RIGHT); | ||
47 | constexpr int HVAC_ALL = HVAC_LEFT | HVAC_RIGHT; | ||
44 | 48 | ||
45 | /** | 49 | /** |
46 | * This property is used for test purpose to generate fake events. Here is the test package that | 50 | * This property is used for test purpose to generate fake events. Here is the test package that |
@@ -273,8 +277,7 @@ const ConfigDeclaration kVehicleProperties[]{ | |||
273 | {.config = {.prop = toInt(VehicleProperty::HVAC_POWER_ON), | 277 | {.config = {.prop = toInt(VehicleProperty::HVAC_POWER_ON), |
274 | .access = VehiclePropertyAccess::READ_WRITE, | 278 | .access = VehiclePropertyAccess::READ_WRITE, |
275 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 279 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
276 | .areaConfigs = {VehicleAreaConfig{ | 280 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}, |
277 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}, | ||
278 | // TODO(bryaneyler): Ideally, this is generated dynamically from | 281 | // TODO(bryaneyler): Ideally, this is generated dynamically from |
279 | // kHvacPowerProperties. | 282 | // kHvacPowerProperties. |
280 | .configArray = | 283 | .configArray = |
@@ -297,66 +300,56 @@ const ConfigDeclaration kVehicleProperties[]{ | |||
297 | {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_DEFROST_ON), | 300 | {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_DEFROST_ON), |
298 | .access = VehiclePropertyAccess::READ_WRITE, | 301 | .access = VehiclePropertyAccess::READ_WRITE, |
299 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 302 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
300 | .areaConfigs = {VehicleAreaConfig{ | 303 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
301 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
302 | .initialValue = {.int32Values = {0}}}, | 304 | .initialValue = {.int32Values = {0}}}, |
303 | 305 | ||
304 | {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON), | 306 | {.config = {.prop = toInt(VehicleProperty::HVAC_RECIRC_ON), |
305 | .access = VehiclePropertyAccess::READ_WRITE, | 307 | .access = VehiclePropertyAccess::READ_WRITE, |
306 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 308 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
307 | .areaConfigs = {VehicleAreaConfig{ | 309 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
308 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
309 | .initialValue = {.int32Values = {1}}}, | 310 | .initialValue = {.int32Values = {1}}}, |
310 | 311 | ||
311 | {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON), | 312 | {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_RECIRC_ON), |
312 | .access = VehiclePropertyAccess::READ_WRITE, | 313 | .access = VehiclePropertyAccess::READ_WRITE, |
313 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 314 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
314 | .areaConfigs = {VehicleAreaConfig{ | 315 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
315 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
316 | .initialValue = {.int32Values = {0}}}, | 316 | .initialValue = {.int32Values = {0}}}, |
317 | 317 | ||
318 | {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON), | 318 | {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON), |
319 | .access = VehiclePropertyAccess::READ_WRITE, | 319 | .access = VehiclePropertyAccess::READ_WRITE, |
320 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 320 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
321 | .areaConfigs = {VehicleAreaConfig{ | 321 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
322 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
323 | .initialValue = {.int32Values = {1}}}, | 322 | .initialValue = {.int32Values = {1}}}, |
324 | 323 | ||
325 | {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_AC_ON), | 324 | {.config = {.prop = toInt(VehicleProperty::HVAC_MAX_AC_ON), |
326 | .access = VehiclePropertyAccess::READ_WRITE, | 325 | .access = VehiclePropertyAccess::READ_WRITE, |
327 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 326 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
328 | .areaConfigs = {VehicleAreaConfig{ | 327 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
329 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
330 | .initialValue = {.int32Values = {0}}}, | 328 | .initialValue = {.int32Values = {0}}}, |
331 | 329 | ||
332 | {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON), | 330 | {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON), |
333 | .access = VehiclePropertyAccess::READ_WRITE, | 331 | .access = VehiclePropertyAccess::READ_WRITE, |
334 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 332 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
335 | .areaConfigs = {VehicleAreaConfig{ | 333 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
336 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
337 | .initialValue = {.int32Values = {1}}}, | 334 | .initialValue = {.int32Values = {1}}}, |
338 | 335 | ||
339 | {.config = {.prop = toInt(VehicleProperty::HVAC_DUAL_ON), | 336 | {.config = {.prop = toInt(VehicleProperty::HVAC_DUAL_ON), |
340 | .access = VehiclePropertyAccess::READ_WRITE, | 337 | .access = VehiclePropertyAccess::READ_WRITE, |
341 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 338 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
342 | .areaConfigs = {VehicleAreaConfig{ | 339 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
343 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
344 | .initialValue = {.int32Values = {0}}}, | 340 | .initialValue = {.int32Values = {0}}}, |
345 | 341 | ||
346 | {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), | 342 | {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), |
347 | .access = VehiclePropertyAccess::READ_WRITE, | 343 | .access = VehiclePropertyAccess::READ_WRITE, |
348 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 344 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
349 | .areaConfigs = {VehicleAreaConfig{ | 345 | .areaConfigs = {VehicleAreaConfig{ |
350 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT), | 346 | .areaId = HVAC_ALL, .minInt32Value = 1, .maxInt32Value = 7}}}, |
351 | .minInt32Value = 1, | ||
352 | .maxInt32Value = 7}}}, | ||
353 | .initialValue = {.int32Values = {3}}}, | 347 | .initialValue = {.int32Values = {3}}}, |
354 | 348 | ||
355 | {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION), | 349 | {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_DIRECTION), |
356 | .access = VehiclePropertyAccess::READ_WRITE, | 350 | .access = VehiclePropertyAccess::READ_WRITE, |
357 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 351 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
358 | .areaConfigs = {VehicleAreaConfig{ | 352 | .areaConfigs = {VehicleAreaConfig{.areaId = HVAC_ALL}}}, |
359 | .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, | ||
360 | .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}}, | 353 | .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}}, |
361 | 354 | ||
362 | {.config = {.prop = toInt(VehicleProperty::HVAC_STEERING_WHEEL_HEAT), | 355 | {.config = {.prop = toInt(VehicleProperty::HVAC_STEERING_WHEEL_HEAT), |
@@ -370,17 +363,13 @@ const ConfigDeclaration kVehicleProperties[]{ | |||
370 | .access = VehiclePropertyAccess::READ_WRITE, | 363 | .access = VehiclePropertyAccess::READ_WRITE, |
371 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, | 364 | .changeMode = VehiclePropertyChangeMode::ON_CHANGE, |
372 | .areaConfigs = {VehicleAreaConfig{ | 365 | .areaConfigs = {VehicleAreaConfig{ |
373 | .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT), | 366 | .areaId = HVAC_LEFT, .minFloatValue = 16, .maxFloatValue = 32, |
374 | .minFloatValue = 16, | ||
375 | .maxFloatValue = 32, | ||
376 | }, | 367 | }, |
377 | VehicleAreaConfig{ | 368 | VehicleAreaConfig{ |
378 | .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT), | 369 | .areaId = HVAC_RIGHT, .minFloatValue = 16, .maxFloatValue = 32, |
379 | .minFloatValue = 16, | ||
380 | .maxFloatValue = 32, | ||
381 | }}}, | 370 | }}}, |
382 | .initialAreaValues = {{toInt(VehicleAreaSeat::ROW_1_LEFT), {.floatValues = {16}}}, | 371 | .initialAreaValues = {{HVAC_LEFT, {.floatValues = {16}}}, |
383 | {toInt(VehicleAreaSeat::ROW_1_RIGHT), {.floatValues = {20}}}}}, | 372 | {HVAC_RIGHT, {.floatValues = {20}}}}}, |
384 | 373 | ||
385 | {.config = | 374 | {.config = |
386 | { | 375 | { |
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 fb541958..07695bfe 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) { | |||
139 | return status; | 139 | return status; |
140 | } | 140 | } |
141 | } else if (mHvacPowerProps.count(propValue.prop)) { | 141 | } else if (mHvacPowerProps.count(propValue.prop)) { |
142 | // TODO(75328113): this should be handled by property status | ||
143 | auto hvacPowerOn = mPropStore->readValueOrNull( | 142 | auto hvacPowerOn = mPropStore->readValueOrNull( |
144 | toInt(VehicleProperty::HVAC_POWER_ON), | 143 | toInt(VehicleProperty::HVAC_POWER_ON), |
145 | (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)); | 144 | (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT | |
145 | VehicleAreaSeat::ROW_2_LEFT | VehicleAreaSeat::ROW_2_CENTER | | ||
146 | VehicleAreaSeat::ROW_2_RIGHT)); | ||
146 | 147 | ||
147 | if (hvacPowerOn && hvacPowerOn->value.int32Values.size() == 1 | 148 | if (hvacPowerOn && hvacPowerOn->value.int32Values.size() == 1 |
148 | && hvacPowerOn->value.int32Values[0] == 0) { | 149 | && hvacPowerOn->value.int32Values[0] == 0) { |