From 84b5aeaaf9da6f2526a8e789ef441defb66990f1 Mon Sep 17 00:00:00 2001 From: Steve Paik Date: Fri, 22 Dec 2017 12:31:51 -0800 Subject: [PATCH] Add ENGINE_OIL_LEVEL, PARKING_BRAKE_AUTO_APPLY Bug: 62337898 Bug: 62337346 Test: Vehicle emulator test Change-Id: If2ea2ccb0b128e7f30a747e329fd3b7bd0d0234b --- .../default/impl/vhal_v2_0/DefaultConfig.h | 8 ++++ automotive/vehicle/2.0/types.hal | 38 ++++++++++++++++++- 2 files changed, 45 insertions(+), 1 deletion(-) 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 18e8c40069..7938b73122 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 @@ -356,6 +356,14 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.int32Values = {toInt(VehicleIgnitionState::ON)}}}, + {.config = + { + .prop = toInt(VehicleProperty::ENGINE_OIL_LEVEL), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {toInt(VehicleOilLevel::NORMAL)}}}, + {.config = { .prop = toInt(VehicleProperty::ENGINE_OIL_TEMP), diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index be98a5686a..80b6e0a27a 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -252,6 +252,19 @@ enum VehicleProperty: int32_t { | VehiclePropertyType:FLOAT | VehicleArea:GLOBAL), + /** + * Engine oil level + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * @data_enum VehicleOilLevel + */ + ENGINE_OIL_LEVEL = ( + 0x0303 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + /** * Temperature of engine oil * @@ -433,7 +446,7 @@ enum VehicleProperty: int32_t { * Parking brake state. * * @change_mode VehiclePropertyChangeMode:ON_CHANGE - * @access VehiclePropertyAccess:READ + * @access VehiclePropertyAccess:READ_WRITE */ PARKING_BRAKE_ON = ( 0x0402 @@ -441,6 +454,18 @@ enum VehicleProperty: int32_t { | VehiclePropertyType:BOOLEAN | VehicleArea:GLOBAL), + /** + * Auto-apply parking brake. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + PARKING_BRAKE_AUTO_APPLY = ( + 0x0403 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BOOLEAN + | VehicleArea:GLOBAL), + /** * Driving status policy. * @@ -1861,6 +1886,17 @@ enum VehicleHvacFanDirection : int32_t { DEFROST_AND_FLOOR = 0x5, }; +enum VehicleOilLevel : int32_t { + /** + * Oil level values + */ + CRITICALLY_LOW = 0, + LOW = 1, + NORMAL = 2, + HIGH = 3, + ERROR = 4, +}; + /** * Constants relevant to radio. */