diff options
author | Steve Paik <spaik@google.com> | 2018-04-03 13:26:53 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-04-03 13:26:53 -0700 |
commit | 55fe13618803fa618e2aef2ff915d90e20a2acef (patch) | |
tree | 7f5dfdd05d9602232c895ee7748a06a1d1eafe6d /automotive | |
parent | 71641ca35999f086aef2d279353e98288a3a6390 (diff) | |
parent | 1058b982e97ed2c008df00842aa3252b90458d14 (diff) | |
download | android_hardware_interfaces-55fe13618803fa618e2aef2ff915d90e20a2acef.tar.gz android_hardware_interfaces-55fe13618803fa618e2aef2ff915d90e20a2acef.tar.bz2 android_hardware_interfaces-55fe13618803fa618e2aef2ff915d90e20a2acef.zip |
Merge "Update VHAL types.hal" into pi-dev
am: 1058b982e9
Change-Id: I9001e90f76a1cf18cb88fd5a65e2f8f4602073fd
Diffstat (limited to 'automotive')
11 files changed, 693 insertions, 596 deletions
diff --git a/automotive/vehicle/2.0/Android.bp b/automotive/vehicle/2.0/Android.bp index 3e32b3e89..4b93008ee 100644 --- a/automotive/vehicle/2.0/Android.bp +++ b/automotive/vehicle/2.0/Android.bp @@ -26,14 +26,15 @@ hidl_interface { "Obd2IgnitionMonitorKind", "Obd2SecondaryAirStatus", "Obd2SparkIgnitionMonitors", + "PortLocationType", "StatusCode", "SubscribeFlags", "SubscribeOptions", "VehicleApPowerBootupReason", - "VehicleApPowerSetState", - "VehicleApPowerState", "VehicleApPowerStateConfigFlag", - "VehicleApPowerStateIndex", + "VehicleApPowerStateReq", + "VehicleApPowerStateReqIndex", + "VehicleApPowerStateReport", "VehicleApPowerStateShutdownParam", "VehicleArea", "VehicleAreaConfig", @@ -41,12 +42,13 @@ hidl_interface { "VehicleAreaMirror", "VehicleAreaSeat", "VehicleAreaWindow", - "VehicleAreaZone", "VehicleDisplay", "VehicleGear", "VehicleHvacFanDirection", "VehicleHwKeyInputAction", "VehicleIgnitionState", + "VehicleLightState", + "VehicleLightSwitch", "VehicleOilLevel", "VehiclePropConfig", "VehiclePropValue", @@ -54,10 +56,8 @@ hidl_interface { "VehiclePropertyAccess", "VehiclePropertyChangeMode", "VehiclePropertyGroup", - "VehiclePropertyOperation", "VehiclePropertyStatus", "VehiclePropertyType", - "VehicleRadioConstants", "VehicleTurnSignal", "VehicleUnit", "VmsAvailabilityStateIntegerValuesIndex", diff --git a/automotive/vehicle/2.0/IVehicleCallback.hal b/automotive/vehicle/2.0/IVehicleCallback.hal index 706041862..c4a756ab0 100644 --- a/automotive/vehicle/2.0/IVehicleCallback.hal +++ b/automotive/vehicle/2.0/IVehicleCallback.hal @@ -33,7 +33,7 @@ interface IVehicleCallback { /** * This method gets called if the client was subscribed to a property using - * SubscribeFlags::SET_CALL flag and IVehicle#set(...) method was called. + * SubscribeFlags::EVENTS_FROM_ANDROID flag and IVehicle#set(...) method was called. * * These events must be delivered to subscriber immediately without any * batching. diff --git a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h index 359bb6df3..946e74ddd 100644 --- a/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h +++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/VehicleObjectPool.h @@ -152,7 +152,7 @@ private: * VehiclePropValuePool pool; * auto v = pool.obtain(VehiclePropertyType::INT32); * v->propId = VehicleProperty::HVAC_FAN_SPEED; - * v->areaId = VehicleAreaZone::ROW_1_LEFT; + * v->areaId = VehicleAreaSeat::ROW_1_LEFT; * v->timestamp = elapsedRealtimeNano(); * v->value->int32Values[0] = 42; * diff --git a/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp b/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp index a7d5f509e..97aeca677 100644 --- a/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp +++ b/automotive/vehicle/2.0/default/common/src/SubscriptionManager.cpp @@ -106,7 +106,7 @@ StatusCode SubscriptionManager::addOrUpdateSubscription( addClientToPropMapLocked(opts.propId, client); - if (SubscribeFlags::HAL_EVENT & opts.flags) { + if (SubscribeFlags::EVENTS_FROM_CAR & opts.flags) { SubscribeOptions updated; if (updateHalEventSubscriptionLocked(opts, &updated)) { outUpdatedSubscriptions->push_back(updated); diff --git a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp index 1918421a5..b5de26251 100644 --- a/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp +++ b/automotive/vehicle/2.0/default/common/src/VehicleHalManager.cpp @@ -216,7 +216,7 @@ void VehicleHalManager::onHalPropertySetError(StatusCode errorCode, int32_t property, int32_t areaId) { const auto& clients = - mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::HAL_EVENT); + mSubscriptionManager.getSubscribedClients(property, SubscribeFlags::EVENTS_FROM_CAR); for (auto client : clients) { client->getCallback()->onPropertySetError(errorCode, property, areaId); @@ -224,8 +224,8 @@ void VehicleHalManager::onHalPropertySetError(StatusCode errorCode, } void VehicleHalManager::onBatchHalEvent(const std::vector<VehiclePropValuePtr>& values) { - const auto& clientValues = mSubscriptionManager.distributeValuesToClients( - values, SubscribeFlags::HAL_EVENT); + const auto& clientValues = + mSubscriptionManager.distributeValuesToClients(values, SubscribeFlags::EVENTS_FROM_CAR); for (const HalClientValues& cv : clientValues) { auto vecSize = cv.values.size(); @@ -250,8 +250,7 @@ void VehicleHalManager::onBatchHalEvent(const std::vector<VehiclePropValuePtr>& } bool VehicleHalManager::isSampleRateFixed(VehiclePropertyChangeMode mode) { - return (mode & VehiclePropertyChangeMode::ON_SET) - || (mode & VehiclePropertyChangeMode::ON_CHANGE); + return (mode & VehiclePropertyChangeMode::ON_CHANGE); } float VehicleHalManager::checkSampleRate(const VehiclePropConfig &config, @@ -281,7 +280,7 @@ bool VehicleHalManager::isSubscribable(const VehiclePropConfig& config, SubscribeFlags flags) { bool isReadable = config.access & VehiclePropertyAccess::READ; - if (!isReadable && (SubscribeFlags::HAL_EVENT & flags)) { + if (!isReadable && (SubscribeFlags::EVENTS_FROM_CAR & flags)) { ALOGW("Cannot subscribe, property 0x%x is not readable", config.prop); return false; } @@ -289,12 +288,6 @@ bool VehicleHalManager::isSubscribable(const VehiclePropConfig& config, ALOGW("Cannot subscribe, property 0x%x is static", config.prop); return false; } - - //TODO: extend to support event notification for set from android - if (config.changeMode == VehiclePropertyChangeMode::POLL) { - ALOGW("Cannot subscribe, property 0x%x is poll only", config.prop); - return false; - } return true; } @@ -317,7 +310,8 @@ bool VehicleHalManager::checkReadPermission(const VehiclePropConfig &config) con } void VehicleHalManager::handlePropertySetEvent(const VehiclePropValue& value) { - auto clients = mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::SET_CALL); + auto clients = + mSubscriptionManager.getSubscribedClients(value.prop, SubscribeFlags::EVENTS_FROM_ANDROID); for (auto client : clients) { client->getCallback()->onPropertySet(value); } 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 479f8af62..56813ce41 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 @@ -30,7 +30,8 @@ namespace impl { // // Some handy constants to avoid conversions from enum to int. constexpr int ABS_ACTIVE = (int)VehicleProperty::ABS_ACTIVE; -constexpr int AP_POWER_STATE = (int)VehicleProperty::AP_POWER_STATE; +constexpr int AP_POWER_STATE_REQ = (int)VehicleProperty::AP_POWER_STATE_REQ; +constexpr int AP_POWER_STATE_REPORT = (int)VehicleProperty::AP_POWER_STATE_REPORT; constexpr int OBD2_LIVE_FRAME = (int)VehicleProperty::OBD2_LIVE_FRAME; constexpr int OBD2_FREEZE_FRAME = (int)VehicleProperty::OBD2_FREEZE_FRAME; constexpr int OBD2_FREEZE_FRAME_INFO = (int)VehicleProperty::OBD2_FREEZE_FRAME_INFO; @@ -149,14 +150,6 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {0.0f}}}, - {.config = - { - .prop = toInt(VehicleProperty::ENGINE_ON), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - }, - .initialValue = {.int32Values = {0}}}, - { .config = { @@ -255,7 +248,7 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{ - .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}, + .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}, // TODO(bryaneyler): Ideally, this is generated dynamically from // kHvacPowerProperties. .configString = "0x12400500,0x12400501" // HVAC_FAN_SPEED,HVAC_FAN_DIRECTION @@ -276,28 +269,28 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{ - .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}}, + .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, .initialValue = {.int32Values = {1}}}, {.config = {.prop = toInt(VehicleProperty::HVAC_AC_ON), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{ - .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}}, + .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, .initialValue = {.int32Values = {1}}}, {.config = {.prop = toInt(VehicleProperty::HVAC_AUTO_ON), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{ - .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}}, + .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, .initialValue = {.int32Values = {1}}}, {.config = {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{ - .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT), + .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT), .minInt32Value = 1, .maxInt32Value = 7}}}, .initialValue = {.int32Values = {3}}}, @@ -306,24 +299,24 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{ - .areaId = (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)}}}, + .areaId = (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)}}}, .initialValue = {.int32Values = {toInt(VehicleHvacFanDirection::FACE)}}}, {.config = {.prop = toInt(VehicleProperty::HVAC_TEMPERATURE_SET), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .areaConfigs = {VehicleAreaConfig{ - .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), + .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT), .minFloatValue = 16, .maxFloatValue = 32, }, VehicleAreaConfig{ - .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT), + .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT), .minFloatValue = 16, .maxFloatValue = 32, }}}, - .initialAreaValues = {{toInt(VehicleAreaZone::ROW_1_LEFT), {.floatValues = {16}}}, - {toInt(VehicleAreaZone::ROW_1_RIGHT), {.floatValues = {20}}}}}, + .initialAreaValues = {{toInt(VehicleAreaSeat::ROW_1_LEFT), {.floatValues = {16}}}, + {toInt(VehicleAreaSeat::ROW_1_RIGHT), {.floatValues = {20}}}}}, {.config = { @@ -424,11 +417,17 @@ const ConfigDeclaration kVehicleProperties[]{ }, }, - {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE), - .access = VehiclePropertyAccess::READ_WRITE, + {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REQ), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .configArray = {3}}, + .initialValue = {.int32Values = {toInt(VehicleApPowerStateReq::ON_FULL), 0}}}, + + {.config = {.prop = toInt(VehicleProperty::AP_POWER_STATE_REPORT), + .access = VehiclePropertyAccess::WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .configArray = {3}}, - .initialValue = {.int32Values = {toInt(VehicleApPowerState::ON_FULL), 0}}}, + .initialValue = {.int32Values = {toInt(VehicleApPowerStateReport::BOOT_COMPLETE), 0}}}, {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), .access = VehiclePropertyAccess::READ_WRITE, 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 3979ac211..2eb905dce 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 @@ -138,7 +138,7 @@ StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) { // TODO(75328113): this should be handled by property status auto hvacPowerOn = mPropStore->readValueOrNull( toInt(VehicleProperty::HVAC_POWER_ON), - (VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT)); + (VehicleAreaSeat::ROW_1_LEFT | VehicleAreaSeat::ROW_1_RIGHT)); if (hvacPowerOn && hvacPowerOn->value.int32Values.size() == 1 && hvacPowerOn->value.int32Values[0] == 0) { @@ -153,7 +153,7 @@ StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) { // Placeholder for future implementation of VMS property in the default hal. For // now, just returns OK; otherwise, hal clients crash with property not supported. return StatusCode::OK; - case AP_POWER_STATE: + case AP_POWER_STATE_REPORT: // This property has different behavior between get/set. When it is set, the value // goes to the vehicle but is NOT updated in the property store back to Android. // Commented out for now, because it may mess up automated testing that use the diff --git a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp index 4865e9e80..ab2013d08 100644 --- a/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp +++ b/automotive/vehicle/2.0/default/tests/SubscriptionManager_test.cpp @@ -51,19 +51,16 @@ public: } hidl_vec<SubscribeOptions> subscrToProp1 = { - SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::HAL_EVENT}, + SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::EVENTS_FROM_CAR}, }; hidl_vec<SubscribeOptions> subscrToProp2 = { - SubscribeOptions { - .propId = PROP2, - .flags = SubscribeFlags::HAL_EVENT - }, + SubscribeOptions{.propId = PROP2, .flags = SubscribeFlags::EVENTS_FROM_CAR}, }; hidl_vec<SubscribeOptions> subscrToProp1and2 = { - SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::HAL_EVENT}, - SubscribeOptions{.propId = PROP2, .flags = SubscribeFlags::HAL_EVENT}, + SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::EVENTS_FROM_CAR}, + SubscribeOptions{.propId = PROP2, .flags = SubscribeFlags::EVENTS_FROM_CAR}, }; static std::list<sp<IVehicleCallback>> extractCallbacks( @@ -76,11 +73,11 @@ public: } std::list<sp<HalClient>> clientsToProp1() { - return manager.getSubscribedClients(PROP1, SubscribeFlags::DEFAULT); + return manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR); } std::list<sp<HalClient>> clientsToProp2() { - return manager.getSubscribedClients(PROP2, SubscribeFlags::DEFAULT); + return manager.getSubscribedClients(PROP2, SubscribeFlags::EVENTS_FROM_CAR); } void onPropertyUnsubscribed(int propertyId) { @@ -110,9 +107,7 @@ TEST_F(SubscriptionManagerTest, multipleClients) { ASSERT_EQ(StatusCode::OK, manager.addOrUpdateSubscription(2, cb2, subscrToProp1, &updatedOptions)); - auto clients = manager.getSubscribedClients( - PROP1, - SubscribeFlags::HAL_EVENT); + auto clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR); ASSERT_ALL_EXISTS({cb1, cb2}, extractCallbacks(clients)); } @@ -124,13 +119,11 @@ TEST_F(SubscriptionManagerTest, negativeCases) { // Wrong prop auto clients = manager.getSubscribedClients(toInt(VehicleProperty::AP_POWER_BOOTUP_REASON), - SubscribeFlags::HAL_EVENT); + SubscribeFlags::EVENTS_FROM_CAR); ASSERT_TRUE(clients.empty()); // Wrong flag - clients = manager.getSubscribedClients( - PROP1, - SubscribeFlags::SET_CALL); + clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_ANDROID); ASSERT_TRUE(clients.empty()); } @@ -139,27 +132,22 @@ TEST_F(SubscriptionManagerTest, mulipleSubscriptions) { ASSERT_EQ(StatusCode::OK, manager.addOrUpdateSubscription(1, cb1, subscrToProp1, &updatedOptions)); - auto clients = manager.getSubscribedClients( - PROP1, - SubscribeFlags::DEFAULT); + auto clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR); ASSERT_EQ((size_t) 1, clients.size()); ASSERT_EQ(cb1, clients.front()->getCallback()); // Same property, but different zone, to make sure we didn't unsubscribe // from previous zone. - ASSERT_EQ(StatusCode::OK, manager.addOrUpdateSubscription(1, cb1, { - SubscribeOptions { - .propId = PROP1, - .flags = SubscribeFlags::DEFAULT - } - }, &updatedOptions)); - - clients = manager.getSubscribedClients(PROP1, - SubscribeFlags::DEFAULT); + ASSERT_EQ( + StatusCode::OK, + manager.addOrUpdateSubscription( + 1, cb1, {SubscribeOptions{.propId = PROP1, .flags = SubscribeFlags::EVENTS_FROM_CAR}}, + &updatedOptions)); + + clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR); ASSERT_ALL_EXISTS({cb1}, extractCallbacks(clients)); - clients = manager.getSubscribedClients(PROP1, - SubscribeFlags::DEFAULT); + clients = manager.getSubscribedClients(PROP1, SubscribeFlags::EVENTS_FROM_CAR); ASSERT_ALL_EXISTS({cb1}, extractCallbacks(clients)); } diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp index 5b195db80..f64eab55a 100644 --- a/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp +++ b/automotive/vehicle/2.0/default/tests/VehicleHalManager_test.cpp @@ -241,10 +241,7 @@ TEST_F(VehicleHalManagerTest, halErrorEvent) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = { - SubscribeOptions { - .propId = PROP, - .flags = SubscribeFlags::DEFAULT - }, + SubscribeOptions{.propId = PROP, .flags = SubscribeFlags::EVENTS_FROM_CAR}, }; StatusCode res = manager->subscribe(cb, options); @@ -259,11 +256,7 @@ TEST_F(VehicleHalManagerTest, subscribe) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = { - SubscribeOptions { - .propId = PROP, - .flags = SubscribeFlags::DEFAULT - } - }; + SubscribeOptions{.propId = PROP, .flags = SubscribeFlags::EVENTS_FROM_CAR}}; StatusCode res = manager->subscribe(cb, options); ASSERT_EQ(StatusCode::OK, res); @@ -301,18 +294,14 @@ TEST_F(VehicleHalManagerTest, subscribe_WriteOnly) { sp<MockedVehicleCallback> cb = new MockedVehicleCallback(); hidl_vec<SubscribeOptions> options = { - SubscribeOptions { - .propId = PROP, - .flags = SubscribeFlags::HAL_EVENT - }, + SubscribeOptions{.propId = PROP, .flags = SubscribeFlags::EVENTS_FROM_CAR}, }; StatusCode res = manager->subscribe(cb, options); // Unable to subscribe on Hal Events for write-only properties. ASSERT_EQ(StatusCode::INVALID_ARG, res); - - options[0].flags = SubscribeFlags::SET_CALL; + options[0].flags = SubscribeFlags::EVENTS_FROM_ANDROID; res = manager->subscribe(cb, options); // OK to subscribe on SET method call for write-only properties. @@ -396,8 +385,8 @@ TEST_F(VehicleHalManagerTest, set_DifferentAreas) { const auto PROP = toInt(VehicleProperty::HVAC_FAN_SPEED); const auto VAL1 = 1; const auto VAL2 = 2; - const auto AREA1 = toInt(VehicleAreaZone::ROW_1_LEFT); - const auto AREA2 = toInt(VehicleAreaZone::ROW_1_RIGHT); + const auto AREA1 = toInt(VehicleAreaSeat::ROW_1_LEFT); + const auto AREA2 = toInt(VehicleAreaSeat::ROW_1_RIGHT); { auto expectedValue1 = hal->getValuePool()->obtainInt32(VAL1); diff --git a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h index 3cabcf292..108e32fef 100644 --- a/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h +++ b/automotive/vehicle/2.0/default/tests/VehicleHalTestUtils.h @@ -40,64 +40,38 @@ const VehiclePropConfig kVehicleProperties[] = { .configString = "Some=config,options=if,you=have_any", }, - { - .prop = toInt(VehicleProperty::HVAC_FAN_SPEED), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = { - VehicleAreaConfig { - .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), - .minInt32Value = 1, - .maxInt32Value = 7}, - VehicleAreaConfig { - .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT), - .minInt32Value = 1, - .maxInt32Value = 5, - } - } - }, + {.prop = toInt(VehicleProperty::HVAC_FAN_SPEED), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = + {VehicleAreaConfig{ + .areaId = toInt(VehicleAreaSeat::ROW_1_LEFT), .minInt32Value = 1, .maxInt32Value = 7}, + VehicleAreaConfig{ + .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT), .minInt32Value = 1, .maxInt32Value = 5, + }}}, // Write-only property - { - .prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE), - .access = VehiclePropertyAccess::WRITE, - .changeMode = VehiclePropertyChangeMode::ON_SET, - .areaConfigs = { - VehicleAreaConfig { - .areaId = toInt(VehicleAreaZone::ROW_1_LEFT), - .minInt32Value = 64, - .maxInt32Value = 80}, - VehicleAreaConfig { - .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT), - .minInt32Value = 64, - .maxInt32Value = 80, - } - } - }, - - { - .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = { - VehicleAreaConfig { - .minFloatValue = 0, - .maxFloatValue = 1.0 - } - } - }, - - { - .prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE, - .areaConfigs = { - VehicleAreaConfig { - .minInt32Value = 0, - .maxInt32Value = 10 - } - } - }, + {.prop = toInt(VehicleProperty::HVAC_SEAT_TEMPERATURE), + .access = VehiclePropertyAccess::WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.areaId = toInt(VehicleAreaSeat::ROW_1_LEFT), + .minInt32Value = 64, + .maxInt32Value = 80}, + VehicleAreaConfig{ + .areaId = toInt(VehicleAreaSeat::ROW_1_RIGHT), + .minInt32Value = 64, + .maxInt32Value = 80, + }}}, + + {.prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.minFloatValue = 0, .maxFloatValue = 1.0}}}, + + {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + .areaConfigs = {VehicleAreaConfig{.minInt32Value = 0, .maxInt32Value = 10}}}, { .prop = toInt(VehicleProperty::MIRROR_FOLD), @@ -107,12 +81,9 @@ const VehiclePropConfig kVehicleProperties[] = { }, // Complex data type. - { - .prop = kCustomComplexProperty, - .access = VehiclePropertyAccess::READ_WRITE, - .changeMode = VehiclePropertyChangeMode::ON_CHANGE - } -}; + {.prop = kCustomComplexProperty, + .access = VehiclePropertyAccess::READ_WRITE, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE}}; constexpr auto kTimeout = std::chrono::milliseconds(500); diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index 93a903f76..15ba49406 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -17,28 +17,28 @@ package android.hardware.automotive.vehicle@2.0; /** - * Enumerates supported data types for VehicleProperty. + * Enumerates supported data type for VehicleProperty. * - * This is a bitwise flag that supposed to be used in VehicleProperty enum. + * Used to create property ID in VehicleProperty enum. */ enum VehiclePropertyType : int32_t { - STRING = 0x00100000, - BOOLEAN = 0x00200000, - INT32 = 0x00400000, - INT32_VEC = 0x00410000, - INT64 = 0x00500000, - INT64_VEC = 0x00510000, - FLOAT = 0x00600000, - FLOAT_VEC = 0x00610000, - BYTES = 0x00700000, + STRING = 0x00100000, + BOOLEAN = 0x00200000, + INT32 = 0x00400000, + INT32_VEC = 0x00410000, + INT64 = 0x00500000, + INT64_VEC = 0x00510000, + FLOAT = 0x00600000, + FLOAT_VEC = 0x00610000, + BYTES = 0x00700000, /** * Any combination of scalar or vector types. The exact format must be * provided in the description of the property. */ - MIXED = 0x00e00000, + MIXED = 0x00e00000, - MASK = 0x00ff0000 + MASK = 0x00ff0000 }; /** @@ -50,51 +50,60 @@ enum VehiclePropertyType : int32_t { * Other properties may not be associated with particular vehicle area, * these kind of properties must have VehicleArea:GLOBAL flag. * - * This is a bitwise flag that supposed to be used in VehicleProperty enum. + * Used to create property ID in VehicleProperty enum. */ enum VehicleArea : int32_t { - GLOBAL = 0x01000000, - ZONE = 0x02000000, - WINDOW = 0x03000000, - MIRROR = 0x04000000, - SEAT = 0x05000000, - DOOR = 0x06000000, - - MASK = 0x0f000000, + GLOBAL = 0x01000000, + /** WINDOW maps to enum VehicleAreaWindow */ + WINDOW = 0x03000000, + /** MIRROR maps to enum VehicleAreaMirror */ + MIRROR = 0x04000000, + /** SEAT maps to enum VehicleAreaSeat */ + SEAT = 0x05000000, + /** DOOR maps to enum VehicleAreaDoor */ + DOOR = 0x06000000, + /** WHEEL maps to enum Wheel */ + WHEEL = 0x07000000, + + MASK = 0x0f000000, }; /** * Enumerates property groups. * - * This is a bitwise flag that supposed to be used in VehicleProperty enum. + * Used to create property ID in VehicleProperty enum. */ enum VehiclePropertyGroup : int32_t { /** - * Properties declared in AOSP must have this flag. + * Properties declared in AOSP must use this flag. */ - SYSTEM = 0x10000000, + SYSTEM = 0x10000000, /** - * Properties declared by vendors must have this flag. + * Properties declared by vendors must use this flag. */ - VENDOR = 0x20000000, + VENDOR = 0x20000000, - MASK = 0xf0000000, + MASK = 0xf0000000, }; /** * Declares all vehicle properties. VehicleProperty has a bitwise structure. * Each property must have: - * - an unique id from range 0x0100 - 0xffff - * - associated data type using VehiclePropertyType - * - property group (VehiclePropertyGroup) - * - vehicle area (VehicleArea) + * - a unique id from range 0x0100 - 0xffff + * - associated data type using VehiclePropertyType + * - property group (VehiclePropertyGroup) + * - vehicle area (VehicleArea) * * Vendors are allowed to extend this enum with their own properties. In this * case they must use VehiclePropertyGroup:VENDOR flag when property is * declared. + * + * When a property's status field is not set to AVAILABLE: + * - IVehicle#set may return StatusCode::NOT_AVAILABLE. + * - IVehicle#get is not guaranteed to work. */ -enum VehicleProperty: int32_t { +enum VehicleProperty : int32_t { /** Undefined property. */ INVALID = 0x00000000, @@ -105,14 +114,14 @@ enum VehicleProperty: int32_t { * @change_mode VehiclePropertyChangeMode:STATIC * @access VehiclePropertyAccess:READ */ - INFO_VIN= ( + INFO_VIN = ( 0x0100 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:STRING | VehicleArea:GLOBAL), /** - * Maker name of vehicle + * Manufacturer of vehicle * * @change_mode VehiclePropertyChangeMode:STATIC * @access VehiclePropertyAccess:READ @@ -162,11 +171,11 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** - * List of fuels the vehicle may use. Uses enum FuelType + * List of fuels the vehicle may use * * @change_mode VehiclePropertyChangeMode:STATIC * @access VehiclePropertyAccess:READ - * @unit VehicleUnit:MILLILITERS + * @data_enum FuelType */ INFO_FUEL_TYPE = ( 0x0105 @@ -189,9 +198,10 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** - * List of connectors this EV may use. Uses enum EvConnectorType + * List of connectors this EV may use * * @change_mode VehiclePropertyChangeMode:STATIC + * @data_enum EvConnectorType * @access VehiclePropertyAccess:READ */ INFO_EV_CONNECTOR_TYPE = ( @@ -201,9 +211,49 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** + * Fuel door location + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @data_enum FuelDoorLocationType + * @access VehiclePropertyAccess:READ + */ + INFO_FUEL_DOOR_LOCATION = ( + 0x0108 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * EV port location + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @data_enum PortLocationType + */ + INFO_EV_PORT_LOCATION = ( + 0x0109 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * Driver's seat location + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @data_enum VehicleAreaSeat + * @access VehiclePropertyAccess:READ + */ + INFO_DRIVER_SEAT = ( + 0x010A + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:SEAT), + + + /** * Current odometer value of the vehicle * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE | VehiclePropertyChangeMode:CONTINUOUS + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:KILOMETER */ @@ -216,7 +266,7 @@ enum VehicleProperty: int32_t { /** * Speed of the vehicle * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:METER_PER_SEC */ @@ -227,22 +277,9 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** - * Engine on - * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ - */ - ENGINE_ON = ( - 0x0300 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:BOOLEAN - | VehicleArea:GLOBAL), - - - /** * Temperature of engine coolant * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:CELSIUS */ @@ -268,7 +305,7 @@ enum VehicleProperty: int32_t { /** * Temperature of engine oil * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:CELSIUS */ @@ -281,7 +318,7 @@ enum VehicleProperty: int32_t { /** * Engine rpm * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:RPM */ @@ -310,7 +347,7 @@ enum VehicleProperty: int32_t { * int64Values[3] = rear right ticks * int64Values[4] = rear left ticks * - * configArray is used to indicate the micrometers-per-wheel-tick value as well as + * configArray is used to indicate the micrometers-per-wheel-tick value and * which wheels are supported. configArray is set as follows: * * configArray[0], bits [0:3] = supported wheels. Uses enum Wheel. @@ -327,10 +364,10 @@ enum VehicleProperty: int32_t { * @access VehiclePropertyAccess:READ */ WHEEL_TICK = ( - 0x0306 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:MIXED - | VehicleArea:GLOBAL), + 0x0306 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT64_VEC + | VehicleArea:GLOBAL), /** @@ -338,7 +375,7 @@ enum VehicleProperty: int32_t { * * Value may not exceed INFO_FUEL_CAPACITY * - * @change_mode VehiclePropertyChangeMode:STATIC + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:MILLILITER */ @@ -351,8 +388,8 @@ enum VehicleProperty: int32_t { /** * Fuel door open * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE */ FUEL_DOOR_OPEN = ( 0x0308 @@ -365,7 +402,7 @@ enum VehicleProperty: int32_t { * * Value may not exceed INFO_EV_BATTERY_CAPACITY * - * @change_mode VehiclePropertyChangeMode:STATIC + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:WH */ @@ -378,8 +415,8 @@ enum VehicleProperty: int32_t { /** * EV charge port open * - * @change_mode VehiclePropertyChangeMode:STATIC - * @access VehiclePropertyAccess:READ + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE */ EV_CHARGE_PORT_OPEN = ( 0x030A @@ -390,7 +427,7 @@ enum VehicleProperty: int32_t { /** * EV charge port connected * - * @change_mode VehiclePropertyChangeMode:STATIC + * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ */ EV_CHARGE_PORT_CONNECTED = ( @@ -405,7 +442,7 @@ enum VehicleProperty: int32_t { * Positive value indicates battery is being charged. * Negative value indicates battery being discharged. * - * @change_mode VehiclePropertyChangeMode:STATIC + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:MW */ @@ -416,8 +453,42 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** + * Range remaining + * + * Meters remaining of fuel and charge. Range remaining shall account for + * all energy sources in a vehicle. For example, a hybrid car's range will + * be the sum of the ranges based on fuel and battery. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ_WRITE + * @unit VehicleUnit:METER + */ + RANGE_REMAINING = ( + 0x0308 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:FLOAT + | VehicleArea:GLOBAL), + + /** + * Tire pressure + * + * The min/max range is used to indicate the recommended tire pressure. + * + * @change_mode VehiclePropertyChangeMode:CONTINUOUS + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:KILOPASCAL + */ + TIRE_PRESSURE = ( + 0x0309 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:MIXED + | VehicleArea:WHEEL), + + /** * Currently selected gear * + * This is the gear selected by the user. + * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ * @data_enum VehicleGear @@ -469,6 +540,10 @@ enum VehicleProperty: int32_t { /** * Warning for fuel low level. * + * This property corresponds to the low fuel warning on the dashboard. + * Once FUEL_LEVEL_LOW is set, it should not be cleared until more fuel is + * added to the vehicle. + * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ */ @@ -479,7 +554,9 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** - * Night mode or not. + * Night mode + * + * True indicates that night mode is currently enabled. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ @@ -493,8 +570,6 @@ enum VehicleProperty: int32_t { /** * State of the vehicles turn signals * - * Values from VehicleTurnSignal - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ * @data_enum VehicleTurnSignal @@ -514,12 +589,16 @@ enum VehicleProperty: int32_t { */ IGNITION_STATE = ( 0x0409 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:INT32 - | VehicleArea:GLOBAL), + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), /** - * ABS is active. Set to true whenever ABS is activated. Reset to false when ABS is off. + * ABS is active + * + * Set to true when ABS is active. Reset to false when ABS is off. This + * property may be intermittently set (pulsing) based on the real-time + * state of the ABS system. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ @@ -531,7 +610,11 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** - * Traction Control is active. + * Traction Control is active + * + * Set to true when traction control (TC) is active. Reset to false when + * TC is off. This property may be intermittently set (pulsing) based on + * the real-time state of the TC system. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ @@ -545,10 +628,6 @@ enum VehicleProperty: int32_t { /** * Fan speed setting * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ @@ -556,15 +635,11 @@ enum VehicleProperty: int32_t { 0x0500 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32 - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * Fan direction setting * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE * @data_enum VehicleHvacFanDirection @@ -573,15 +648,11 @@ enum VehicleProperty: int32_t { 0x0501 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32 - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * HVAC current temperature. * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ @@ -589,15 +660,11 @@ enum VehicleProperty: int32_t { 0x0502 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:FLOAT - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * HVAC, target temperature set. * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ @@ -605,14 +672,10 @@ enum VehicleProperty: int32_t { 0x0503 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:FLOAT - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** - * On/off defrost - * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. + * On/off defrost for designated window * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE @@ -624,28 +687,25 @@ enum VehicleProperty: int32_t { | VehicleArea:WINDOW), /** - * On/off AC - * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. + * On/off AC for designated areaId * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE - * @config_flags Supported zones + * @config_flags Supported areaIds */ HVAC_AC_ON = ( 0x0505 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * On/off max AC * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. + * When MAX AC is on, the ECU may adjust the vent position, fan speed, + * temperature, etc as necessary to cool the vehicle as quickly as possible. + * Any parameters modified as a side effect of turning on/off the MAX AC + * parameter shall generate onPropertyEvent() callbacks to the VHAL. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE @@ -654,14 +714,16 @@ enum VehicleProperty: int32_t { 0x0506 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * On/off max defrost * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. + * When MAX DEFROST is on, the ECU may adjust the vent position, fan speed, + * temperature, etc as necessary to defrost the windows as quickly as + * possible. Any parameters modified as a side effect of turning on/off + * the MAX DEFROST parameter shall generate onPropertyEvent() callbacks to + * the VHAL. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE @@ -670,14 +732,15 @@ enum VehicleProperty: int32_t { 0x0507 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** - * On/off re-circulation + * Recirculation on/off * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. + * Controls the supply of exterior air to the cabin. Recirc “on” means the + * majority of the airflow into the cabin is originating in the cabin. + * Recirc “off” means the majority of the airflow into the cabin is coming + * from outside the car. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE @@ -686,14 +749,25 @@ enum VehicleProperty: int32_t { 0x0508 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** - * On/off dual. This must be defined per each row. + * Enable temperature coupling between zones. * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. + * The areaId for this property must include the zones that are coupled + * together. Typically, the front two zones (ROW_1_LEFT and ROW_1_RIGHT) + * are coupled together when this property is enabled. Thus, the areaId + * shall be (ROW_1_LEFT | ROW_1_RIGHT). When the property is enabled, the + * ECU may synchronize the temperature for the affected zones. Any + * parameters modified as a side effect of turning on/off the DUAL_ON + * parameter shall generate onPropertyEvent() callbacks to the VHAL. In + * addition, if setting a temperature (i.e. driver's temp) changes another + * temperature (i.e. front passenger's temp), then the appropriate + * onPropertyEvent() callbacks must be generated. If a user changes a + * temperature that breaks the coupling (e.g. setting the passenger + * temperature independently) then the VHAL must send the appropriate + * onPropertyEvent() callbacks (i.e. HVAC_DUAL_ON = false, + * HVAC_TEMPERATURE_SET[zone] = xxx, etc). * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE @@ -702,15 +776,11 @@ enum VehicleProperty: int32_t { 0x0509 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * On/off automatic mode * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ @@ -718,7 +788,7 @@ enum VehicleProperty: int32_t { 0x050A | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * Seat temperature @@ -731,10 +801,6 @@ enum VehicleProperty: int32_t { * min/max range defines the allowable range and number of steps in each * direction. * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ @@ -747,12 +813,9 @@ enum VehicleProperty: int32_t { /** * Side Mirror Heat * - * Increase values denote higher heating levels for side mirrors. - * 0 indicates heating is turned off. - * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. + * Increasing values denote higher heating levels for side mirrors. + * The Max value in the config data represents the highest heating level. + * The Min value in the config data MUST be zero and indicates no heating. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE @@ -764,51 +827,42 @@ enum VehicleProperty: int32_t { | VehicleArea:MIRROR), /** - * Steering Wheel Temperature + * Steering Wheel Heating/Cooling * - * Sets the temperature for the steering wheel + * Sets the amount of heating/cooling for the steering wheel + * config data Min and Max MUST be set appropriately. * Positive value indicates heating. * Negative value indicates cooling. * 0 indicates temperature control is off. * - * IVehicle#set may return StatusCode::NOT_AVAILABLE and IVehicle#get is not - * guaranteed to work if HVAC unit is off. See HVAC_POWER_ON property for - * details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ - HVAC_STEERING_WHEEL_TEMP = ( + HVAC_STEERING_WHEEL_HEAT = ( 0x050D | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32 | VehicleArea:GLOBAL), /** - * Temperature units + * Temperature units for display * * Indicates whether the temperature is in Celsius, Fahrenheit, or a - * different unit from VehicleUnit enum. - * This parameter affects all HVAC temperatures in the system. - * - * IVehicle#get is not guaranteed to work if HVAC unit is off. See - * HVAC_POWER_ON property for details. + * different unit from VehicleUnit enum. This parameter MAY be used for + * displaying any HVAC temperature in the system. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ + * @access VehiclePropertyAccess:READ_WRITE */ - HVAC_TEMPERATURE_UNITS = ( + HVAC_TEMPERATURE_DISPLAY_UNITS = ( 0x050E | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32 - | VehicleArea:ZONE), + | VehicleArea:GLOBAL), /** * Actual fan speed * - * IVehicle#get is not guaranteed to work if HVAC unit is off. See - * HVAC_POWER_ON property for details. - * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ */ @@ -816,37 +870,38 @@ enum VehicleProperty: int32_t { 0x050F | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32 - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** - * Represents power state for HVAC. Some HVAC properties must require - * matching power to be turned on to get out of OFF state. For non-zoned - * HVAC properties, VEHICLE_ALL_ZONE corresponds to global power state. + * Represents global power state for HVAC. Setting this property to false + * MAY mark some properties that control individual HVAC features/subsystems + * to UNAVAILABLE state. Setting this property to true MAY mark some + * properties that control individual HVAC features/subsystems to AVAILABLE + * state (unless any/all of them are UNAVAILABLE on their own individual + * merits). The list of properties affected by HVAC_POWER_ON must be set + * in the VehiclePropConfig.configArray. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE - * @config_string list of HVAC properties whose power is controlled by this - * property. Format is hexa-decimal number (0x...) separated - * by comma like "0x500,0x503". All zones defined in these - * affected properties must be available in the property. */ HVAC_POWER_ON = ( 0x0510 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** * Fan Positions Available * - * This is a bit mask of fan positions available for the zone. Each available fan direction is - * denoted by a separate entry in the vector. A fan direction may have multiple bits from - * vehicle_hvac_fan_direction set. For instance, a typical car may have the following setting: - * - [0] = FAN_DIRECTION_FACE (0x1) - * - [1] = FAN_DIRECTION_FLOOR (0x2) - * - [2] = FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3) - * - [3] = FAN_DIRECTION_DEFROST (0x4) - * - [4] = FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6) + * This is a bit mask of fan positions available for the zone. Each + * available fan direction is denoted by a separate entry in the vector. A + * fan direction may have multiple bits from vehicle_hvac_fan_direction set. + * For instance, a typical car may have the following fan positions: + * - FAN_DIRECTION_FACE (0x1) + * - FAN_DIRECTION_FLOOR (0x2) + * - FAN_DIRECTION_FACE | FAN_DIRECTION_FLOOR (0x3) + * - FAN_DIRECTION_DEFROST (0x4) + * - FAN_DIRECTION_FLOOR | FAN_DIRECTION_DEFROST (0x6) * * @change_mode VehiclePropertyChangeMode:STATIC * @access VehiclePropertyAccess:READ @@ -855,13 +910,14 @@ enum VehicleProperty: int32_t { 0x0511 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32_VEC - | VehicleArea:ZONE), + | VehicleArea:SEAT), /** - * Automatic re-circulation on/off + * Automatic recirculation on/off * - * IVehicle#set and IVehicle#get must return StatusCode::NOT_AVAILABLE when HVAC unit is off. - * See HVAC_POWER_ON property for details. + * When automatic recirculation is ON, the HVAC system may automatically + * switch to recirculation mode if the vehicle detects poor incoming air + * quality. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE @@ -870,12 +926,32 @@ enum VehicleProperty: int32_t { 0x0512 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN - | VehicleArea:ZONE), + | VehicleArea:SEAT), + + /** + * Seat ventilation + * + * 0 indicates off. + * Positive values indicates ventilation level. + * + * Used by HVAC apps and Assistant to enable, change, or read state of seat + * ventilation. This is different than seating cooling. It can be on at the + * same time as cooling, or not. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + HVAC_SEAT_VENTILATION = ( + 0x0513 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:SEAT), + /** * Outside temperature * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:CELSIUS */ @@ -888,7 +964,7 @@ enum VehicleProperty: int32_t { /** * Cabin temperature * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE|VehiclePropertyChangeMode:CONTINUOUS + * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ * @unit VehicleUnit:CELSIUS */ @@ -896,31 +972,7 @@ enum VehicleProperty: int32_t { 0x0704 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:FLOAT - | VehicleArea:GLOBAL), - - /** - * Radio presets stored on the Car radio module. The data type used is int32 - * array with the following fields: - * <ul> - * <li> int32Values[0]: Preset number </li> - * <li> int32Values[1]: Band type (see #RADIO_BAND_FM in - * system/core/include/system/radio.h). - * <li> int32Values[2]: Channel number </li> - * <li> int32Values[3]: Sub channel number </li> - * </ul> - * - * NOTE: When getting a current preset config ONLY set preset number (i.e. - * int32Values[0]). For setting a preset other fields are required. - * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - * @config_flags Number of presets supported - */ - RADIO_PRESET = ( - 0x0801 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:INT32_VEC - | VehicleArea:GLOBAL), + | VehicleArea:SEAT), /** * Property to control power state of application processor @@ -931,40 +983,36 @@ enum VehicleProperty: int32_t { * For configuration information, VehiclePropConfig.configFlags can * have bit flag combining values in VehicleApPowerStateConfigFlag. * - * Value format for IVehicle#get / IVehicle#subscribe: - * int32Values[0] : vehicle_ap_power_state_type + * int32Values[0] : VehicleApPowerStateReq enum value * int32Values[1] : additional parameter relevant for each state, * 0 if not used. - * Value format for IVehicle#set: - * int32Values[0] : vehicle_ap_power_state_set_type - * int32Values[1] : additional parameter relevant for each request. should be 0 if not used. * - * @change_mode VEHICLE_PROP_CHANGE_MODE_ON_CHANGE - * @access VEHICLE_PROP_ACCESS_READ_WRITE + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VEHICLE_PROP_ACCESS_READ */ - AP_POWER_STATE = ( + AP_POWER_STATE_REQ = ( 0x0A00 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32_VEC | VehicleArea:GLOBAL), /** - * Property to represent brightness of the display. Some cars have single - * control for the brightness of all displays and this property is to share - * change in that control. + * Property to report power state of application processor * - * If this is writable, android side can set this value when user changes - * display brightness from Settings. If this is read only, user may still - * change display brightness from Settings, but that will not be reflected - * to other displays. + * It is assumed that AP's power state is controller by separate power + * controller. + * + * int32Values[0] : VehicleApPowerStateReport enum value + * int32Values[1] : Time in ms to wake up, if necessary. Otherwise 0. + * * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE + * @access VEHICLE_PROP_ACCESS_WRITE */ - DISPLAY_BRIGHTNESS = ( + AP_POWER_STATE_REPORT = ( 0x0A01 | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:INT32 + | VehiclePropertyType:INT32_VEC | VehicleArea:GLOBAL), /** @@ -986,6 +1034,25 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** + * Property to represent brightness of the display. Some cars have single + * control for the brightness of all displays and this property is to share + * change in that control. + * + * If this is writable, android side can set this value when user changes + * display brightness from Settings. If this is read only, user may still + * change display brightness from Settings, but that must not be reflected + * to other displays. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + DISPLAY_BRIGHTNESS = ( + 0x0A03 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** * Property to feed H/W input events to android * * int32Values[0] : action defined by VehicleHwKeyInputAction @@ -993,6 +1060,7 @@ enum VehicleProperty: int32_t { * int32Values[2] : target display defined in VehicleDisplay. Events not * tied to specific display must be sent to * VehicleDisplay#MAIN. + * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ * @config_flags @@ -1003,36 +1071,23 @@ enum VehicleProperty: int32_t { | VehiclePropertyType:INT32_VEC | VehicleArea:GLOBAL), - /** - * Current date and time, encoded as Unix time. - * This value denotes the number of seconds that have elapsed since - * 1/1/1970. + /*************************************************************************** + * Most Car Cabin properties have both a POSition and MOVE parameter. These + * are used to control the various movements for seats, doors, and windows + * in a vehicle. * - * @change_mode VehiclePropertyChangeMode:ON_SET - * @access VehiclePropertyAccess:READ_WRITE - * @unit VehicleUnit:SECS - */ - UNIX_TIME = ( - 0x0A30 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:INT64 - | VehicleArea:GLOBAL), - - /** - * Current time only. - * Some vehicles may not keep track of date. This property only affects - * the current time, in seconds during the day. Thus, the max value for - * this parameter is 86,400 (24 * 60 * 60) + * A POS parameter allows the user to set the absolution position. For + * instance, for a door, 0 indicates fully closed and max value indicates + * fully open. Thus, a value halfway between min and max must indicate + * the door is halfway open. * - * @change_mode VehiclePropertyChangeMode:ON_SET - * @access VehiclePropertyAccess:READ_WRITE - * @unit VehicleUnit:SECS - */ - CURRENT_TIME_IN_SECONDS = ( - 0x0A31 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:INT32 - | VehicleArea:GLOBAL), + * A MOVE parameter moves the device in a particular direction. The sign + * indicates direction, and the magnitude indicates speed (if multiple + * speeds are available). For a door, a move of -1 will close the door, and + * a move of +1 will open it. Once a door reaches the limit of open/close, + * the door should automatically stop moving. The user must NOT need to + * send a MOVE(0) command to stop the door at the end of its range. + **************************************************************************/ /** * Door position @@ -1187,7 +1242,7 @@ enum VehicleProperty: int32_t { * * This setting allows the user to save the current seat position settings * into the selected preset slot. The maxValue for each seat position - * shall match the maxValue for SEAT_MEMORY_SELECT. + * must match the maxValue for SEAT_MEMORY_SELECT. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:WRITE @@ -1577,6 +1632,14 @@ enum VehicleProperty: int32_t { * Max = window up / closed * Min = window down / open * + * For a window that may open out of plane (i.e. vent mode of sunroof) this + * parameter will work with negative values as follows: + * Max = sunroof completely open + * 0 = sunroof closed. + * Min = sunroof vent completely open + * + * Note that in this mode, 0 indicates the window is closed. + * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ @@ -1594,45 +1657,26 @@ enum VehicleProperty: int32_t { * Magnitude denotes relative speed. I.e. +2 is faster than +1 in raising * the window. * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - WINDOW_MOVE = ( - 0x0BC1 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:INT32 - | VehicleArea:WINDOW), - - /** - * Window Vent Position + * For a window that may open out of plane (i.e. vent mode of sunroof) this + * parameter will work as follows: * - * This feature is used to control the vent feature on a sunroof. + * If sunroof is open: + * Max = open the sunroof further, automatically stop when fully open. + * Min = close the sunroof, automatically stop when sunroof is closed. * - * Max = vent open - * Min = vent closed + * If vent is open: + * Max = close the vent, automatically stop when vent is closed. + * Min = open the vent further, automatically stop when vent is fully open. * - * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ_WRITE - */ - WINDOW_VENT_POS = ( - 0x0BC2 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:INT32 - | VehicleArea:WINDOW), - - /** - * Window Vent Move - * - * This feature is used to control the vent feature on a sunroof. - * - * Max = vent open - * Min = vent closed + * If window is in the closed position: + * Max = open the sunroof, automatically stop when sunroof is fully open. + * Min = open the vent, automatically stop when vent is fully open. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE */ - WINDOW_VENT_MOVE = ( - 0x0BC3 + WINDOW_MOVE = ( + 0x0BC1 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:INT32 | VehicleArea:WINDOW), @@ -1716,10 +1760,10 @@ enum VehicleProperty: int32_t { * @access VehiclePropertyAccess:READ */ OBD2_LIVE_FRAME = ( - 0x0D00 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:MIXED - | VehicleArea:GLOBAL), + 0x0D00 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:MIXED + | VehicleArea:GLOBAL), /** * OBD2 Freeze Frame Sensor Data @@ -1746,10 +1790,10 @@ enum VehicleProperty: int32_t { * @access VehiclePropertyAccess:READ */ OBD2_FREEZE_FRAME = ( - 0x0D01 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:MIXED - | VehicleArea:GLOBAL), + 0x0D01 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:MIXED + | VehicleArea:GLOBAL), /** * OBD2 Freeze Frame Information @@ -1767,10 +1811,10 @@ enum VehicleProperty: int32_t { * @access VehiclePropertyAccess:READ */ OBD2_FREEZE_FRAME_INFO = ( - 0x0D02 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:MIXED - | VehicleArea:GLOBAL), + 0x0D02 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:MIXED + | VehicleArea:GLOBAL), /** * OBD2 Freeze Frame Clear @@ -1793,10 +1837,164 @@ enum VehicleProperty: int32_t { * @access VehiclePropertyAccess:WRITE */ OBD2_FREEZE_FRAME_CLEAR = ( - 0x0D03 - | VehiclePropertyGroup:SYSTEM - | VehiclePropertyType:MIXED - | VehicleArea:GLOBAL), + 0x0D03 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:MIXED + | VehicleArea:GLOBAL), + + /** + * Headlights State + * + * Return the current state of headlights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + HEADLIGHTS_STATE = ( + 0x0E00 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * High beam lights state + * + * Return the current state of high beam lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + HIGH_BEAM_LIGHTS_STATE = ( + 0x0E01 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * Fog light state + * + * Return the current state of fog lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + FOG_LIGHTS_STATE = ( + 0x0E02 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * Hazard light status + * + * Return the current status of hazard lights. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleLightState + */ + HAZARD_LIGHTS_STATE = ( + 0x0E03 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * Headlight switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + HEADLIGHTS_SWITCH = ( + 0x0E10 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * High beam light switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + HIGH_BEAM_LIGHTS_SWITCH = ( + 0x0E11 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * Fog light switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + FOG_LIGHTS_SWITCH = ( + 0x0E12 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + + /** + * Hazard light switch + * + * The setting that the user wants. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @data_enum VehicleLightSwitch + */ + HAZARD_LIGHTS_SWITCH = ( + 0x0E13 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), +}; + +/** + * Used by lights state properties to enumerate the current state of the lights. + * + * Most XXX_LIGHTS_STATE properties will only report ON and OFF states. Only + * the HEADLIGHTS_STATE property will report DAYTIME_RUNNING. + */ +enum VehicleLightState : int32_t { + + OFF = 0, + ON = 1, + DAYTIME_RUNNING = 2 +}; + +/** + * Used by lights switch properties to enumerate user selected switch setting. + * + * XXX_LIGHTS_SWITCH properties report the switch settings that the user + * selects. The switch setting may be decoupled from the state reported if the + * user selects AUTOMATIC. + */ +enum VehicleLightSwitch : int32_t { + OFF = 0, + ON = 1, + /** + * Daytime running lights mode. Most cars automatically use DRL but some + * cars allow the user to activate them manually. + */ + DAYTIME_RUNNING = 2, + /** + * Allows the vehicle ECU to set the lights automatically + */ + AUTOMATIC = 0x100, }; /** @@ -1828,6 +2026,24 @@ enum EvConnectorType : int32_t { }; /** + * Used by INFO_FUEL_DOOR_LOCATION/INFO_CHARGE_PORT_LOCATION to enumerate fuel door or + * ev port location. + */ +enum PortLocationType : int32_t { + /** + * Default type if the vehicle does not know or report the Fuel door + * and ev port location. + */ + UNKNOWN = 0, + FRONT_LEFT = 1, + FRONT_RIGHT = 2, + REAR_RIGHT = 3, + REAR_LEFT = 4, + FRONT = 5, + REAR = 6, +}; + +/** * Used by INFO_FUEL_TYPE to enumerate the type of fuels this vehicle uses. * Consistent with projection protocol. */ @@ -1886,14 +2102,6 @@ enum VehicleOilLevel : int32_t { ERROR = 4, }; -/** - * Constants relevant to radio. - */ -enum VehicleRadioConstants : int32_t { - /** Minimum value for the radio preset */ - VEHICLE_RADIO_PRESET_MIN_VALUE = 1, -}; - enum VehicleApPowerStateConfigFlag : int32_t /* NOTE: type is guessed */ { /** * AP can enter deep sleep state. If not set, AP will always shutdown from @@ -1908,7 +2116,7 @@ enum VehicleApPowerStateConfigFlag : int32_t /* NOTE: type is guessed */ { CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2, }; -enum VehicleApPowerState : int32_t /* NOTE: type is guessed */ { +enum VehicleApPowerStateReq : int32_t { /** vehicle HAL will never publish this state to AP */ OFF = 0, @@ -1933,6 +2141,16 @@ enum VehicleApPowerState : int32_t /* NOTE: type is guessed */ { SHUTDOWN_PREPARE = 4, }; +/** + * Index in int32Values for VehicleProperty#AP_POWER_STATE_REQ property. + */ +enum VehicleApPowerStateReqIndex : int32_t { + STATE = 0, + ADDITIONAL = 1, +}; + + + enum VehicleApPowerStateShutdownParam : int32_t { /** AP must shutdown immediately. Postponing is not allowed. */ SHUTDOWN_IMMEDIATELY = 1, @@ -1944,7 +2162,7 @@ enum VehicleApPowerStateShutdownParam : int32_t { SHUTDOWN_ONLY = 3, }; -enum VehicleApPowerSetState : int32_t /* NOTE: type is guessed */ { +enum VehicleApPowerStateReport : int32_t { /** * AP has finished boot up, and can start shutdown if requested by power * controller. @@ -2009,14 +2227,6 @@ enum VehicleApPowerSetState : int32_t /* NOTE: type is guessed */ { }; /** - * Index in int32Values for VehicleProperty#AP_POWER_STATE property. - */ -enum VehicleApPowerStateIndex : int32_t { - STATE = 0, - ADDITIONAL = 1, -}; - -/** * Enum to represent bootup reason. */ enum VehicleApPowerBootupReason : int32_t { @@ -2050,7 +2260,7 @@ enum VehicleHwKeyInputAction : int32_t { }; enum VehicleDisplay : int32_t { - /** center console */ + /** The primary Android display (for example, center console) */ MAIN = 0, INSTRUMENT_CLUSTER = 1, @@ -2076,6 +2286,7 @@ enum VehicleUnit : int32_t { NANO_SECS = 0x50, SECS = 0x53, YEAR = 0x59, + KILOPASCAL = 0x70, // Electrical Units WATT_HOUR = 0x60, @@ -2084,46 +2295,33 @@ enum VehicleUnit : int32_t { MILLIWATTS = 0x63, }; - /** - * This describes how value of property can change. - */ +/** + * This describes how value of property can change. + */ enum VehiclePropertyChangeMode : int32_t { - /** - * Property of this type must never be changed. Subscription is not supported - * for these properties. - */ - STATIC = 0x00, - - /** - * Property of this type must be reported when there is a change. - * IVehicle#get call must return the current value. - * Set operation for this property is assumed to be asynchronous. When the - * property is read (using IVehicle#get) after IVehicle#set, it may still - * return old value until underlying H/W backing this property has actually - * changed the state. Once state is changed, the property must dispatch - * changed value as event. - */ - ON_CHANGE = 0x01, - - /** - * Property of this type change continuously and requires fixed rate of - * sampling to retrieve the data. - */ - CONTINUOUS = 0x02, - - /** - * Property of this type may be polled to get the current value. - */ - POLL = 0x03, - - /** - * This is for property where change event must be sent only when the - * value is set from external component. Normal value change must not trigger - * event. For example, clock property can send change event only when it is - * set, outside android, for case like user setting time or time getting - * update. There is no need to send it per every value change. - */ - ON_SET = 0x04, + /** + * Property of this type must never be changed. Subscription is not supported + * for these properties. + */ + STATIC = 0x00, + + /** + * Properties of this type must report when there is a change. + * IVehicle#get call must return the current value. + * Set operation for this property is assumed to be asynchronous. When the + * property is read (using IVehicle#get) after IVehicle#set, it may still + * return old value until underlying H/W backing this property has actually + * changed the state. Once state is changed, the property must dispatch + * changed value as event. + */ + ON_CHANGE = 0x01, + + /** + * Properties of this type change continuously and require a fixed rate of + * sampling to retrieve the data. Implementers may choose to send extra + * notifications on significant value changes. + */ + CONTINUOUS = 0x02, }; /** @@ -2147,8 +2345,15 @@ enum VehiclePropertyStatus : int32_t { /** Property is available and behaving normally */ AVAILABLE = 0x00, /** - * Property is not available, for read and/or write. This is a transient state, as the - * property is expected to be available at a later time. + * A property in this state is not available for reading and writing. This + * is a transient state that depends on the availability of the underlying + * implementation (e.g. hardware or driver). It MUST NOT be used to + * represent features that this vehicle is always incapable of. A get() of + * a property in this state MAY return an undefined value, but MUST + * correctly describe its status as UNAVAILABLE A set() of a property in + * this state MAY return NOT_AVAILABLE. The HAL implementation MUST ignore + * the value of the status field when writing a property value coming from + * Android. */ UNAVAILABLE = 0x01, /** There is an error with this property. */ @@ -2158,12 +2363,11 @@ enum VehiclePropertyStatus : int32_t { /** * Various gears which can be selected by user and chosen in system. */ -enum VehicleGear: int32_t { +enum VehicleGear : int32_t { GEAR_NEUTRAL = 0x0001, GEAR_REVERSE = 0x0002, GEAR_PARK = 0x0004, GEAR_DRIVE = 0x0008, - GEAR_LOW = 0x0010, GEAR_1 = 0x0010, GEAR_2 = 0x0020, GEAR_3 = 0x0040, @@ -2176,27 +2380,6 @@ enum VehicleGear: int32_t { }; /** - * Various zones in the car. - * - * Zones are used for Air Conditioning purposes and divide the car into physical - * area zones. - */ -enum VehicleAreaZone : int32_t { - ROW_1_LEFT = 0x00000001, - ROW_1_CENTER = 0x00000002, - ROW_1_RIGHT = 0x00000004, - ROW_2_LEFT = 0x00000010, - ROW_2_CENTER = 0x00000020, - ROW_2_RIGHT = 0x00000040, - ROW_3_LEFT = 0x00000100, - ROW_3_CENTER = 0x00000200, - ROW_3_RIGHT = 0x00000400, - ROW_4_LEFT = 0x00001000, - ROW_4_CENTER = 0x00002000, - ROW_4_RIGHT = 0x00004000, -}; - -/** * Various Seats in the car. */ enum VehicleAreaSeat : int32_t { @@ -2215,15 +2398,18 @@ enum VehicleAreaSeat : int32_t { * Various windshields/windows in the car. */ enum VehicleAreaWindow : int32_t { - FRONT_WINDSHIELD = 0x0001, - REAR_WINDSHIELD = 0x0002, - ROOF_TOP = 0x0004, - ROW_1_LEFT = 0x0010, - ROW_1_RIGHT = 0x0020, - ROW_2_LEFT = 0x0100, - ROW_2_RIGHT = 0x0200, - ROW_3_LEFT = 0x1000, - ROW_3_RIGHT = 0x2000, + FRONT_WINDSHIELD = 0x00000001, + REAR_WINDSHIELD = 0x00000002, + ROW_1_LEFT = 0x00000010, + ROW_1_RIGHT = 0x00000040, + ROW_2_LEFT = 0x00000100, + ROW_2_RIGHT = 0x00000400, + ROW_3_LEFT = 0x00001000, + ROW_3_RIGHT = 0x00004000, + + ROOF_TOP_1 = 0x00010000, + ROOF_TOP_2 = 0x00020000, + }; enum VehicleAreaDoor : int32_t { @@ -2247,7 +2433,6 @@ enum VehicleTurnSignal : int32_t { NONE = 0x00, RIGHT = 0x01, LEFT = 0x02, - EMERGENCY = 0x04, }; struct VehicleAreaConfig { @@ -2321,9 +2506,6 @@ struct VehiclePropConfig { * events. */ struct VehiclePropValue { - /** Property identifier */ - int32_t prop; - /** Time is elapsed nanoseconds since boot */ int64_t timestamp; @@ -2333,6 +2515,9 @@ struct VehiclePropValue { */ int32_t areaId; + /** Property identifier */ + int32_t prop; + /** Status of the property */ VehiclePropertyStatus status; @@ -2372,11 +2557,11 @@ enum VehicleIgnitionState : int32_t { /** Steering wheel is locked */ LOCK = 1, - /** - * Steering wheel is not locked, engine and all accessories are OFF. If - * car can be in LOCK and OFF state at the same time than HAL must report - * LOCK state. - */ + /** + * Steering wheel is not locked, engine and all accessories are OFF. If + * car can be in LOCK and OFF state at the same time than HAL must report + * LOCK state. + */ OFF, /** @@ -2395,33 +2580,6 @@ enum VehicleIgnitionState : int32_t { START }; - -/** - * Represent the operation where the current error has happened. - */ -enum VehiclePropertyOperation : int32_t { - /** - * Generic error to this property which is not tied to any operation. - */ - GENERIC = 0, - - /** - * Error happened while handling property set. - */ - SET = 1, - - /** - * Error happened while handling property get. - */ - GET = 2, - - /** - * Error happened while handling property subscription. - */ - SUBSCRIBE = 3, -}; - - enum SubscribeFlags : int32_t { UNDEFINED = 0x0, @@ -2429,15 +2587,13 @@ enum SubscribeFlags : int32_t { * Subscribe to event that was originated in vehicle HAL * (most likely this event came from the vehicle itself). */ - HAL_EVENT = 0x1, + EVENTS_FROM_CAR = 0x1, /** * Use this flag to subscribe on events when IVehicle#set(...) was called by * vehicle HAL's client (e.g. Car Service). */ - SET_CALL = 0x2, - - DEFAULT = HAL_EVENT, + EVENTS_FROM_ANDROID = 0x2, }; /** @@ -2458,7 +2614,7 @@ struct SubscribeOptions { */ float sampleRate; - /** Flags that indicate what kind of events listen to. */ + /** Flags that indicate to which event sources to listen. */ SubscribeFlags flags; }; @@ -2748,11 +2904,11 @@ enum DiagnosticFloatSensorIndex : int32_t { ACCELERATOR_PEDAL_POSITION_E = 54, /* PID 0x4A */ ACCELERATOR_PEDAL_POSITION_F = 55, /* PID 0x4B */ COMMANDED_THROTTLE_ACTUATOR = 56, /* PID 0x4C */ - ETHANOL_FUEL_PERCENTAGE = 57,/* PID 0x52 */ + ETHANOL_FUEL_PERCENTAGE = 57, /* PID 0x52 */ ABSOLUTE_EVAPORATION_SYSTEM_VAPOR_PRESSURE = 58, /* PID 0x53 */ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 59, /* PID 0x55 */ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 60, /* PID 0x57 */ - SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61,/* PID 0x55 */ + SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 61, /* PID 0x55 */ SHORT_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 62, /* PID 0x57 */ LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, /* PID 0x56 */ LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, /* PID 0x58 */ @@ -2978,7 +3134,7 @@ enum VmsSubscriptionsStateIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex * - Layer version * - Number of publisher IDs (N) * - N x publisher ID -*/ + */ enum VmsAvailabilityStateIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex { SEQUENCE_NUMBER = 1, NUMBER_OF_ASSOCIATED_LAYERS = 2, |