diff options
author | Steve Paik <spaik@google.com> | 2017-10-11 17:56:11 -0700 |
---|---|---|
committer | Steve Paik <spaik@google.com> | 2017-11-09 00:13:51 -0800 |
commit | e980916bd76ff2c66005aef04f9fb8f7d4bd11b0 (patch) | |
tree | 265412bebca3039b8be49665e5c994e4a94d3f37 /automotive/vehicle | |
parent | c1512b4577150a7f701186e1a6ae3081bd8eb9c2 (diff) | |
download | android_hardware_interfaces-e980916bd76ff2c66005aef04f9fb8f7d4bd11b0.tar.gz android_hardware_interfaces-e980916bd76ff2c66005aef04f9fb8f7d4bd11b0.tar.bz2 android_hardware_interfaces-e980916bd76ff2c66005aef04f9fb8f7d4bd11b0.zip |
Add EV parameters to VHAL
Add parameters:
- INFO_FUEL_TYPE
- INFO_EV_BATTERY_CAPACITY
- INFO_EV_CONNECTOR_TYPE
- ENGINE_ON
- FUEL_LEVEL
- FUEL_DOOR_OPEN
- EV_BATTERY_LEVEL
- EV_CHARGE_PORT_OPEN
- EV_CHARGE_PORT_CONNECTED
- EV_BATTERY_INSTANTANEOUS_CHARGE_RATE
Added enums:
- EvConnectorType
- FuelType
Bug: 63330964
Test: Embedded Kitchen Sink can access the params
Change-Id: Iaedbb02db91d354ebed98fbae4c1ba204098e152
Diffstat (limited to 'automotive/vehicle')
-rw-r--r-- | automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h | 123 | ||||
-rw-r--r-- | automotive/vehicle/2.0/types.hal | 227 |
2 files changed, 308 insertions, 42 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 08d3d7944..857efca7a 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 @@ -78,6 +78,38 @@ struct ConfigDeclaration { const ConfigDeclaration kVehicleProperties[]{ {.config = { + .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.floatValues = {15000}}}, + + {.config = + { + .prop = toInt(VehicleProperty::INFO_FUEL_TYPE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {1}}}, + + {.config = + { + .prop = toInt(VehicleProperty::INFO_EV_BATTERY_CAPACITY), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.floatValues = {150000}}}, + + {.config = + { + .prop = toInt(VehicleProperty::INFO_EV_CONNECTOR_TYPE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::STATIC, + }, + .initialValue = {.int32Values = {1}}}, + + {.config = + { .prop = toInt(VehicleProperty::INFO_MAKE), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::STATIC, @@ -89,7 +121,7 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, .minSampleRate = 1.0f, - .maxSampleRate = 1000.0f, + .maxSampleRate = 10.0f, }, .initialValue = {.floatValues = {0.0f}}}, @@ -101,6 +133,14 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.floatValues = {0.0f}}}, + {.config = + { + .prop = toInt(VehicleProperty::ENGINE_ON), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + { .config = { @@ -108,13 +148,61 @@ const ConfigDeclaration kVehicleProperties[]{ .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::CONTINUOUS, .minSampleRate = 1.0f, - .maxSampleRate = 1000.0f, + .maxSampleRate = 10.0f, }, .initialValue = {.floatValues = {0.0f}}, }, {.config = { + .prop = toInt(VehicleProperty::FUEL_LEVEL), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {15000}}}, + + {.config = + { + .prop = toInt(VehicleProperty::FUEL_DOOR_OPEN), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_BATTERY_LEVEL), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {150000}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_CHARGE_PORT_OPEN), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_CHARGE_PORT_CONNECTED), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.int32Values = {0}}}, + + {.config = + { + .prop = toInt(VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE), + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::ON_CHANGE, + }, + .initialValue = {.floatValues = {0}}}, + + {.config = + { .prop = toInt(VehicleProperty::CURRENT_GEAR), .access = VehiclePropertyAccess::READ, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, @@ -246,16 +334,6 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}}, - { - .config = - { - .prop = toInt(VehicleProperty::INFO_FUEL_CAPACITY), - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::STATIC, - }, - .initialValue = {.floatValues = {123000.0f}} // In Milliliters - }, - {.config = {.prop = toInt(VehicleProperty::DISPLAY_BRIGHTNESS), .access = VehiclePropertyAccess::READ_WRITE, .changeMode = VehiclePropertyChangeMode::ON_CHANGE, @@ -297,17 +375,16 @@ const ConfigDeclaration kVehicleProperties[]{ }, .initialValue = {.int32Values = {1}}}, - { - .config = - { - .prop = WHEEL_TICK, - .access = VehiclePropertyAccess::READ, - .changeMode = VehiclePropertyChangeMode::CONTINUOUS, - .configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000}, - .minSampleRate = 1.0f, - .maxSampleRate = 100.0f, - }, - }, + {.config = + { + .prop = WHEEL_TICK, + .access = VehiclePropertyAccess::READ, + .changeMode = VehiclePropertyChangeMode::CONTINUOUS, + .configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000}, + .minSampleRate = 1.0f, + .maxSampleRate = 10.0f, + }, + .initialValue = {.int64Values = {0, 100000, 200000, 300000, 400000}}}, { .config = diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index 7c08b4a03..e07917e18 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -148,7 +148,7 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** - * Fuel capacity of the vehicle + * Fuel capacity of the vehicle in milliliters * * @change_mode VehiclePropertyChangeMode:STATIC * @access VehiclePropertyAccess:READ @@ -161,6 +161,45 @@ enum VehicleProperty: int32_t { | VehicleArea:GLOBAL), /** + * List of fuels the vehicle may use. Uses enum FuelType + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:MILLILITERS + */ + INFO_FUEL_TYPE = ( + 0x0105 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32_VEC + | VehicleArea:GLOBAL), + + /** + * Battery capacity of the vehicle, if EV or hybrid. This is the nominal + * battery capacity when the vehicle is new. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:WH + */ + INFO_EV_BATTERY_CAPACITY = ( + 0x0106 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:FLOAT + | VehicleArea:GLOBAL), + + /** + * List of connectors this EV may use. Uses enum EvConnectorType + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + INFO_EV_CONNECTOR_TYPE = ( + 0x0107 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:INT32_VEC + | VehicleArea:GLOBAL), + + /** * Current odometer value of the vehicle * * @change_mode VehiclePropertyChangeMode:ON_CHANGE | VehiclePropertyChangeMode:CONTINUOUS @@ -187,6 +226,19 @@ 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 @@ -259,8 +311,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:CONTINUOUS * @access VehiclePropertyAccess:READ - * - * @since o.mr1 */ WHEEL_TICK = ( 0x0306 @@ -270,6 +320,88 @@ enum VehicleProperty: int32_t { /** + * Fuel remaining in the the vehicle, in milliliters + * + * Value may not exceed INFO_FUEL_CAPACITY + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:MILLILITER + */ + FUEL_LEVEL = ( + 0x0307 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:FLOAT + | VehicleArea:GLOBAL), + + /** + * Fuel door open + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + FUEL_DOOR_OPEN = ( + 0x0308 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BOOLEAN + | VehicleArea:GLOBAL), + + /** + * EV battery level in WH, if EV or hybrid + * + * Value may not exceed INFO_EV_BATTERY_CAPACITY + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:WH + */ + EV_BATTERY_LEVEL = ( + 0x0309 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:FLOAT + | VehicleArea:GLOBAL), + + /** + * EV charge port open + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + EV_CHARGE_PORT_OPEN = ( + 0x030A + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BOOLEAN + | VehicleArea:GLOBAL), + + /** + * EV charge port connected + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + */ + EV_CHARGE_PORT_CONNECTED = ( + 0x030B + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BOOLEAN + | VehicleArea:GLOBAL), + + /** + * EV instantaneous charge rate in milliwatts + * + * Positive value indicates battery is being charged. + * Negative value indicates battery being discharged. + * + * @change_mode VehiclePropertyChangeMode:STATIC + * @access VehiclePropertyAccess:READ + * @unit VehicleUnit:MW + */ + EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = ( + 0x030C + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:FLOAT + | VehicleArea:GLOBAL), + + /** * Currently selected gear * * @change_mode VehiclePropertyChangeMode:ON_CHANGE @@ -376,8 +508,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ - * - * @since o.mr1 */ ABS_ACTIVE = ( 0x040A @@ -390,8 +520,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ - * - * @since o.mr1 */ TRACTION_CONTROL_ACTIVE = ( 0x040B @@ -720,8 +848,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE - * - * @since o.mr1 */ HVAC_AUTO_RECIRC_ON = ( 0x0512 @@ -1899,8 +2025,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ_WRITE - * - * @since o.mr1 */ VEHICLE_MAP_SERVICE = ( 0x0C00 @@ -1948,8 +2072,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ - * - * @since o.mr1 */ OBD2_LIVE_FRAME = ( 0x0D00 @@ -1980,8 +2102,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ - * - * @since o.mr1 */ OBD2_FREEZE_FRAME = ( 0x0D01 @@ -2003,8 +2123,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:READ - * - * @since o.mr1 */ OBD2_FREEZE_FRAME_INFO = ( 0x0D02 @@ -2031,8 +2149,6 @@ enum VehicleProperty: int32_t { * * @change_mode VehiclePropertyChangeMode:ON_CHANGE * @access VehiclePropertyAccess:WRITE - * - * @since o.mr1 */ OBD2_FREEZE_FRAME_CLEAR = ( 0x0D03 @@ -2042,6 +2158,73 @@ enum VehicleProperty: int32_t { }; /** + * Used by INFO_EV_CONNECTOR_TYPE to enumerate the type of connectors + * available to charge the vehicle. Consistent with projection protocol. + */ +enum EvConnectorType : int32_t { + /** + * Default type if the vehicle does not know or report the EV connector + * type. + */ + EV_CONNECTOR_TYPE_UNKNOWN = 0, + EV_CONNECTOR_TYPE_J1772 = 1, + EV_CONNECTOR_TYPE_MENNEKES = 2, + EV_CONNECTOR_TYPE_CHADEMO = 3, + EV_CONNECTOR_TYPE_COMBO_1 = 4, + EV_CONNECTOR_TYPE_COMBO_2 = 5, + EV_CONNECTOR_TYPE_TESLA_ROADSTER = 6, + EV_CONNECTOR_TYPE_TESLA_HPWC = 7, + EV_CONNECTOR_TYPE_TESLA_SUPERCHARGER = 8, + EV_CONNECTOR_TYPE_GBT = 9, + + /** + * Connector type to use when no other types apply. Before using this + * value, work with Google to see if the EvConnectorType enum can be + * extended with an appropriate value. + */ + EV_CONNECTOR_TYPE_OTHER = 101, +}; + +/** + * Used by INFO_FUEL_TYPE to enumerate the type of fuels this vehicle uses. + * Consistent with projection protocol. + */ +enum FuelType : int32_t { + /** + * Fuel type to use if the HU does not know on which types of fuel the vehicle + * runs. The use of this value is generally discouraged outside of aftermarket units. + */ + FUEL_TYPE_UNKNOWN = 0, + /** Unleaded gasoline */ + FUEL_TYPE_UNLEADED = 1, + /** Leaded gasoline */ + FUEL_TYPE_LEADED = 2, + /** Diesel #1 */ + FUEL_TYPE_DIESEL_1 = 3, + /** Diesel #2 */ + FUEL_TYPE_DIESEL_2 = 4, + /** Biodiesel */ + FUEL_TYPE_BIODIESEL = 5, + /** 85% ethanol/gasoline blend */ + FUEL_TYPE_E85 = 6, + /** Liquified petroleum gas */ + FUEL_TYPE_LPG = 7, + /** Compressed natural gas */ + FUEL_TYPE_CNG = 8, + /** Liquified natural gas */ + FUEL_TYPE_LNG = 9, + /** Electric */ + FUEL_TYPE_ELECTRIC = 10, + /** Hydrogen fuel cell */ + FUEL_TYPE_HYDROGEN = 11, + /** + * Fuel type to use when no other types apply. Before using this value, work with + * Google to see if the FuelType enum can be extended with an appropriate value. + */ + FUEL_TYPE_OTHER = 12, +}; + +/** * Bit flags for fan direction */ enum VehicleHvacFanDirection : int32_t { @@ -2511,6 +2694,12 @@ enum VehicleUnit : int32_t { NANO_SECS = 0x50, SECS = 0x53, YEAR = 0x59, + + // Electrical Units + WATT_HOUR = 0x60, + MILLIAMPERE = 0x61, + MILLIVOLT = 0x62, + MILLIWATTS = 0x63, }; /** |