From 8b6484bce6ff4a995c6df28d2780731f84eb3788 Mon Sep 17 00:00:00 2001 From: Kai Date: Wed, 8 May 2019 13:29:03 -0700 Subject: [PATCH] Add property for vehicle speed Add proerty and units for vehicle speed. Bug: 131715430 Test: build and flash Change-Id: I4b34808b75d76385d0b1b76530889f69bd945c84 --- automotive/vehicle/2.0/types.hal | 104 +++++++++++++++++++------------ 1 file changed, 63 insertions(+), 41 deletions(-) diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index b04d0962c4..c1828432a5 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -1120,9 +1120,9 @@ enum VehicleProperty : int32_t { * * Distance units are defined in VehicleUnit. * VehiclePropConfig.configArray is used to indicate the supported distance display units. - * For example: configArray[0] = 0x21 // METER - * configArray[1] = 0x23 // KILOMETER - * configArray[2] = 0x24 // MILE + * For example: configArray[0] = METER + * configArray[1] = KILOMETER + * configArray[2] = MILE * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE * @data_enum VehicleUnit @@ -1141,8 +1141,8 @@ enum VehicleProperty : int32_t { * * VehiclePropConfig.configArray is used to indicate the supported fuel volume display units. * Volume units are defined in VehicleUnit. - * For example: configArray[0] = 0x41 // LITER - * configArray[1] = 0x42 // GALLON + * For example: configArray[0] = LITER + * configArray[1] = GALLON * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE * @data_enum VehicleUnit @@ -1161,9 +1161,9 @@ enum VehicleProperty : int32_t { * * VehiclePropConfig.configArray is used to indicate the supported pressure display units. * Pressure units are defined in VehicleUnit. - * For example: configArray[0] = 0x70 // KILOPASCAL - * configArray[1] = 0x71 // PSI - * configArray[2] = 0x72 // BAR + * For example: configArray[0] = KILOPASCAL + * configArray[1] = PSI + * configArray[2] = BAR * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE * @data_enum VehicleUnit @@ -1182,9 +1182,9 @@ enum VehicleProperty : int32_t { * * VehiclePropConfig.configArray is used to indicate the supported electrical energy units. * Electrical energy units are defined in VehicleUnit. - * For example: configArray[0] = 0x60 // watt-hours - * configArray[1] = 0x64 // ampere-hours - * configArray[2] = 0x65 // kilowatt-hours + * For example: configArray[0] = WATT_HOUR + * configArray[1] = AMPERE_HOURS + * configArray[2] = KILOWATT_HOUR * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE * @data_enum VehicleUnit @@ -1211,6 +1211,25 @@ enum VehicleProperty : int32_t { | VehiclePropertyType:BOOLEAN | VehicleArea:GLOBAL), + /** + * Speed units for display + * + * Indicates type of units the car is using to display speed to user. Eg. m/s, km/h, or mph. + * + * VehiclePropConfig.configArray is used to indicate the supported speed display units. + * Pressure units are defined in VehicleUnit. + * For example: configArray[0] = METER_PER_SEC + * configArray[1] = MILES_PER_HOUR + * configArray[2] = KILOMETERS_PER_HOUR + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + */ + VEHICLE_SPEED_DISPLAY_UNITS = ( + 0x0605 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32 + | VehicleArea:GLOBAL), + /** * Outside temperature * @@ -2586,42 +2605,45 @@ enum VehicleDisplay : int32_t { * Units used for int or float type with no attached enum types. */ enum VehicleUnit : int32_t { - SHOULD_NOT_USE = 0x000, + SHOULD_NOT_USE = 0x000, - METER_PER_SEC = 0x01, - RPM = 0x02, - HERTZ = 0x03, - PERCENTILE = 0x10, - MILLIMETER = 0x20, - METER = 0x21, - KILOMETER = 0x23, - MILE = 0x24, - CELSIUS = 0x30, - FAHRENHEIT = 0x31, - KELVIN = 0x32, - MILLILITER = 0x40, - LITER = 0x41, + METER_PER_SEC = 0x01, + RPM = 0x02, + HERTZ = 0x03, + PERCENTILE = 0x10, + MILLIMETER = 0x20, + METER = 0x21, + KILOMETER = 0x23, + MILE = 0x24, + CELSIUS = 0x30, + FAHRENHEIT = 0x31, + KELVIN = 0x32, + MILLILITER = 0x40, + LITER = 0x41, /** deprecated. Use US_GALLON instead. */ - GALLON = 0x42, - US_GALLON = 0x42, - IMPERIAL_GALLON= 0x43, - NANO_SECS = 0x50, - SECS = 0x53, - YEAR = 0x59, + GALLON = 0x42, + US_GALLON = 0x42, + IMPERIAL_GALLON = 0x43, + NANO_SECS = 0x50, + SECS = 0x53, + YEAR = 0x59, // Electrical Units - WATT_HOUR = 0x60, - MILLIAMPERE = 0x61, - MILLIVOLT = 0x62, - MILLIWATTS = 0x63, - AMPERE_HOURS = 0x64, - KILOWATT_HOUR = 0x65, + WATT_HOUR = 0x60, + MILLIAMPERE = 0x61, + MILLIVOLT = 0x62, + MILLIWATTS = 0x63, + AMPERE_HOURS = 0x64, + KILOWATT_HOUR = 0x65, - KILOPASCAL = 0x70, - PSI = 0x71, - BAR = 0x72, - DEGREES = 0x80, + KILOPASCAL = 0x70, + PSI = 0x71, + BAR = 0x72, + DEGREES = 0x80, + + MILES_PER_HOUR = 0x90, + KILOMETERS_PER_HOUR = 0x91, }; /**