Merge "Merge Vehicle HAL 2.1 iface to 2.0" into oc-mr1-dev

am: 426066118a

Change-Id: Ifa0c49a211e67ef1a8c8a084fc017037a3b7d12d
This commit is contained in:
Pavel Maltsev 2017-08-25 07:08:07 +00:00 committed by android-build-merger
commit 0d6eca0eb4
21 changed files with 1973 additions and 2888 deletions

View file

@ -6,6 +6,4 @@ subdirs = [
"vehicle/2.0",
"vehicle/2.0/default",
"vehicle/2.0/default/impl/vhal_v2_0/proto",
"vehicle/2.1",
"vehicle/2.1/default",
]

View file

@ -16,6 +16,177 @@ LOCAL_JAVA_LIBRARIES := \
android.hidl.base-V1.0-java \
#
# Build types.hal (DiagnosticFloatSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (DiagnosticIntegerSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CommonIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CompressionIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelSystemStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2IgnitionMonitorKind)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SecondaryAirStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SparkIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (StatusCode)
#
@ -909,6 +1080,139 @@ $(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsAvailabilityStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsAvailabilityStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsAvailabilityStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsBaseMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsBaseMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsMessageType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsMessageType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerAndPublisherIdIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsMessageWithLayerAndPublisherIdIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsMessageWithLayerIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsMessageWithLayerIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsOfferingMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsOfferingMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsSubscriptionsStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsSubscriptionsStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsSubscriptionsStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Wheel)
#
@ -988,6 +1292,177 @@ LOCAL_STATIC_JAVA_LIBRARIES := \
android.hidl.base-V1.0-java-static \
#
# Build types.hal (DiagnosticFloatSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (DiagnosticIntegerSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CommonIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CompressionIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelSystemStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2IgnitionMonitorKind)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SecondaryAirStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SparkIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (StatusCode)
#
@ -1881,6 +2356,139 @@ $(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsAvailabilityStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsAvailabilityStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsAvailabilityStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsBaseMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsBaseMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsMessageType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsMessageType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerAndPublisherIdIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsMessageWithLayerAndPublisherIdIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsMessageWithLayerIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsMessageWithLayerIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsOfferingMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsOfferingMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsSubscriptionsStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_0/VmsSubscriptionsStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.0::types.VmsSubscriptionsStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Wheel)
#

View file

@ -40,6 +40,7 @@ cc_library_static {
vendor: true,
defaults: ["vhal_v2_0_defaults"],
srcs: [
"common/src/Obd2SensorStore.cpp",
"common/src/SubscriptionManager.cpp",
"common/src/VehicleHalManager.cpp",
"common/src/VehicleObjectPool.cpp",

View file

@ -14,38 +14,37 @@
* limitations under the License.
*/
#ifndef android_hardware_automotive_vehicle_V2_1_Obd2SensorStore_H_
#define android_hardware_automotive_vehicle_V2_1_Obd2SensorStore_H_
#ifndef android_hardware_automotive_vehicle_V2_0_Obd2SensorStore_H_
#define android_hardware_automotive_vehicle_V2_0_Obd2SensorStore_H_
#include <vector>
#include <android/hardware/automotive/vehicle/2.1/types.h>
#include <android/hardware/automotive/vehicle/2.0/types.h>
namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_1 {
namespace V2_0 {
// This class wraps all the logic required to create an OBD2 frame.
// It allows storing sensor values, setting appropriate bitmasks as needed,
// and returning appropriately laid out storage of sensor values suitable
// for being returned via a VehicleHal implementation.
class Obd2SensorStore {
public:
public:
// Creates a sensor storage with a given number of vendor-specific sensors.
Obd2SensorStore(size_t numVendorIntegerSensors,
size_t numVendorFloatSensors);
Obd2SensorStore(size_t numVendorIntegerSensors, size_t numVendorFloatSensors);
// Stores an integer-valued sensor.
V2_0::StatusCode setIntegerSensor(DiagnosticIntegerSensorIndex index, int32_t value);
StatusCode setIntegerSensor(DiagnosticIntegerSensorIndex index, int32_t value);
// Stores an integer-valued sensor.
V2_0::StatusCode setIntegerSensor(size_t index, int32_t value);
StatusCode setIntegerSensor(size_t index, int32_t value);
// Stores a float-valued sensor.
V2_0::StatusCode setFloatSensor(DiagnosticFloatSensorIndex index, float value);
StatusCode setFloatSensor(DiagnosticFloatSensorIndex index, float value);
// Stores a float-valued sensor.
V2_0::StatusCode setFloatSensor(size_t index, float value);
StatusCode setFloatSensor(size_t index, float value);
// Returns a vector that contains all integer sensors stored.
const std::vector<int32_t>& getIntegerSensors() const;
@ -55,11 +54,11 @@ public:
const std::vector<uint8_t>& getSensorsBitmask() const;
// Given a stringValue, fill in a VehiclePropValue
void fillPropValue(const std::string& dtc, V2_0::VehiclePropValue *propValue) const;
void fillPropValue(const std::string& dtc, VehiclePropValue* propValue) const;
private:
private:
class BitmaskInVector {
public:
public:
BitmaskInVector(size_t numBits = 0);
void resize(size_t numBits);
bool get(size_t index) const;
@ -67,7 +66,7 @@ private:
const std::vector<uint8_t>& getBitmask() const;
private:
private:
std::vector<uint8_t> mStorage;
};
@ -76,7 +75,7 @@ private:
BitmaskInVector mSensorsBitmask;
};
} // namespace V2_1
} // namespace V2_0
} // namespace vehicle
} // namespace automotive
} // namespace hardware

View file

@ -23,23 +23,21 @@ namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_1 {
namespace V2_0 {
Obd2SensorStore::BitmaskInVector::BitmaskInVector(size_t numBits)
{
Obd2SensorStore::BitmaskInVector::BitmaskInVector(size_t numBits) {
resize(numBits);
}
void Obd2SensorStore::BitmaskInVector::resize(size_t numBits) {
mStorage = std::vector<uint8_t>((numBits+7)/8, 0);
mStorage = std::vector<uint8_t>((numBits + 7) / 8, 0);
}
void Obd2SensorStore::BitmaskInVector::set(size_t index, bool value) {
const size_t byteIndex = index / 8;
const size_t bitIndex = index % 8;
const uint8_t byte = mStorage[byteIndex];
uint8_t newValue = value ? (byte | (1 << bitIndex)) :
(byte & ~(1 << bitIndex));
uint8_t newValue = value ? (byte | (1 << bitIndex)) : (byte & ~(1 << bitIndex));
mStorage[byteIndex] = newValue;
}
@ -54,40 +52,33 @@ const std::vector<uint8_t>& Obd2SensorStore::BitmaskInVector::getBitmask() const
return mStorage;
}
Obd2SensorStore::Obd2SensorStore(size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
using V2_0::toInt;
// because the last index is valid *inclusive*
const size_t numSystemIntegerSensors =
toInt(DiagnosticIntegerSensorIndex::LAST_SYSTEM_INDEX)+1;
const size_t numSystemFloatSensors =
toInt(DiagnosticFloatSensorIndex::LAST_SYSTEM_INDEX)+1;
mIntegerSensors = std::vector<int32_t>(
numSystemIntegerSensors+numVendorIntegerSensors, 0);
mFloatSensors = std::vector<float>(
numSystemFloatSensors+numVendorFloatSensors, 0);
mSensorsBitmask.resize(mIntegerSensors.size()+mFloatSensors.size());
Obd2SensorStore::Obd2SensorStore(size_t numVendorIntegerSensors, size_t numVendorFloatSensors) {
// because the last index is valid *inclusive*
const size_t numSystemIntegerSensors =
toInt(DiagnosticIntegerSensorIndex::LAST_SYSTEM_INDEX) + 1;
const size_t numSystemFloatSensors = toInt(DiagnosticFloatSensorIndex::LAST_SYSTEM_INDEX) + 1;
mIntegerSensors = std::vector<int32_t>(numSystemIntegerSensors + numVendorIntegerSensors, 0);
mFloatSensors = std::vector<float>(numSystemFloatSensors + numVendorFloatSensors, 0);
mSensorsBitmask.resize(mIntegerSensors.size() + mFloatSensors.size());
}
V2_0::StatusCode Obd2SensorStore::setIntegerSensor(DiagnosticIntegerSensorIndex index,
int32_t value) {
return setIntegerSensor(V2_0::toInt(index), value);
StatusCode Obd2SensorStore::setIntegerSensor(DiagnosticIntegerSensorIndex index, int32_t value) {
return setIntegerSensor(toInt(index), value);
}
V2_0::StatusCode Obd2SensorStore::setFloatSensor(DiagnosticFloatSensorIndex index,
float value) {
return setFloatSensor(V2_0::toInt(index), value);
StatusCode Obd2SensorStore::setFloatSensor(DiagnosticFloatSensorIndex index, float value) {
return setFloatSensor(toInt(index), value);
}
V2_0::StatusCode Obd2SensorStore::setIntegerSensor(size_t index, int32_t value) {
StatusCode Obd2SensorStore::setIntegerSensor(size_t index, int32_t value) {
mIntegerSensors[index] = value;
mSensorsBitmask.set(index, true);
return V2_0::StatusCode::OK;
return StatusCode::OK;
}
V2_0::StatusCode Obd2SensorStore::setFloatSensor(size_t index, float value) {
StatusCode Obd2SensorStore::setFloatSensor(size_t index, float value) {
mFloatSensors[index] = value;
mSensorsBitmask.set(index + mIntegerSensors.size(), true);
return V2_0::StatusCode::OK;
return StatusCode::OK;
}
const std::vector<int32_t>& Obd2SensorStore::getIntegerSensors() const {
@ -102,8 +93,7 @@ const std::vector<uint8_t>& Obd2SensorStore::getSensorsBitmask() const {
return mSensorsBitmask.getBitmask();
}
void Obd2SensorStore::fillPropValue(const std::string& dtc,
V2_0::VehiclePropValue *propValue) const {
void Obd2SensorStore::fillPropValue(const std::string& dtc, VehiclePropValue* propValue) const {
propValue->timestamp = elapsedRealtimeNano();
propValue->value.int32Values = getIntegerSensors();
propValue->value.floatValues = getFloatSensors();
@ -111,8 +101,6 @@ void Obd2SensorStore::fillPropValue(const std::string& dtc,
propValue->value.stringValue = dtc;
}
} // namespace V2_0
} // namespace vehicle
} // namespace automotive

View file

@ -27,6 +27,18 @@ namespace vehicle {
namespace V2_0 {
namespace impl {
//
// Some handy constants to avoid conversions from enum to int.
constexpr int ABS_ACTIVE = (int)VehicleProperty::ABS_ACTIVE;
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;
constexpr int OBD2_FREEZE_FRAME_CLEAR = (int)VehicleProperty::OBD2_FREEZE_FRAME_CLEAR;
constexpr int TRACTION_CONTROL_ACTIVE = (int)VehicleProperty::TRACTION_CONTROL_ACTIVE;
constexpr int VEHICLE_MAP_SERVICE = (int)VehicleProperty::VEHICLE_MAP_SERVICE;
constexpr int WHEEL_TICK = (int)VehicleProperty::WHEEL_TICK;
constexpr int ALL_WHEELS =
(int)(Wheel::LEFT_FRONT | Wheel::RIGHT_FRONT | Wheel::LEFT_REAR | Wheel::RIGHT_REAR);
/*
* This property is used for test purpose to generate fake events.
@ -283,8 +295,68 @@ const ConfigDeclaration kVehicleProperties[]{
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
.initialValue = {.int32Values = {1}}}
.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 = ABS_ACTIVE,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config =
{
.prop = TRACTION_CONTROL_ACTIVE,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
{
.config = {.prop = OBD2_LIVE_FRAME,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0, 0}},
},
{
.config = {.prop = OBD2_FREEZE_FRAME,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0, 0}},
},
{
.config = {.prop = OBD2_FREEZE_FRAME_INFO,
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE},
},
{
.config = {.prop = OBD2_FREEZE_FRAME_CLEAR,
.access = VehiclePropertyAccess::WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {1}},
},
{.config = {.prop = VEHICLE_MAP_SERVICE,
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE}},
};
} // impl

View file

@ -19,6 +19,7 @@
#include <android-base/macros.h>
#include "EmulatedVehicleHal.h"
#include "Obd2SensorStore.h"
namespace android {
namespace hardware {
@ -28,6 +29,62 @@ namespace V2_0 {
namespace impl {
static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
std::unique_ptr<Obd2SensorStore> sensorStore(
new Obd2SensorStore(numVendorIntegerSensors, numVendorFloatSensors));
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::FUEL_SYSTEM_STATUS,
toInt(Obd2FuelSystemStatus::CLOSED_LOOP));
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
toInt(Obd2IgnitionMonitorKind::SPARK));
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
Obd2CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
Obd2CommonIgnitionMonitors::MISFIRE_AVAILABLE |
Obd2SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
Obd2SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
toInt(Obd2SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::FUEL_TYPE,
toInt(Obd2FuelType::GASOLINE));
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ENGINE_RPM, 1250.);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::VEHICLE_SPEED, 40.);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::TIMING_ADVANCE, 2.5);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::THROTTLE_POSITION, 19.75);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE,
-0.373);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1,
190.);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
sensorStore->setFloatSensor(DiagnosticFloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
return sensorStore;
}
enum class FakeDataCommand : int32_t {
Stop = 0,
Start = 1,
@ -40,7 +97,7 @@ EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore)
this, std::placeholders::_1)),
mFakeValueGenerator(std::bind(&EmulatedVehicleHal::onFakeValueGenerated,
this, std::placeholders::_1, std::placeholders::_2)) {
initStaticConfig();
for (size_t i = 0; i < arraysize(kVehicleProperties); i++) {
mPropStore->registerProperty(kVehicleProperties[i].config);
}
@ -48,14 +105,29 @@ EmulatedVehicleHal::EmulatedVehicleHal(VehiclePropertyStore* propStore)
VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::get(
const VehiclePropValue& requestedPropValue, StatusCode* outStatus) {
auto propId = requestedPropValue.prop;
auto& pool = *getValuePool();
VehiclePropValuePtr v = nullptr;
auto internalPropValue = mPropStore->readValueOrNull(requestedPropValue);
if (internalPropValue != nullptr) {
v = getValuePool()->obtain(*internalPropValue);
switch (propId) {
case OBD2_FREEZE_FRAME:
v = pool.obtainComplex();
*outStatus = fillObd2FreezeFrame(requestedPropValue, v.get());
break;
case OBD2_FREEZE_FRAME_INFO:
v = pool.obtainComplex();
*outStatus = fillObd2DtcInfo(v.get());
break;
default:
auto internalPropValue = mPropStore->readValueOrNull(requestedPropValue);
if (internalPropValue != nullptr) {
v = getValuePool()->obtain(*internalPropValue);
}
*outStatus = v != nullptr ? StatusCode::OK : StatusCode::INVALID_ARG;
break;
}
*outStatus = v != nullptr ? StatusCode::OK : StatusCode::INVALID_ARG;
return v;
}
@ -73,6 +145,12 @@ StatusCode EmulatedVehicleHal::set(const VehiclePropValue& propValue) {
&& hvacPowerOn->value.int32Values[0] == 0) {
return StatusCode::NOT_AVAILABLE;
}
} else if (propValue.prop == OBD2_FREEZE_FRAME_CLEAR) {
return clearObd2FreezeFrames(propValue);
} else if (propValue.prop == VEHICLE_MAP_SERVICE) {
// 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;
}
if (!mPropStore->writeValue(propValue)) {
@ -121,6 +199,8 @@ void EmulatedVehicleHal::onCreate() {
} while (supportedAreas != 0);
}
initObd2LiveFrame(*mPropStore->getConfigOrDie(OBD2_LIVE_FRAME));
initObd2FreezeFrame(*mPropStore->getConfigOrDie(OBD2_FREEZE_FRAME));
}
std::vector<VehiclePropConfig> EmulatedVehicleHal::listProperties() {
@ -271,6 +351,100 @@ void EmulatedVehicleHal::onFakeValueGenerated(int32_t propId, float value) {
}
}
void EmulatedVehicleHal::initStaticConfig() {
for (auto&& it = std::begin(kVehicleProperties); it != std::end(kVehicleProperties); ++it) {
const auto& cfg = it->config;
VehiclePropertyStore::TokenFunction tokenFunction = nullptr;
switch (cfg.prop) {
case OBD2_FREEZE_FRAME: {
tokenFunction = [](const VehiclePropValue& propValue) {
return propValue.timestamp;
};
break;
}
default:
break;
}
mPropStore->registerProperty(cfg, tokenFunction);
}
}
void EmulatedVehicleHal::initObd2LiveFrame(const VehiclePropConfig& propConfig) {
auto liveObd2Frame = createVehiclePropValue(VehiclePropertyType::COMPLEX, 0);
auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]),
static_cast<size_t>(propConfig.configArray[1]));
sensorStore->fillPropValue("", liveObd2Frame.get());
liveObd2Frame->prop = OBD2_LIVE_FRAME;
mPropStore->writeValue(*liveObd2Frame);
}
void EmulatedVehicleHal::initObd2FreezeFrame(const VehiclePropConfig& propConfig) {
auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]),
static_cast<size_t>(propConfig.configArray[1]));
static std::vector<std::string> sampleDtcs = {"P0070",
"P0102"
"P0123"};
for (auto&& dtc : sampleDtcs) {
auto freezeFrame = createVehiclePropValue(VehiclePropertyType::COMPLEX, 0);
sensorStore->fillPropValue(dtc, freezeFrame.get());
freezeFrame->prop = OBD2_FREEZE_FRAME;
mPropStore->writeValue(*freezeFrame);
}
}
StatusCode EmulatedVehicleHal::fillObd2FreezeFrame(const VehiclePropValue& requestedPropValue,
VehiclePropValue* outValue) {
if (requestedPropValue.value.int64Values.size() != 1) {
ALOGE("asked for OBD2_FREEZE_FRAME without valid timestamp");
return StatusCode::INVALID_ARG;
}
auto timestamp = requestedPropValue.value.int64Values[0];
auto freezeFrame = mPropStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp);
if (freezeFrame == nullptr) {
ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
return StatusCode::INVALID_ARG;
}
outValue->prop = OBD2_FREEZE_FRAME;
outValue->value.int32Values = freezeFrame->value.int32Values;
outValue->value.floatValues = freezeFrame->value.floatValues;
outValue->value.bytes = freezeFrame->value.bytes;
outValue->value.stringValue = freezeFrame->value.stringValue;
outValue->timestamp = freezeFrame->timestamp;
return StatusCode::OK;
}
StatusCode EmulatedVehicleHal::clearObd2FreezeFrames(const VehiclePropValue& propValue) {
if (propValue.value.int64Values.size() == 0) {
mPropStore->removeValuesForProperty(OBD2_FREEZE_FRAME);
return StatusCode::OK;
} else {
for (int64_t timestamp : propValue.value.int64Values) {
auto freezeFrame = mPropStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp);
if (freezeFrame == nullptr) {
ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
return StatusCode::INVALID_ARG;
}
mPropStore->removeValue(*freezeFrame);
}
}
return StatusCode::OK;
}
StatusCode EmulatedVehicleHal::fillObd2DtcInfo(VehiclePropValue* outValue) {
std::vector<int64_t> timestamps;
for (const auto& freezeFrame : mPropStore->readValuesForProperty(OBD2_FREEZE_FRAME)) {
timestamps.push_back(freezeFrame.timestamp);
}
outValue->value.int64Values = timestamps;
outValue->prop = OBD2_FREEZE_FRAME_INFO;
return StatusCode::OK;
}
} // impl
} // namespace V2_0

View file

@ -70,8 +70,15 @@ private:
void onContinuousPropertyTimer(const std::vector<int32_t>& properties);
bool isContinuousProperty(int32_t propId) const;
void initStaticConfig();
void initObd2LiveFrame(const VehiclePropConfig& propConfig);
void initObd2FreezeFrame(const VehiclePropConfig& propConfig);
StatusCode fillObd2FreezeFrame(const VehiclePropValue& requestedPropValue,
VehiclePropValue* outValue);
StatusCode fillObd2DtcInfo(VehiclePropValue* outValue);
StatusCode clearObd2FreezeFrames(const VehiclePropValue& propValue);
private:
/* Private members */
VehiclePropertyStore* mPropStore;
std::unordered_set<int32_t> mHvacPowerProps;
RecurrentTimer mRecurrentTimer;

File diff suppressed because it is too large Load diff

View file

@ -1,68 +0,0 @@
// This file is autogenerated by hidl-gen. Do not edit manually.
filegroup {
name: "android.hardware.automotive.vehicle@2.1_hal",
srcs: [
"types.hal",
"IVehicle.hal",
],
}
genrule {
name: "android.hardware.automotive.vehicle@2.1_genc++",
tools: ["hidl-gen"],
cmd: "$(location hidl-gen) -o $(genDir) -Lc++-sources -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.automotive.vehicle@2.1",
srcs: [
":android.hardware.automotive.vehicle@2.1_hal",
],
out: [
"android/hardware/automotive/vehicle/2.1/types.cpp",
"android/hardware/automotive/vehicle/2.1/VehicleAll.cpp",
],
}
genrule {
name: "android.hardware.automotive.vehicle@2.1_genc++_headers",
tools: ["hidl-gen"],
cmd: "$(location hidl-gen) -o $(genDir) -Lc++-headers -randroid.hardware:hardware/interfaces -randroid.hidl:system/libhidl/transport android.hardware.automotive.vehicle@2.1",
srcs: [
":android.hardware.automotive.vehicle@2.1_hal",
],
out: [
"android/hardware/automotive/vehicle/2.1/types.h",
"android/hardware/automotive/vehicle/2.1/hwtypes.h",
"android/hardware/automotive/vehicle/2.1/IVehicle.h",
"android/hardware/automotive/vehicle/2.1/IHwVehicle.h",
"android/hardware/automotive/vehicle/2.1/BnHwVehicle.h",
"android/hardware/automotive/vehicle/2.1/BpHwVehicle.h",
"android/hardware/automotive/vehicle/2.1/BsVehicle.h",
],
}
cc_library {
name: "android.hardware.automotive.vehicle@2.1",
defaults: ["hidl-module-defaults"],
generated_sources: ["android.hardware.automotive.vehicle@2.1_genc++"],
generated_headers: ["android.hardware.automotive.vehicle@2.1_genc++_headers"],
export_generated_headers: ["android.hardware.automotive.vehicle@2.1_genc++_headers"],
vendor_available: true,
vndk: {
enabled: true,
},
shared_libs: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"liblog",
"libutils",
"libcutils",
"android.hardware.automotive.vehicle@2.0",
],
export_shared_lib_headers: [
"libhidlbase",
"libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.automotive.vehicle@2.0",
],
}

View file

@ -1,724 +0,0 @@
# This file is autogenerated by hidl-gen. Do not edit manually.
LOCAL_PATH := $(call my-dir)
################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.automotive.vehicle-V2.1-java
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
intermediates := $(call local-generated-sources-dir, COMMON)
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
LOCAL_JAVA_LIBRARIES := \
android.hardware.automotive.vehicle-V2.0-java \
android.hidl.base-V1.0-java \
#
# Build types.hal (DiagnosticFloatSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (DiagnosticIntegerSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CommonIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CompressionIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelSystemStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2IgnitionMonitorKind)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SecondaryAirStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SparkIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VehicleProperty)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VehicleProperty.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VehicleProperty
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsAvailabilityStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsAvailabilityStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsAvailabilityStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsBaseMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsBaseMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsMessageType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerAndPublisherIdIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerAndPublisherIdIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsOfferingMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsOfferingMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsSubscriptionsStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionsStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsSubscriptionsStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build IVehicle.hal
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IVehicle.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IVehicle.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::IVehicle
$(GEN): $(LOCAL_PATH)/IVehicle.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_JAVA_LIBRARY)
################################################################################
include $(CLEAR_VARS)
LOCAL_MODULE := android.hardware.automotive.vehicle-V2.1-java-static
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
intermediates := $(call local-generated-sources-dir, COMMON)
HIDL := $(HOST_OUT_EXECUTABLES)/hidl-gen$(HOST_EXECUTABLE_SUFFIX)
LOCAL_STATIC_JAVA_LIBRARIES := \
android.hardware.automotive.vehicle-V2.0-java-static \
android.hidl.base-V1.0-java-static \
#
# Build types.hal (DiagnosticFloatSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticFloatSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.DiagnosticFloatSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (DiagnosticIntegerSensorIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/DiagnosticIntegerSensorIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.DiagnosticIntegerSensorIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CommonIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CommonIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2CommonIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2CompressionIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2CompressionIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2CompressionIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelSystemStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelSystemStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2FuelSystemStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2FuelType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2FuelType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2FuelType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2IgnitionMonitorKind)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2IgnitionMonitorKind.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2IgnitionMonitorKind
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SecondaryAirStatus)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SecondaryAirStatus.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2SecondaryAirStatus
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (Obd2SparkIgnitionMonitors)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/Obd2SparkIgnitionMonitors.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.Obd2SparkIgnitionMonitors
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VehicleProperty)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VehicleProperty.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VehicleProperty
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsAvailabilityStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsAvailabilityStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsAvailabilityStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsBaseMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsBaseMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsBaseMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageType)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageType.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsMessageType
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerAndPublisherIdIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerAndPublisherIdIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsMessageWithLayerIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsMessageWithLayerIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsMessageWithLayerIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsOfferingMessageIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsOfferingMessageIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsOfferingMessageIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build types.hal (VmsSubscriptionsStateIntegerValuesIndex)
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/VmsSubscriptionsStateIntegerValuesIndex.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/types.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::types.VmsSubscriptionsStateIntegerValuesIndex
$(GEN): $(LOCAL_PATH)/types.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
#
# Build IVehicle.hal
#
GEN := $(intermediates)/android/hardware/automotive/vehicle/V2_1/IVehicle.java
$(GEN): $(HIDL)
$(GEN): PRIVATE_HIDL := $(HIDL)
$(GEN): PRIVATE_DEPS := $(LOCAL_PATH)/IVehicle.hal
$(GEN): PRIVATE_OUTPUT_DIR := $(intermediates)
$(GEN): PRIVATE_CUSTOM_TOOL = \
$(PRIVATE_HIDL) -o $(PRIVATE_OUTPUT_DIR) \
-Ljava \
-randroid.hardware:hardware/interfaces \
-randroid.hidl:system/libhidl/transport \
android.hardware.automotive.vehicle@2.1::IVehicle
$(GEN): $(LOCAL_PATH)/IVehicle.hal
$(transform-generated-source)
LOCAL_GENERATED_SOURCES += $(GEN)
include $(BUILD_STATIC_JAVA_LIBRARY)
include $(call all-makefiles-under,$(LOCAL_PATH))

View file

@ -1,31 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.1
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.automotive.vehicle@2.1;
import android.hardware.automotive.vehicle@2.0;
/**
* New revision of IVehicle interface that supports properties defined in
* VehicleProperty enum version 2.1.
*
* NOTE: this HAL interface is under development and shouldn't be used in
* production.
*
* TODO(pavelm): update comment when this interface is ready for prod.
*/
interface IVehicle extends @2.0::IVehicle {
};

View file

@ -1,86 +0,0 @@
// Copyright (C) 2017 The Android Open Source Project
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
cc_defaults {
name: "vhal_v2_1_defaults",
defaults: ["vhal_v2_0_defaults"],
shared_libs: [
"libhwbinder",
"android.hardware.automotive.vehicle@2.1",
],
}
// Vehicle reference implementation lib
cc_library_static {
name: "android.hardware.automotive.vehicle@2.1-manager-lib",
vendor: true,
defaults: ["vhal_v2_1_defaults"],
srcs: [
"common/src/Obd2SensorStore.cpp",
],
local_include_dirs: ["common/include/vhal_v2_1"],
header_libs: ["vhal_v2_0_common_headers"],
export_include_dirs: ["common/include"],
}
// Vehicle default VehicleHAL implementation
cc_library_static {
name: "android.hardware.automotive.vehicle@2.1-default-impl-lib",
vendor: true,
defaults: ["vhal_v2_1_defaults"],
srcs: [
"impl/vhal_v2_1/EmulatedVehicleHal.cpp",
],
local_include_dirs: [
"impl/vhal_v2_1",
"common/include",
],
export_include_dirs: [
"impl",
"common/include",
],
static_libs: [
"android.hardware.automotive.vehicle@2.0-default-impl-lib",
"android.hardware.automotive.vehicle@2.0-libproto-native",
"android.hardware.automotive.vehicle@2.0-manager-lib",
"android.hardware.automotive.vehicle@2.1-manager-lib",
"libqemu_pipe",
],
shared_libs: [
"libbase",
"libprotobuf-cpp-lite",
],
}
cc_binary {
name: "android.hardware.automotive.vehicle@2.1-service",
defaults: ["vhal_v2_1_defaults"],
init_rc: ["android.hardware.automotive.vehicle@2.1-service.rc"],
vendor: true,
relative_install_path: "hw",
srcs: ["service.cpp"],
whole_static_libs: ["android.hardware.automotive.vehicle@2.0-libproto-native"],
static_libs: [
"android.hardware.automotive.vehicle@2.0-default-impl-lib",
"android.hardware.automotive.vehicle@2.0-manager-lib",
"android.hardware.automotive.vehicle@2.1-default-impl-lib",
"android.hardware.automotive.vehicle@2.1-manager-lib",
"libqemu_pipe",
],
shared_libs: [
"libbase",
"libhwbinder",
"libprotobuf-cpp-lite",
],
}

View file

@ -1,4 +0,0 @@
service vehicle-hal-2.1 /vendor/bin/hw/android.hardware.automotive.vehicle@2.1-service
class hal
user vehicle_network
group system inet

View file

@ -1,108 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef android_hardware_automotive_vehicle_V2_1_impl_DefaultConfig_H_
#define android_hardware_automotive_vehicle_V2_1_impl_DefaultConfig_H_
#include <android/hardware/automotive/vehicle/2.1/types.h>
#include <vhal_v2_0/VehicleUtils.h>
namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_1 {
namespace impl {
// Some handy constants to avoid conversions from enum to int.
constexpr int ABS_ACTIVE = (int) V2_1::VehicleProperty::ABS_ACTIVE;
constexpr int OBD2_LIVE_FRAME = (int) V2_1::VehicleProperty::OBD2_LIVE_FRAME;
constexpr int OBD2_FREEZE_FRAME = (int) V2_1::VehicleProperty::OBD2_FREEZE_FRAME;
constexpr int OBD2_FREEZE_FRAME_INFO = (int) V2_1::VehicleProperty::OBD2_FREEZE_FRAME_INFO;
constexpr int OBD2_FREEZE_FRAME_CLEAR = (int) V2_1::VehicleProperty::OBD2_FREEZE_FRAME_CLEAR;
constexpr int TRACTION_CONTROL_ACTIVE = (int) V2_1::VehicleProperty::TRACTION_CONTROL_ACTIVE;
constexpr int VEHICLE_MAP_SERVICE = (int) V2_1::VehicleProperty::VEHICLE_MAP_SERVICE;
constexpr int WHEEL_TICK = (int) V2_1::VehicleProperty::WHEEL_TICK;
constexpr int ALL_WHEELS = (int) (V2_0::Wheel::LEFT_FRONT | V2_0::Wheel::RIGHT_FRONT |
V2_0::Wheel::LEFT_REAR | V2_0::Wheel::RIGHT_REAR);
const V2_0::VehiclePropConfig kVehicleProperties[] = {
{
.prop = WHEEL_TICK,
.access = V2_0::VehiclePropertyAccess::READ,
.changeMode = V2_0::VehiclePropertyChangeMode::CONTINUOUS,
.configArray = {ALL_WHEELS, 50000, 50000, 50000, 50000},
.minSampleRate = 1.0f,
.maxSampleRate = 100.0f,
},
{
.prop = ABS_ACTIVE,
.access = V2_0::VehiclePropertyAccess::READ,
.changeMode = V2_0::VehiclePropertyChangeMode::ON_CHANGE,
},
{
.prop = TRACTION_CONTROL_ACTIVE,
.access = V2_0::VehiclePropertyAccess::READ,
.changeMode = V2_0::VehiclePropertyChangeMode::ON_CHANGE,
},
{
.prop = OBD2_LIVE_FRAME,
.access = V2_0::VehiclePropertyAccess::READ,
.changeMode = V2_0::VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0,0}
},
{
.prop = OBD2_FREEZE_FRAME,
.access = V2_0::VehiclePropertyAccess::READ,
.changeMode = V2_0::VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {0,0}
},
{
.prop = OBD2_FREEZE_FRAME_INFO,
.access = V2_0::VehiclePropertyAccess::READ,
.changeMode = V2_0::VehiclePropertyChangeMode::ON_CHANGE
},
{
.prop = OBD2_FREEZE_FRAME_CLEAR,
.access = V2_0::VehiclePropertyAccess::WRITE,
.changeMode = V2_0::VehiclePropertyChangeMode::ON_CHANGE,
.configArray = {1}
},
{
.prop = VEHICLE_MAP_SERVICE,
.access = V2_0::VehiclePropertyAccess::READ_WRITE,
.changeMode = V2_0::VehiclePropertyChangeMode::ON_CHANGE
}
};
} // impl
} // namespace V2_1
} // namespace vehicle
} // namespace automotive
} // namespace hardware
} // namespace android
#endif // android_hardware_automotive_vehicle_V2_1_impl_DefaultConfig_H_

View file

@ -1,265 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "DefaultVehicleHal_v2_1"
#include <android/log.h>
#include <log/log.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <algorithm>
#include "EmulatedVehicleHal.h"
#define DEBUG_SOCKET (33452)
namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_1 {
namespace impl {
static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(
size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
using V2_0::toInt;
std::unique_ptr<Obd2SensorStore> sensorStore(new Obd2SensorStore(
numVendorIntegerSensors, numVendorFloatSensors));
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::FUEL_SYSTEM_STATUS,
toInt(Obd2FuelSystemStatus::CLOSED_LOOP));
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::IGNITION_MONITORS_SUPPORTED,
toInt(Obd2IgnitionMonitorKind::SPARK));
sensorStore->setIntegerSensor(DiagnosticIntegerSensorIndex::IGNITION_SPECIFIC_MONITORS,
Obd2CommonIgnitionMonitors::COMPONENTS_AVAILABLE |
Obd2CommonIgnitionMonitors::MISFIRE_AVAILABLE |
Obd2SparkIgnitionMonitors::AC_REFRIGERANT_AVAILABLE |
Obd2SparkIgnitionMonitors::EVAPORATIVE_SYSTEM_AVAILABLE);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::INTAKE_AIR_TEMPERATURE, 35);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::COMMANDED_SECONDARY_AIR_STATUS,
toInt(Obd2SecondaryAirStatus::FROM_OUTSIDE_OR_OFF));
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::NUM_OXYGEN_SENSORS_PRESENT, 1);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::RUNTIME_SINCE_ENGINE_START, 500);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON, 0);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::WARMUPS_SINCE_CODES_CLEARED, 51);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::DISTANCE_TRAVELED_SINCE_CODES_CLEARED, 365);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE, 30);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::CONTROL_MODULE_VOLTAGE, 12);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::AMBIENT_AIR_TEMPERATURE, 18);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::MAX_FUEL_AIR_EQUIVALENCE_RATIO, 1);
sensorStore->setIntegerSensor(
DiagnosticIntegerSensorIndex::FUEL_TYPE, V2_0::toInt(Obd2FuelType::GASOLINE));
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::CALCULATED_ENGINE_LOAD, 0.153);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK1, -0.16);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::SHORT_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::LONG_TERM_FUEL_TRIM_BANK2, -0.16);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::INTAKE_MANIFOLD_ABSOLUTE_PRESSURE, 7.5);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::ENGINE_RPM, 1250.);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::VEHICLE_SPEED, 40.);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::TIMING_ADVANCE, 2.5);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::THROTTLE_POSITION, 19.75);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::OXYGEN_SENSOR1_VOLTAGE, 0.265);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::FUEL_TANK_LEVEL_INPUT, 0.824);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::EVAPORATION_SYSTEM_VAPOR_PRESSURE, -0.373);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::CATALYST_TEMPERATURE_BANK1_SENSOR1, 190.);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::RELATIVE_THROTTLE_POSITION, 3.);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::ABSOLUTE_THROTTLE_POSITION_B, 0.306);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_D, 0.188);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::ACCELERATOR_PEDAL_POSITION_E, 0.094);
sensorStore->setFloatSensor(
DiagnosticFloatSensorIndex::COMMANDED_THROTTLE_ACTUATOR, 0.024);
return sensorStore;
}
void EmulatedVehicleHal::initObd2LiveFrame(const V2_0::VehiclePropConfig& propConfig) {
auto liveObd2Frame = createVehiclePropValue(V2_0::VehiclePropertyType::COMPLEX, 0);
auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]),
static_cast<size_t>(propConfig.configArray[1]));
sensorStore->fillPropValue("", liveObd2Frame.get());
liveObd2Frame->prop = OBD2_LIVE_FRAME;
mPropStore->writeValue(*liveObd2Frame);
}
void EmulatedVehicleHal::initObd2FreezeFrame(const V2_0::VehiclePropConfig& propConfig) {
auto sensorStore = fillDefaultObd2Frame(static_cast<size_t>(propConfig.configArray[0]),
static_cast<size_t>(propConfig.configArray[1]));
static std::vector<std::string> sampleDtcs = { "P0070", "P0102" "P0123" };
for (auto&& dtc : sampleDtcs) {
auto freezeFrame = createVehiclePropValue(V2_0::VehiclePropertyType::COMPLEX, 0);
sensorStore->fillPropValue(dtc, freezeFrame.get());
freezeFrame->prop = OBD2_FREEZE_FRAME;
mPropStore->writeValue(*freezeFrame);
}
}
V2_0::StatusCode EmulatedVehicleHal::fillObd2FreezeFrame(
const V2_0::VehiclePropValue& requestedPropValue,
V2_0::VehiclePropValue* outValue) {
if (requestedPropValue.value.int64Values.size() != 1) {
ALOGE("asked for OBD2_FREEZE_FRAME without valid timestamp");
return V2_0::StatusCode::INVALID_ARG;
}
auto timestamp = requestedPropValue.value.int64Values[0];
auto freezeFrame = mPropStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp);
if(freezeFrame == nullptr) {
ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
return V2_0::StatusCode::INVALID_ARG;
}
outValue->prop = OBD2_FREEZE_FRAME;
outValue->value.int32Values = freezeFrame->value.int32Values;
outValue->value.floatValues = freezeFrame->value.floatValues;
outValue->value.bytes = freezeFrame->value.bytes;
outValue->value.stringValue = freezeFrame->value.stringValue;
outValue->timestamp = freezeFrame->timestamp;
return V2_0::StatusCode::OK;
}
V2_0::StatusCode EmulatedVehicleHal::clearObd2FreezeFrames(const V2_0::VehiclePropValue& propValue) {
if (propValue.value.int64Values.size() == 0) {
mPropStore->removeValuesForProperty(OBD2_FREEZE_FRAME);
return V2_0::StatusCode::OK;
} else {
for(int64_t timestamp: propValue.value.int64Values) {
auto freezeFrame = mPropStore->readValueOrNull(OBD2_FREEZE_FRAME, 0, timestamp);
if(freezeFrame == nullptr) {
ALOGE("asked for OBD2_FREEZE_FRAME at invalid timestamp");
return V2_0::StatusCode::INVALID_ARG;
}
mPropStore->removeValue(*freezeFrame);
}
}
return V2_0::StatusCode::OK;
}
V2_0::StatusCode EmulatedVehicleHal::fillObd2DtcInfo(V2_0::VehiclePropValue* outValue) {
std::vector<int64_t> timestamps;
for(const auto& freezeFrame: mPropStore->readValuesForProperty(OBD2_FREEZE_FRAME)) {
timestamps.push_back(freezeFrame.timestamp);
}
outValue->value.int64Values = timestamps;
outValue->prop = OBD2_FREEZE_FRAME_INFO;
return V2_0::StatusCode::OK;
}
void EmulatedVehicleHal::onCreate() {
V2_0::impl::EmulatedVehicleHal::onCreate();
initObd2LiveFrame(*mPropStore->getConfigOrDie(OBD2_LIVE_FRAME));
initObd2FreezeFrame(*mPropStore->getConfigOrDie(OBD2_FREEZE_FRAME));
}
void EmulatedVehicleHal::initStaticConfig() {
for (auto&& cfg = std::begin(kVehicleProperties); cfg != std::end(kVehicleProperties); ++cfg) {
V2_0::VehiclePropertyStore::TokenFunction tokenFunction = nullptr;
switch (cfg->prop) {
case OBD2_FREEZE_FRAME: {
tokenFunction = [] (const V2_0::VehiclePropValue& propValue) {
return propValue.timestamp;
};
break;
}
default:
break;
}
mPropStore->registerProperty(*cfg, tokenFunction);
}
}
EmulatedVehicleHal::VehiclePropValuePtr EmulatedVehicleHal::get(
const V2_0::VehiclePropValue& requestedPropValue,
V2_0::StatusCode* outStatus) {
auto propId = requestedPropValue.prop;
VehiclePropValuePtr v = nullptr;
auto& pool = *getValuePool();
switch (propId) {
case OBD2_FREEZE_FRAME:
v = pool.obtainComplex();
*outStatus = fillObd2FreezeFrame(requestedPropValue, v.get());
return v;
case OBD2_FREEZE_FRAME_INFO:
v = pool.obtainComplex();
*outStatus = fillObd2DtcInfo(v.get());
return v;
default:
return V2_0::impl::EmulatedVehicleHal::get(requestedPropValue, outStatus);
}
}
V2_0::StatusCode EmulatedVehicleHal::set(const V2_0::VehiclePropValue& propValue) {
auto propId = propValue.prop;
switch (propId) {
case OBD2_FREEZE_FRAME_CLEAR:
return clearObd2FreezeFrames(propValue);
case VEHICLE_MAP_SERVICE:
// 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 V2_0::StatusCode::OK;
default:
return V2_0::impl::EmulatedVehicleHal::set(propValue);
}
}
} // impl
} // namespace V2_1
} // namespace vehicle
} // namespace automotive
} // namespace hardware
} // namespace android

View file

@ -1,77 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef android_hardware_automotive_vehicle_V2_1_impl_EmulatedVehicleHal_H_
#define android_hardware_automotive_vehicle_V2_1_impl_EmulatedVehicleHal_H_
#include <memory>
#include <utils/SystemClock.h>
#include <vhal_v2_0/EmulatedVehicleHal.h>
#include <vhal_v2_0/VehicleHal.h>
#include <vhal_v2_0/VehiclePropertyStore.h>
#include <vhal_v2_1/Obd2SensorStore.h>
#include "DefaultConfig.h"
namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_1 {
namespace impl {
using namespace std::placeholders;
class EmulatedVehicleHal : public V2_0::impl::EmulatedVehicleHal {
public:
EmulatedVehicleHal(V2_0::VehiclePropertyStore* propStore)
: V2_0::impl::EmulatedVehicleHal(propStore), mPropStore(propStore) {
initStaticConfig();
}
VehiclePropValuePtr get(const V2_0::VehiclePropValue& requestedPropValue,
V2_0::StatusCode* outStatus) override;
V2_0::StatusCode set(const V2_0::VehiclePropValue& propValue) override;
void onCreate() override;
private:
void initStaticConfig();
void initObd2LiveFrame(const V2_0::VehiclePropConfig& propConfig);
void initObd2FreezeFrame(const V2_0::VehiclePropConfig& propConfig);
V2_0::StatusCode fillObd2FreezeFrame(const V2_0::VehiclePropValue& requestedPropValue,
V2_0::VehiclePropValue* outValue);
V2_0::StatusCode fillObd2DtcInfo(V2_0::VehiclePropValue *outValue);
V2_0::StatusCode clearObd2FreezeFrames(const V2_0::VehiclePropValue& propValue);
private:
V2_0::VehiclePropertyStore* mPropStore;
};
} // impl
} // namespace V2_1
} // namespace vehicle
} // namespace automotive
} // namespace hardware
} // namespace android
#endif // android_hardware_automotive_vehicle_V2_0_impl_EmulatedVehicleHal_H_

View file

@ -1,104 +0,0 @@
/*
* Copyright (C) 2016 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#define LOG_TAG "automotive.vehicle@2.1-service"
#include <android/log.h>
#include <hidl/HidlTransportSupport.h>
#include <iostream>
#include <android/hardware/automotive/vehicle/2.1/IVehicle.h>
#include <vhal_v2_0/VehicleHalManager.h>
#include <vhal_v2_0/VehiclePropertyStore.h>
#include <vhal_v2_0/EmulatedVehicleHal.h>
#include <vhal_v2_1/EmulatedVehicleHal.h>
using namespace android;
using namespace android::hardware;
namespace V2_1 = ::android::hardware::automotive::vehicle::V2_1;
namespace V2_0 = ::android::hardware::automotive::vehicle::V2_0;
using StatusCode = V2_0::StatusCode;
using VehiclePropValue = V2_0::VehiclePropValue;
/* Just wrapper that passes all calls to the provided V2_0::IVehicle object */
struct Vehicle_V2_1 : public V2_1::IVehicle {
Vehicle_V2_1(V2_0::IVehicle* vehicle20) : mVehicle20(vehicle20) {}
// Methods derived from IVehicle
Return<void> getAllPropConfigs(getAllPropConfigs_cb _hidl_cb) override {
return mVehicle20->getAllPropConfigs(_hidl_cb);
}
Return<void> getPropConfigs(const hidl_vec<int32_t>& properties,
getPropConfigs_cb _hidl_cb) override {
return mVehicle20->getPropConfigs(properties, _hidl_cb);
}
Return<void> get(const V2_0::VehiclePropValue& requestedPropValue,
get_cb _hidl_cb) override {
return mVehicle20->get(requestedPropValue, _hidl_cb);
}
Return<StatusCode> set(const VehiclePropValue& value) override {
return mVehicle20->set(value);
}
Return<StatusCode> subscribe(const sp<V2_0::IVehicleCallback>& callback,
const hidl_vec<V2_0::SubscribeOptions>&
options) override {
return mVehicle20->subscribe(callback, options);
}
Return<StatusCode> unsubscribe(const sp<V2_0::IVehicleCallback>& callback,
int32_t propId) override {
return mVehicle20->unsubscribe(callback, propId);
}
Return<void> debugDump(debugDump_cb _hidl_cb = nullptr) override {
return mVehicle20->debugDump(_hidl_cb);
}
private:
V2_0::IVehicle* mVehicle20;
};
int main(int /* argc */, char* /* argv */ []) {
auto store = std::make_unique<V2_0::VehiclePropertyStore>();
auto hal = std::make_unique<V2_1::impl::EmulatedVehicleHal>(store.get());
auto emulator = std::make_unique<V2_0::impl::VehicleEmulator>(hal.get());
auto vehicleManager = std::make_unique<V2_0::VehicleHalManager>(hal.get());
Vehicle_V2_1 vehicle21(vehicleManager.get());
configureRpcThreadpool(4, true /* callerWillJoin */);
ALOGI("Registering as service...");
status_t status = vehicle21.registerAsService();
if (status != OK) {
ALOGE("Unable to register vehicle service (%d).", status);
return 1;
}
ALOGI("Ready");
joinRpcThreadpool();
return 1;
}

View file

@ -1,285 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#include <gtest/gtest.h>
#include "vhal_v2_0/Obd2SensorStore.h"
#include "vhal_v2_0/VehicleUtils.h"
namespace android {
namespace hardware {
namespace automotive {
namespace vehicle {
namespace V2_0 {
namespace {
static constexpr size_t getNumVendorIntegerSensors() {
return 5;
}
static constexpr size_t getNumVendorFloatSensors() {
return 3;
}
// this struct holds information necessary for a test to be able to validate
// that the sensor bitmask contains the right data:
// - the index of the byte at which the bit for a given sensor lives
// - the expected value of that byte given that a certain sensor is present
class BitmaskIndexingInfo {
public:
size_t mByteIndex;
uint8_t mExpectedByteValue;
// Returns the information required to validate the bitmask for an
// integer-valued sensor.
static BitmaskIndexingInfo getForIntegerSensor(size_t index) {
const size_t indexInBitstream = index;
return getForBitstreamIndex(indexInBitstream);
}
// Returns the information required to validate the bitmask for a
// float-valued sensor.
static BitmaskIndexingInfo getForFloatSensor(size_t index) {
const size_t indexInBitstream = toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX) +
1 + getNumVendorIntegerSensors() + index;
return getForBitstreamIndex(indexInBitstream);
}
private:
static BitmaskIndexingInfo getForBitstreamIndex(size_t indexInBitstream) {
BitmaskIndexingInfo indexingInfo;
indexingInfo.mByteIndex = indexInBitstream / 8;
indexingInfo.mExpectedByteValue = 1 << (indexInBitstream % 8);
return indexingInfo;
}
};
static Obd2SensorStore getSensorStore() {
return Obd2SensorStore(getNumVendorIntegerSensors(),
getNumVendorFloatSensors());
}
// Test that one can set and retrieve a value for the first integer sensor.
TEST(Obd2SensorStoreTest, setFirstIntegerSensor) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setIntegerSensor(
Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS,
toInt(FuelSystemStatus::CLOSED_LOOP));
const auto& integerSensors(sensorStore.getIntegerSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(
toInt(FuelSystemStatus::CLOSED_LOOP),
integerSensors[toInt(Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS)]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForIntegerSensor(
toInt(Obd2IntegerSensorIndex::FUEL_SYSTEM_STATUS)));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
// Test that one can set and retrieve a value for the first float sensor.
TEST(Obd2SensorStoreTest, setFirstFloatSensor) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setFloatSensor(
Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD,
1.25f);
const auto& floatSensors(sensorStore.getFloatSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(
1.25f,
floatSensors[toInt(Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD)]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForFloatSensor(
toInt(Obd2FloatSensorIndex::CALCULATED_ENGINE_LOAD)));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
// Test that one can set and retrieve a value for an integer sensor.
TEST(Obd2SensorStoreTest, setAnyIntegerSensor) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setIntegerSensor(
Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE,
4000);
const auto& integerSensors(sensorStore.getIntegerSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(4000,
integerSensors[toInt(Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE)]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForIntegerSensor(
toInt(Obd2IntegerSensorIndex::ABSOLUTE_BAROMETRIC_PRESSURE)));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
// Test that one can set and retrieve a value for a float sensor.
TEST(Obd2SensorStoreTest, setAnyFloatSensor) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setFloatSensor(
Obd2FloatSensorIndex::OXYGEN_SENSOR3_VOLTAGE,
2.5f);
const auto& floatSensors(sensorStore.getFloatSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(2.5f,
floatSensors[toInt(Obd2FloatSensorIndex::OXYGEN_SENSOR3_VOLTAGE)]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForFloatSensor(
toInt(Obd2FloatSensorIndex::OXYGEN_SENSOR3_VOLTAGE)));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
// Test that one can set and retrieve a value for the last system integer sensor.
TEST(Obd2SensorStoreTest, setLastSystemIntegerSensor) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setIntegerSensor(
Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX,
30);
const auto& integerSensors(sensorStore.getIntegerSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(30,
integerSensors[toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX)]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForIntegerSensor(
toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX)));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
// Test that one can set and retrieve a value for the last system float sensor.
TEST(Obd2SensorStoreTest, setLastSystemFloatSensor) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setFloatSensor(
Obd2FloatSensorIndex::LAST_SYSTEM_INDEX,
2.5f);
const auto& floatSensors(sensorStore.getFloatSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(2.5f,
floatSensors[toInt(Obd2FloatSensorIndex::LAST_SYSTEM_INDEX)]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForFloatSensor(
toInt(Obd2FloatSensorIndex::LAST_SYSTEM_INDEX)));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
// Test that one can set and retrieve a value for two integer sensors at once.
TEST(Obd2SensorStoreTest, setTwoIntegerSensors) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setIntegerSensor(
Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE,
6);
sensorStore.setIntegerSensor(
Obd2IntegerSensorIndex::TIME_SINCE_TROUBLE_CODES_CLEARED,
1245);
const auto& integerSensors(sensorStore.getIntegerSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(6,
integerSensors[toInt(Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE)]);
ASSERT_EQ(1245,
integerSensors[toInt(Obd2IntegerSensorIndex::TIME_SINCE_TROUBLE_CODES_CLEARED)]);
const BitmaskIndexingInfo voltageIndexingInfo(BitmaskIndexingInfo::getForIntegerSensor(
toInt(Obd2IntegerSensorIndex::CONTROL_MODULE_VOLTAGE)));
const BitmaskIndexingInfo timeIndexingInfo(BitmaskIndexingInfo::getForIntegerSensor(
toInt(Obd2IntegerSensorIndex::TIME_SINCE_TROUBLE_CODES_CLEARED)));
if (voltageIndexingInfo.mByteIndex == timeIndexingInfo.mByteIndex) {
ASSERT_EQ(
voltageIndexingInfo.mExpectedByteValue |
timeIndexingInfo.mExpectedByteValue,
sensorBitmask[timeIndexingInfo.mByteIndex]);
}
else {
ASSERT_EQ(
timeIndexingInfo.mExpectedByteValue,
sensorBitmask[timeIndexingInfo.mByteIndex]);
ASSERT_EQ(
voltageIndexingInfo.mExpectedByteValue,
sensorBitmask[voltageIndexingInfo.mByteIndex]);
}
}
// Test that one can set and retrieve a value for two float sensors at once.
TEST(Obd2SensorStoreTest, setTwoFloatSensors) {
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setFloatSensor(
Obd2FloatSensorIndex::VEHICLE_SPEED,
1.25f);
sensorStore.setFloatSensor(
Obd2FloatSensorIndex::MAF_AIR_FLOW_RATE,
2.5f);
const auto& floatSensors(sensorStore.getFloatSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(1.25f,
floatSensors[toInt(Obd2FloatSensorIndex::VEHICLE_SPEED)]);
ASSERT_EQ(2.5f,
floatSensors[toInt(Obd2FloatSensorIndex::MAF_AIR_FLOW_RATE)]);
const BitmaskIndexingInfo speedIndexingInfo(BitmaskIndexingInfo::getForFloatSensor(
toInt(Obd2FloatSensorIndex::VEHICLE_SPEED)));
const BitmaskIndexingInfo airflowIndexingInfo(BitmaskIndexingInfo::getForFloatSensor(
toInt(Obd2FloatSensorIndex::MAF_AIR_FLOW_RATE)));
if (speedIndexingInfo.mByteIndex == airflowIndexingInfo.mByteIndex) {
ASSERT_EQ(
speedIndexingInfo.mExpectedByteValue |
airflowIndexingInfo.mExpectedByteValue,
sensorBitmask[airflowIndexingInfo.mByteIndex]);
}
else {
ASSERT_EQ(
speedIndexingInfo.mExpectedByteValue,
sensorBitmask[speedIndexingInfo.mByteIndex]);
ASSERT_EQ(
airflowIndexingInfo.mExpectedByteValue,
sensorBitmask[airflowIndexingInfo.mByteIndex]);
}
}
// Test that one can set and retrieve a value for a vendor integer sensor.
TEST(Obd2SensorStoreTest, setVendorIntegerSensor) {
const size_t sensorIndex = toInt(Obd2IntegerSensorIndex::LAST_SYSTEM_INDEX) + 2;
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setIntegerSensor(sensorIndex, 22);
const auto& integerSensors(sensorStore.getIntegerSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(22, integerSensors[sensorIndex]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForIntegerSensor(
sensorIndex));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
// Test that one can set and retrieve a value for a vendor float sensor.
TEST(Obd2SensorStoreTest, setVendorFloatSensor) {
const size_t sensorIndex = toInt(Obd2FloatSensorIndex::LAST_SYSTEM_INDEX) + 2;
Obd2SensorStore sensorStore(getSensorStore());
sensorStore.setFloatSensor(sensorIndex, 1.25f);
const auto& floatSensors(sensorStore.getFloatSensors());
const auto& sensorBitmask(sensorStore.getSensorsBitmask());
ASSERT_EQ(1.25f, floatSensors[sensorIndex]);
const BitmaskIndexingInfo indexingInfo(BitmaskIndexingInfo::getForFloatSensor(
sensorIndex));
ASSERT_EQ(
indexingInfo.mExpectedByteValue,
sensorBitmask[indexingInfo.mByteIndex]);
}
} // namespace anonymous
} // namespace V2_0
} // namespace vehicle
} // namespace automotive
} // namespace hardware
} // namespace android

View file

@ -1,715 +0,0 @@
/*
* Copyright (C) 2017 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.1 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.1
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package android.hardware.automotive.vehicle@2.1;
import android.hardware.automotive.vehicle@2.0;
/**
* Extension of VehicleProperty enum declared in Vehicle HAL 2.0
*/
enum VehicleProperty: @2.0::VehicleProperty {
/**
* Reports wheel ticks
*
* The first four elements represent ticks for individual wheels in the
* following order: front left, front right, rear right, rear left. All
* tick counts are cumulative. Tick counts increment when the vehicle
* moves forward, and decrement when vehicles moves in reverse. The ticks
* should be reset to 0 when the vehicle is started by the user.
*
* The next element in the vector is a reset count. A reset indicates
* previous tick counts are not comparable with this and future ones. Some
* sort of discontinuity in tick counting has occurred.
*
* int64Values[0] = reset count
* int64Values[1] = front left ticks
* int64Values[2] = front right ticks
* int64Values[3] = rear right ticks
* int64Values[4] = rear left ticks
*
* configArray is used to indicate the micrometers-per-wheel-tick value as well as
* which wheels are supported. configArray is set as follows:
*
* configArray[0], bits [0:3] = supported wheels. Uses enum Wheel.
* configArray[1] = micrometers per front left wheel tick
* configArray[2] = micrometers per front right wheel tick
* configArray[3] = micrometers per rear right wheel tick
* configArray[4] = micrometers per rear left wheel tick
*
* NOTE: If a wheel is not supported, its value shall always be set to 0.
*
* VehiclePropValue.timestamp must be correctly filled in.
*
* @change_mode VehiclePropertyChangeMode:CONTINUOUS
* @access VehiclePropertyAccess:READ
*/
WHEEL_TICK = (
0x0306
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:COMPLEX
| VehicleArea:GLOBAL),
/**
* ABS is active. Set to true whenever ABS is activated. Reset to false when ABS is off.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
ABS_ACTIVE = (
0x040A
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
| VehicleArea:GLOBAL),
/**
* Traction Control is active.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
TRACTION_CONTROL_ACTIVE = (
0x040B
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
| VehicleArea:GLOBAL),
/**
* Automatic re-circulation on/off
*
* IVehicle#set and IVehicle#get must return StatusCode::NOT_AVAILABLE when HVAC unit is off.
* See HVAC_POWER_ON property for details.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
HVAC_AUTO_RECIRC_ON = (
0x0512
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:BOOLEAN
| VehicleArea:ZONE),
/**
* Vehicle Maps Service (VMS) message
*
* This property uses COMPLEX data to communicate vms messages.
*
* Its contents are to be interpreted as follows:
* the indices defined in VmsMessageIntegerValuesIndex are to be used to
* read from int32Values;
* bytes is a serialized VMS message as defined in the vms protocol
* which is opaque to the framework;
*
* IVehicle#get must always return StatusCode::NOT_AVAILABLE.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ_WRITE
*/
VEHICLE_MAP_SERVICE = (
0x0C00
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:COMPLEX
| VehicleArea:GLOBAL),
/**
* OBD2 Live Sensor Data
*
* Reports a snapshot of the current (live) values of the OBD2 sensors available.
*
* The configArray is set as follows:
* configArray[0] = number of vendor-specific integer-valued sensors
* configArray[1] = number of vendor-specific float-valued sensors
*
* The values of this property are to be interpreted as in the following example.
* Considering a configArray = {2,3}
* int32Values must be a vector containing Obd2IntegerSensorIndex.LAST_SYSTEM_INDEX + 2
* elements (that is, 33 elements);
* floatValues must be a vector containing Obd2FloatSensorIndex.LAST_SYSTEM_INDEX + 3
* elements (that is, 73 elements);
*
* It is possible for each frame to contain a different subset of sensor values, both system
* provided sensors, and vendor-specific ones. In order to support that, the bytes element
* of the property value is used as a bitmask,.
*
* bytes must have a sufficient number of bytes to represent the total number of possible
* sensors (in this case, 14 bytes to represent 106 possible values); it is to be read as
* a contiguous bitmask such that each bit indicates the presence or absence of a sensor
* from the frame, starting with as many bits as the size of int32Values, immediately
* followed by as many bits as the size of floatValues.
*
* For example, should bytes[0] = 0x4C (0b01001100) it would mean that:
* int32Values[0 and 1] are not valid sensor values
* int32Values[2 and 3] are valid sensor values
* int32Values[4 and 5] are not valid sensor values
* int32Values[6] is a valid sensor value
* int32Values[7] is not a valid sensor value
* Should bytes[5] = 0x61 (0b01100001) it would mean that:
* int32Values[32] is a valid sensor value
* floatValues[0 thru 3] are not valid sensor values
* floatValues[4 and 5] are valid sensor values
* floatValues[6] is not a valid sensor value
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
OBD2_LIVE_FRAME = (
0x0D00
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:COMPLEX
| VehicleArea:GLOBAL),
/**
* OBD2 Freeze Frame Sensor Data
*
* Reports a snapshot of the value of the OBD2 sensors available at the time that a fault
* occurred and was detected.
*
* A configArray must be provided with the same meaning as defined for OBD2_LIVE_FRAME.
*
* The values of this property are to be interpreted in a similar fashion as those for
* OBD2_LIVE_FRAME, with the exception that the stringValue field may contain a non-empty
* diagnostic troubleshooting code (DTC).
*
* A IVehicle#get request of this property must provide a value for int64Values[0].
* This will be interpreted as the timestamp of the freeze frame to retrieve. A list of
* timestamps can be obtained by a IVehicle#get of OBD2_FREEZE_FRAME_INFO.
*
* Should no freeze frame be available at the given timestamp, a response of NOT_AVAILABLE
* must be returned by the implementation. Because vehicles may have limited storage for
* freeze frames, it is possible for a frame request to respond with NOT_AVAILABLE even if
* the associated timestamp has been recently obtained via OBD2_FREEZE_FRAME_INFO.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
OBD2_FREEZE_FRAME = (
0x0D01
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:COMPLEX
| VehicleArea:GLOBAL),
/**
* OBD2 Freeze Frame Information
*
* This property describes the current freeze frames stored in vehicle
* memory and available for retrieval via OBD2_FREEZE_FRAME.
*
* The values are to be interpreted as follows:
* each element of int64Values must be the timestamp at which a a fault code
* has been detected and the corresponding freeze frame stored, and each
* such element can be used as the key to OBD2_FREEZE_FRAME to retrieve
* the corresponding freeze frame.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:READ
*/
OBD2_FREEZE_FRAME_INFO = (
0x0D02
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:COMPLEX
| VehicleArea:GLOBAL),
/**
* OBD2 Freeze Frame Clear
*
* This property allows deletion of any of the freeze frames stored in
* vehicle memory, as described by OBD2_FREEZE_FRAME_INFO.
*
* The configArray is set as follows:
* configArray[0] = 1 if the implementation is able to clear individual freeze frames
* by timestamp, 0 otherwise
*
* IVehicle#set of this property is to be interpreted as follows:
* if int64Values contains no elements, then all frames stored must be cleared;
* if int64Values contains one or more elements, then frames at the timestamps
* stored in int64Values must be cleared, and the others not cleared. Should the
* vehicle not support selective clearing of freeze frames, this latter mode must
* return NOT_AVAILABLE.
*
* @change_mode VehiclePropertyChangeMode:ON_CHANGE
* @access VehiclePropertyAccess:WRITE
*/
OBD2_FREEZE_FRAME_CLEAR = (
0x0D03
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:COMPLEX
| VehicleArea:GLOBAL),
};
/**
* The status of the vehicle's fuel system.
* These values come from the SAE J1979 standard.
*/
enum Obd2FuelSystemStatus : int32_t {
OPEN_INSUFFICIENT_ENGINE_TEMPERATURE = 1,
CLOSED_LOOP = 2,
OPEN_ENGINE_LOAD_OR_DECELERATION = 4,
OPEN_SYSTEM_FAILURE = 8,
CLOSED_LOOP_BUT_FEEDBACK_FAULT = 16,
};
/** Defines which ignition monitors are available to be read. */
enum Obd2IgnitionMonitorKind : int32_t {
SPARK = 0,
COMPRESSION = 1,
};
/**
* Ignition monitors common to both SPARK and COMPRESSION.
* These values come from the SAE J1979 standard.
*/
enum Obd2CommonIgnitionMonitors : int32_t {
COMPONENTS_AVAILABLE = 0x1 << 0,
COMPONENTS_INCOMPLETE = 0x1 << 1,
FUEL_SYSTEM_AVAILABLE = 0x1 << 2,
FUEL_SYSTEM_INCOMPLETE = 0x1 << 3,
MISFIRE_AVAILABLE = 0x1 << 4,
MISFIRE_INCOMPLETE = 0x1 << 5,
};
/**
* Ignition monitors available for SPARK vehicles.
* These values come from the SAE J1979 standard.
*/
enum Obd2SparkIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_AVAILABLE = 0x1 << 6,
EGR_INCOMPLETE = 0x1 << 7,
OXYGEN_SENSOR_HEATER_AVAILABLE = 0x1 << 8,
OXYGEN_SENSOR_HEATER_INCOMPLETE = 0x1 << 9,
OXYGEN_SENSOR_AVAILABLE = 0x1 << 10,
OXYGEN_SENSOR_INCOMPLETE = 0x1 << 11,
AC_REFRIGERANT_AVAILABLE = 0x1 << 12,
AC_REFRIGERANT_INCOMPLETE = 0x1 << 13,
SECONDARY_AIR_SYSTEM_AVAILABLE = 0x1 << 14,
SECONDARY_AIR_SYSTEM_INCOMPLETE = 0x1 << 15,
EVAPORATIVE_SYSTEM_AVAILABLE = 0x1 << 16,
EVAPORATIVE_SYSTEM_INCOMPLETE = 0x1 << 17,
HEATED_CATALYST_AVAILABLE = 0x1 << 18,
HEATED_CATALYST_INCOMPLETE = 0x1 << 19,
CATALYST_AVAILABLE = 0x1 << 20,
CATALYST_INCOMPLETE = 0x1 << 21,
};
/**
* Ignition monitors only available for COMPRESSION vehicles.
* These values come from the SAE J1979 standard.
*/
enum Obd2CompressionIgnitionMonitors : Obd2CommonIgnitionMonitors {
EGR_OR_VVT_AVAILABLE = 0x1 << 6,
EGR_OR_VVT_INCOMPLETE = 0x1 << 7,
PM_FILTER_AVAILABLE = 0x1 << 8,
PM_FILTER_INCOMPLETE = 0x1 << 9,
EXHAUST_GAS_SENSOR_AVAILABLE = 0x1 << 10,
EXHAUST_GAS_SENSOR_INCOMPLETE = 0x1 << 11,
BOOST_PRESSURE_AVAILABLE = 0x1 << 12,
BOOST_PRESSURE_INCOMPLETE = 0x1 << 13,
NOx_SCR_AVAILABLE = 0x1 << 14,
NOx_SCR_INCOMPLETE = 0x1 << 15,
NMHC_CATALYST_AVAILABLE = 0x1 << 16,
NMHC_CATALYST_INCOMPLETE = 0x1 << 17,
};
/**
* The status of the vehicle's secondary air system.
* These values come from the SAE J1979 standard.
*/
enum Obd2SecondaryAirStatus : int32_t {
UPSTREAM = 1,
DOWNSTREAM_OF_CATALYCIC_CONVERTER = 2,
FROM_OUTSIDE_OR_OFF = 4,
PUMP_ON_FOR_DIAGNOSTICS = 8,
};
/**
* The fuel type(s) supported by a vehicle.
* These values come from the SAE J1979 standard.
*/
enum Obd2FuelType : int32_t {
NOT_AVAILABLE = 0,
GASOLINE = 1,
METHANOL = 2,
ETHANOL = 3,
DIESEL = 4,
LPG = 5,
CNG = 6,
PROPANE = 7,
ELECTRIC = 8,
BIFUEL_RUNNING_GASOLINE = 9,
BIFUEL_RUNNING_METHANOL = 10,
BIFUEL_RUNNING_ETHANOL = 11,
BIFUEL_RUNNING_LPG = 12,
BIFUEL_RUNNING_CNG = 13,
BIFUEL_RUNNING_PROPANE = 14,
BIFUEL_RUNNING_ELECTRIC = 15,
BIFUEL_RUNNING_ELECTRIC_AND_COMBUSTION = 16,
HYBRID_GASOLINE = 17,
HYBRID_ETHANOL = 18,
HYBRID_DIESEL = 19,
HYBRID_ELECTRIC = 20,
HYBRID_RUNNING_ELECTRIC_AND_COMBUSTION = 21,
HYBRID_REGENERATIVE = 22,
BIFUEL_RUNNING_DIESEL = 23,
};
/**
* This enum provides the canonical mapping for sensor properties that have an integer value.
* The ordering of the values is taken from the OBD2 specification.
* Some of the properties are represented as an integer mapping to another enum. In those cases
* expect a comment by the property definition describing the enum to look at for the mapping.
* Any value greater than the last reserved index is available to vendors to map their extensions.
* While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next
* to each one to aid implementors.
*/
enum DiagnosticIntegerSensorIndex : int32_t {
/** refer to FuelSystemStatus for a description of this value. */
FUEL_SYSTEM_STATUS = 0, /* PID 0x03 */
MALFUNCTION_INDICATOR_LIGHT_ON = 1, /* PID 0x01 */
/** refer to IgnitionMonitorKind for a description of this value. */
IGNITION_MONITORS_SUPPORTED = 2, /* PID 0x01 */
/**
* The value of this sensor is a bitmask that specifies whether ignition-specific
* tests are available and whether they are complete. The semantics of the individual
* bits in this value are given by, respectively, SparkIgnitionMonitors and
* CompressionIgnitionMonitors depending on the value of IGNITION_MONITORS_SUPPORTED.
*/
IGNITION_SPECIFIC_MONITORS = 3, /* PID 0x01 */
INTAKE_AIR_TEMPERATURE = 4, /* PID 0x0F */
/** refer to SecondaryAirStatus for a description of this value. */
COMMANDED_SECONDARY_AIR_STATUS = 5, /* PID 0x12 */
NUM_OXYGEN_SENSORS_PRESENT = 6, /* PID 0x13 */
RUNTIME_SINCE_ENGINE_START = 7, /* PID 0x1F */
DISTANCE_TRAVELED_WITH_MALFUNCTION_INDICATOR_LIGHT_ON = 8, /* PID 0x21 */
WARMUPS_SINCE_CODES_CLEARED = 9, /* PID 0x30 */
DISTANCE_TRAVELED_SINCE_CODES_CLEARED = 10, /* PID 0x31 */
ABSOLUTE_BAROMETRIC_PRESSURE = 11, /* PID 0x33 */
CONTROL_MODULE_VOLTAGE = 12, /* PID 0x42 */
AMBIENT_AIR_TEMPERATURE = 13, /* PID 0x46 */
TIME_WITH_MALFUNCTION_LIGHT_ON = 14, /* PID 0x4D */
TIME_SINCE_TROUBLE_CODES_CLEARED = 15, /* PID 0x4E */
MAX_FUEL_AIR_EQUIVALENCE_RATIO = 16, /* PID 0x4F */
MAX_OXYGEN_SENSOR_VOLTAGE = 17, /* PID 0x4F */
MAX_OXYGEN_SENSOR_CURRENT = 18, /* PID 0x4F */
MAX_INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 19, /* PID 0x4F */
MAX_AIR_FLOW_RATE_FROM_MASS_AIR_FLOW_SENSOR = 20, /* PID 0x50 */
/** refer to FuelType for a description of this value. */
FUEL_TYPE = 21, /* PID 0x51 */
FUEL_RAIL_ABSOLUTE_PRESSURE = 22, /* PID 0x59 */
ENGINE_OIL_TEMPERATURE = 23, /* PID 0x5C */
DRIVER_DEMAND_PERCENT_TORQUE = 24, /* PID 0x61 */
ENGINE_ACTUAL_PERCENT_TORQUE = 25, /* PID 0x62 */
ENGINE_REFERENCE_PERCENT_TORQUE = 26, /* PID 0x63 */
ENGINE_PERCENT_TORQUE_DATA_IDLE = 27, /* PID 0x64 */
ENGINE_PERCENT_TORQUE_DATA_POINT1 = 28, /* PID 0x64 */
ENGINE_PERCENT_TORQUE_DATA_POINT2 = 29, /* PID 0x64 */
ENGINE_PERCENT_TORQUE_DATA_POINT3 = 30, /* PID 0x64 */
ENGINE_PERCENT_TORQUE_DATA_POINT4 = 31, /* PID 0x64 */
LAST_SYSTEM_INDEX = ENGINE_PERCENT_TORQUE_DATA_POINT4,
};
/**
* This enum provides the canonical mapping for sensor properties that have a floating-point value.
* The ordering of the values is taken from the OBD2 specification.
* Any value greater than the last reserved index is available to vendors to map their extensions.
* While these values do not directly map to SAE J1979 PIDs, an equivalence is listed next
* to each one to aid implementors.
*/
enum DiagnosticFloatSensorIndex : int32_t {
CALCULATED_ENGINE_LOAD = 0, /* PID 0x04 */
ENGINE_COOLANT_TEMPERATURE = 1, /* PID 0x05 */
SHORT_TERM_FUEL_TRIM_BANK1 = 2, /* PID 0x06 */
LONG_TERM_FUEL_TRIM_BANK1 = 3, /* PID 0x07 */
SHORT_TERM_FUEL_TRIM_BANK2 = 4, /* PID 0x08 */
LONG_TERM_FUEL_TRIM_BANK2 = 5, /* PID 0x09 */
FUEL_PRESSURE = 6, /* PID 0x0A */
INTAKE_MANIFOLD_ABSOLUTE_PRESSURE = 7, /* PID 0x0B */
ENGINE_RPM = 8, /* PID 0x0C */
VEHICLE_SPEED = 9, /* PID 0x0D */
TIMING_ADVANCE = 10, /* PID 0x0E */
MAF_AIR_FLOW_RATE = 11, /* PID 0x10 */
THROTTLE_POSITION = 12, /* PID 0x11 */
OXYGEN_SENSOR1_VOLTAGE = 13, /* PID 0x14 */
OXYGEN_SENSOR1_SHORT_TERM_FUEL_TRIM = 14, /* PID 0x14 */
OXYGEN_SENSOR1_FUEL_AIR_EQUIVALENCE_RATIO = 15, /* PID 0x24 */
OXYGEN_SENSOR2_VOLTAGE = 16, /* PID 0x15 */
OXYGEN_SENSOR2_SHORT_TERM_FUEL_TRIM = 17, /* PID 0x15 */
OXYGEN_SENSOR2_FUEL_AIR_EQUIVALENCE_RATIO = 18, /* PID 0x25 */
OXYGEN_SENSOR3_VOLTAGE = 19, /* PID 0x16 */
OXYGEN_SENSOR3_SHORT_TERM_FUEL_TRIM = 20, /* PID 0x16 */
OXYGEN_SENSOR3_FUEL_AIR_EQUIVALENCE_RATIO = 21, /* PID 0x26 */
OXYGEN_SENSOR4_VOLTAGE = 22, /* PID 0x17 */
OXYGEN_SENSOR4_SHORT_TERM_FUEL_TRIM = 23, /* PID 0x17 */
OXYGEN_SENSOR4_FUEL_AIR_EQUIVALENCE_RATIO = 24, /* PID 0x27 */
OXYGEN_SENSOR5_VOLTAGE = 25, /* PID 0x18 */
OXYGEN_SENSOR5_SHORT_TERM_FUEL_TRIM = 26, /* PID 0x18 */
OXYGEN_SENSOR5_FUEL_AIR_EQUIVALENCE_RATIO = 27, /* PID 0x28 */
OXYGEN_SENSOR6_VOLTAGE = 28, /* PID 0x19 */
OXYGEN_SENSOR6_SHORT_TERM_FUEL_TRIM = 29, /* PID 0x19 */
OXYGEN_SENSOR6_FUEL_AIR_EQUIVALENCE_RATIO = 30, /* PID 0x29 */
OXYGEN_SENSOR7_VOLTAGE = 31, /* PID 0x1A */
OXYGEN_SENSOR7_SHORT_TERM_FUEL_TRIM = 32, /* PID 0x1A */
OXYGEN_SENSOR7_FUEL_AIR_EQUIVALENCE_RATIO = 33, /* PID 0x2A */
OXYGEN_SENSOR8_VOLTAGE = 34, /* PID 0x1B */
OXYGEN_SENSOR8_SHORT_TERM_FUEL_TRIM = 35, /* PID 0x1B */
OXYGEN_SENSOR8_FUEL_AIR_EQUIVALENCE_RATIO = 36, /* PID 0x2B */
FUEL_RAIL_PRESSURE = 37, /* PID 0x22 */
FUEL_RAIL_GAUGE_PRESSURE = 38, /* PID 0x23 */
COMMANDED_EXHAUST_GAS_RECIRCULATION = 39, /* PID 0x2C */
EXHAUST_GAS_RECIRCULATION_ERROR = 40, /* PID 0x2D */
COMMANDED_EVAPORATIVE_PURGE = 41, /* PID 0x2E */
FUEL_TANK_LEVEL_INPUT = 42, /* PID 0x2F */
EVAPORATION_SYSTEM_VAPOR_PRESSURE = 43, /* PID 0x32 */
CATALYST_TEMPERATURE_BANK1_SENSOR1 = 44, /* PID 0x3C */
CATALYST_TEMPERATURE_BANK2_SENSOR1 = 45, /* PID 0x3D */
CATALYST_TEMPERATURE_BANK1_SENSOR2 = 46, /* PID 0x3E */
CATALYST_TEMPERATURE_BANK2_SENSOR2 = 47, /* PID 0x3F */
ABSOLUTE_LOAD_VALUE = 48, /* PID 0x43 */
FUEL_AIR_COMMANDED_EQUIVALENCE_RATIO = 49, /* PID 0x44 */
RELATIVE_THROTTLE_POSITION = 50, /* PID 0x45 */
ABSOLUTE_THROTTLE_POSITION_B = 51, /* PID 0x47 */
ABSOLUTE_THROTTLE_POSITION_C = 52, /* PID 0x48 */
ACCELERATOR_PEDAL_POSITION_D = 53, /* PID 0x49 */
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 */
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_BANK4 = 62, /* PID 0x57 */
LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK1 = 63, /* PID 0x56 */
LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK2 = 64, /* PID 0x58 */
LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK3 = 65, /* PID 0x56 */
LONG_TERM_SECONDARY_OXYGEN_SENSOR_TRIM_BANK4 = 66, /* PID 0x58 */
RELATIVE_ACCELERATOR_PEDAL_POSITION = 67, /* PID 0x5A */
HYBRID_BATTERY_PACK_REMAINING_LIFE = 68, /* PID 0x5B */
FUEL_INJECTION_TIMING = 69, /* PID 0x5D */
ENGINE_FUEL_RATE = 70, /* PID 0x5E */
LAST_SYSTEM_INDEX = ENGINE_FUEL_RATE,
};
/**
* This enum lists the types of supported VMS messages. It is used as the first
* integer in the vehicle property integers array and determines how the rest of
* the message is decoded.
*/
enum VmsMessageType : int32_t {
/**
* A request from the subscribers to the VMS service to subscribe to a layer.
*
* This message type uses enum VmsMessageWithLayerIntegerValuesIndex.
*/
SUBSCRIBE = 1,
/**
* A request from the subscribers to the VMS service to subscribe to a layer from a specific publisher.
*
* This message type uses enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.
*/
SUBSCRIBE_TO_PUBLISHER = 2,
/**
* A request from the subscribers to the VMS service to unsubscribes from a layer.
*
* This message type uses enum VmsMessageWithLayerIntegerValuesIndex.
*/
UNSUBSCRIBE = 3,
/**
* A request from the subscribers to the VMS service to unsubscribes from a layer from a specific publisher.
*
* This message type uses enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex.
*/
UNSUBSCRIBE_TO_PUBLISHER = 4,
/**
* Information from the publishers to the VMS service about the layers which the client can publish.
*
* This message type uses enum VmsOfferingMessageIntegerValuesIndex.
*/
OFFERING = 5,
/**
* A request from the subscribers to the VMS service to get the available layers.
*
* This message type uses enum VmsBaseMessageIntegerValuesIndex.
*/
AVAILABILITY_REQUEST = 6,
/**
* A request from the publishers to the VMS service to get the layers with subscribers.
*
* This message type uses enum VmsBaseMessageIntegerValuesIndex.
*/
SUBSCRIPTIONS_REQUEST = 7,
/**
* A response from the VMS service to the subscribers to a VmsMessageType.AVAILABILITY_REQUEST
*
* This message type uses enum VmsAvailabilityStateIntegerValuesIndex.
*/
AVAILABILITY_RESPONSE = 8,
/**
* A notification from the VMS service to the subscribers on a change in the available layers.
*
* This message type uses enum VmsAvailabilityStateIntegerValuesIndex.
*/
AVAILABILITY_CHANGE = 9,
/**
* A response from the VMS service to the publishers to a VmsMessageType.SUBSCRIPTIONS_REQUEST
*
* This message type uses enum VmsSubscriptionsStateIntegerValuesIndex.
*/
SUBSCRIPTIONS_RESPONSE = 10,
/**
* A notification from the VMS service to the publishers on a change in the layers with subscribers.
*
* This message type uses enum VmsSubscriptionsStateIntegerValuesIndex.
*/
SUBSCRIPTIONS_CHANGE = 11,
/**
* A message from the VMS service to the subscribers or from the publishers to the VMS service
* with a serialized VMS data packet as defined in the VMS protocol.
*
* This message type uses enum VmsBaseMessageIntegerValuesIndex.
*/
DATA = 12,
};
/**
* Every VMS message starts with the type of the message from the VmsMessageType enum.
* Messages with no parameters such as VmsMessageType.AVAILABILITY_REQUEST,
* VmsMessageType.SUBSCRIPTIONS_REQUEST and VmsMessageType.DATA are also based on this enum.
*/
enum VmsBaseMessageIntegerValuesIndex : int32_t {
/* The message type as enumerated by VmsMessageType enum. */
MESSAGE_TYPE = 0,
};
/*
* A VMS message with a layer is sent as part of a VmsMessageType.SUBSCRIBE or
* VmsMessageType.UNSUBSCRIBE messages.
*
* The layer type is defined in the VMS protocol, and the subtype and version are
* controlled by the implementer of the publisher.
*/
enum VmsMessageWithLayerIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
LAYER_TYPE = 1,
LAYER_SUBTYPE = 2,
LAYER_VERSION = 3,
};
/*
* A VMS message with a layer and publisher ID is sent as part of a
* VmsMessageType.SUBSCRIBE_TO_PUBLISHER and VmsMessageType.UNSUBSCRIBE_TO_PUBLISHER messages.
*/
enum VmsMessageWithLayerAndPublisherIdIntegerValuesIndex : VmsMessageWithLayerIntegerValuesIndex {
PUBLISHER_ID = 4,
};
/*
* An offering can be sent by publishers as part of VmsMessageType.OFFERING in order to
* advertise which layers they can publish and under which constraints: e.g., I can publish Layer X
* if someone else will publish Layer Y.
* The offering contains the publisher ID which was assigned to the publisher by the VMS service.
* A single offering is represented as:
* - Layer type
* - Layer subtype
* - Layer version
* - Number of dependencies (N)
* - N x (Layer type, Layer subtype, Layer version)
*/
enum VmsOfferingMessageIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
PUBLISHER_ID = 1,
NUMBER_OF_OFFERS = 2,
OFFERING_START = 3,
};
/**
* A subscriptions state is sent to the publishers in response to a change in the subscriptions
* as part of a VmsMessageType.SUBSCRIPTIONS_CHANGE, or in response to a
* VmsMessageType.SUBSCRIPTIONS_REQUEST message as part of VmsMessageType.SUBSCRIPTIONS_RESPONSE.
* The VMS service issues monotonically increasing sequence numbers, and in case a subscriber receives
* a smaller sequnce number it should ignore the message.
* The subscriptions are sent as a list of layers followed by a list of associated layers:
* {Sequence number, N, M, N x layer, M x associated layer}
* A subscribed layer is represented as three integers:
* - Layer type
* - Layer subtype
* - Layer version
* A subscribed associated layer is a layer with a list of publisher IDs. It is represented as:
* - Layer type
* - Layer subtype
* - Layer version
* - Number of publisher IDs (N)
* - N x publisher ID
*/
enum VmsSubscriptionsStateIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
SEQUENCE_NUMBER = 1,
NUMBER_OF_LAYERS = 2,
NUMBER_OF_ASSOCIATED_LAYERS = 3,
SUBSCRIPTIONS_START = 4,
};
/**
* An availability state is sent to the subscribers in response to a change in the available
* layers as part of a VmsMessageType.AVAILABILITY_CHANGE message, or in response to a
* VmsMessageType.AVAILABILITY_REQUEST message as part of a VmsMessageType.AVAILABILITY_RESPONSE.
* The VMS service issues monotonically increasing sequence numbers, and in case a subscriber receives
* a smaller sequnce number, it should ignore the message.
* An available associated layer is a layer with a list of publisher IDs:
* - Layer type
* - Layer subtype
* - Layer version
* - Number of publisher IDs (N)
* - N x publisher ID
*/
enum VmsAvailabilityStateIntegerValuesIndex : VmsBaseMessageIntegerValuesIndex {
SEQUENCE_NUMBER = 1,
NUMBER_OF_ASSOCIATED_LAYERS = 2,
LAYERS_START = 3,
};

View file

@ -224,3 +224,4 @@ c3354ab0d381a236c12dc486ad4b6bec28c979d26748b4661f12ede36f392808 android.hardwar
b18caefefcc765092412285d776234fcf213b73bdf07ae1b67a5f71b2d2464e3 android.hardware.wifi.offload@1.0::types
c26473e2e4a00af43e28a0ddf9002e5062a7d0940429e5efb6e5513a8abcb75c android.hardware.wifi@1.1::IWifi
b056e1defab4071584214584057d0bc73a613081bf1152590549649d4582c13c android.hardware.wifi@1.1::IWifiChip
05e0edf31db5b3ae19047d87059545cc2f836023edf8f9d969319e15e3485158 android.hardware.automotive.vehicle@2.0::types