diff --git a/automotive/Android.bp b/automotive/Android.bp index d9a6355024..8cde817d03 100644 --- a/automotive/Android.bp +++ b/automotive/Android.bp @@ -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", ] diff --git a/automotive/vehicle/2.0/Android.mk b/automotive/vehicle/2.0/Android.mk index eb05f35eca..5919487471 100644 --- a/automotive/vehicle/2.0/Android.mk +++ b/automotive/vehicle/2.0/Android.mk @@ -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) # diff --git a/automotive/vehicle/2.0/default/Android.bp b/automotive/vehicle/2.0/default/Android.bp index 3e3ff2c852..1690163d2a 100644 --- a/automotive/vehicle/2.0/default/Android.bp +++ b/automotive/vehicle/2.0/default/Android.bp @@ -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", diff --git a/automotive/vehicle/2.1/default/common/include/vhal_v2_1/Obd2SensorStore.h b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/Obd2SensorStore.h similarity index 74% rename from automotive/vehicle/2.1/default/common/include/vhal_v2_1/Obd2SensorStore.h rename to automotive/vehicle/2.0/default/common/include/vhal_v2_0/Obd2SensorStore.h index 8000695543..191a565c61 100644 --- a/automotive/vehicle/2.1/default/common/include/vhal_v2_1/Obd2SensorStore.h +++ b/automotive/vehicle/2.0/default/common/include/vhal_v2_0/Obd2SensorStore.h @@ -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 -#include +#include 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& getIntegerSensors() const; @@ -55,11 +54,11 @@ public: const std::vector& 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& getBitmask() const; - private: + private: std::vector mStorage; }; @@ -76,7 +75,7 @@ private: BitmaskInVector mSensorsBitmask; }; -} // namespace V2_1 +} // namespace V2_0 } // namespace vehicle } // namespace automotive } // namespace hardware diff --git a/automotive/vehicle/2.1/default/common/src/Obd2SensorStore.cpp b/automotive/vehicle/2.0/default/common/src/Obd2SensorStore.cpp similarity index 61% rename from automotive/vehicle/2.1/default/common/src/Obd2SensorStore.cpp rename to automotive/vehicle/2.0/default/common/src/Obd2SensorStore.cpp index 8705e00b4c..65174f7a00 100644 --- a/automotive/vehicle/2.1/default/common/src/Obd2SensorStore.cpp +++ b/automotive/vehicle/2.0/default/common/src/Obd2SensorStore.cpp @@ -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((numBits+7)/8, 0); + mStorage = std::vector((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& 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( - numSystemIntegerSensors+numVendorIntegerSensors, 0); - mFloatSensors = std::vector( - 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(numSystemIntegerSensors + numVendorIntegerSensors, 0); + mFloatSensors = std::vector(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& Obd2SensorStore::getIntegerSensors() const { @@ -102,8 +93,7 @@ const std::vector& 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 diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h index fb63e3645e..08d3d79446 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h @@ -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 diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp index 4800cd8054..385f03de5c 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp @@ -19,6 +19,7 @@ #include #include "EmulatedVehicleHal.h" +#include "Obd2SensorStore.h" namespace android { namespace hardware { @@ -28,6 +29,62 @@ namespace V2_0 { namespace impl { +static std::unique_ptr fillDefaultObd2Frame(size_t numVendorIntegerSensors, + size_t numVendorFloatSensors) { + std::unique_ptr 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 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(propConfig.configArray[0]), + static_cast(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(propConfig.configArray[0]), + static_cast(propConfig.configArray[1])); + + static std::vector 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 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 diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h index c25e0838c5..99d7edbc78 100644 --- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h +++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h @@ -70,8 +70,15 @@ private: void onContinuousPropertyTimer(const std::vector& 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 mHvacPowerProps; RecurrentTimer mRecurrentTimer; diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal index f1fb6bf2b9..12b92dd352 100644 --- a/automotive/vehicle/2.0/types.hal +++ b/automotive/vehicle/2.0/types.hal @@ -225,6 +225,50 @@ enum VehicleProperty: int32_t { | VehiclePropertyType:FLOAT | VehicleArea:GLOBAL), + /** + * 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 + * + * @since o.mr1 + */ + WHEEL_TICK = ( + 0x0306 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:COMPLEX + | VehicleArea:GLOBAL), + + /** * Currently selected gear * @@ -327,6 +371,34 @@ enum VehicleProperty: int32_t { | VehiclePropertyType:INT32 | 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 + * + * @since o.mr1 + */ + ABS_ACTIVE = ( + 0x040A + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BOOLEAN + | VehicleArea:GLOBAL), + + /** + * Traction Control is active. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ + * + * @since o.mr1 + */ + TRACTION_CONTROL_ACTIVE = ( + 0x040B + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BOOLEAN + | VehicleArea:GLOBAL), + /** * Fan speed setting * @@ -603,6 +675,24 @@ enum VehicleProperty: int32_t { | VehiclePropertyType:INT32 | VehicleArea:ZONE), + /** + * Represents power state for HVAC. Some HVAC properties must require + * matching power to be turned on to get out of OFF state. For non-zoned + * HVAC properties, VEHICLE_ALL_ZONE corresponds to global power state. + * + * @change_mode VehiclePropertyChangeMode:ON_CHANGE + * @access VehiclePropertyAccess:READ_WRITE + * @config_string list of HVAC properties whose power is controlled by this + * property. Format is hexa-decimal number (0x...) separated + * by comma like "0x500,0x503". All zones defined in these + * affected properties must be available in the property. + */ + HVAC_POWER_ON = ( + 0x0510 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:BOOLEAN + | VehicleArea:ZONE), + /** * Fan Positions Available * @@ -623,19 +713,18 @@ enum VehicleProperty: int32_t { | VehicleArea:ZONE), /** - * Represents power state for HVAC. Some HVAC properties must require - * matching power to be turned on to get out of OFF state. For non-zoned - * HVAC properties, VEHICLE_ALL_ZONE corresponds to global power state. + * 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 - * @config_string list of HVAC properties whose power is controlled by this - * property. Format is hexa-decimal number (0x...) separated - * by comma like "0x500,0x503". All zones defined in these - * affected properties must be available in the property. + * + * @since o.mr1 */ - HVAC_POWER_ON = ( - 0x0510 + HVAC_AUTO_RECIRC_ON = ( + 0x0512 | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN | VehicleArea:ZONE), @@ -742,18 +831,21 @@ enum VehicleProperty: int32_t { * 0 means no active audio focus holder outside Android. * The state must have following values for each * VehicleAudioFocusState: - * GAIN: 0 or VehicleAudioExtFocusFlag#PLAY_ONLY_FLAG - * when radio is active in Android side. - * GAIN_TRANSIENT: 0. Can be + * GAIN: VehicleAudioExtFocusFlag#PLAY_ONLY_FLAG + * when radio is active in Android side. Otherwise, + * VehicleAudioExtFocusFlag#NONE_FLAG. + * GAIN_TRANSIENT: Can be * VehicleAudioExtFocusFlag#PERMANENT_FLAG or * VehicleAudioExtFocusFlag#TRANSIENT_FLAG if android * side has requested * REQUEST_GAIN_TRANSIENT_MAY_DUCK and car side is - * ducking. - * LOSS: 0 when no focus is audio is active in car side. + * ducking. Otherwise + * VehicleAudioExtFocusFlag#NONE_FLAG. + * LOSS: VehicleAudioExtFocusFlag#NONE_FLAG when no focus + * is active in car side. * VehicleAudioExtFocusFlag#PERMANENT_FLAG when car * side is playing something permanent. - * LOSS_TRANSIENT: always must be + * LOSS_TRANSIENT: must always be * VehicleAudioExtFocusFlag#PERMANENT_FLAG * int32Values[3]: context requested by android side when responding to * focus request. When car side is taking focus away, @@ -857,12 +949,12 @@ enum VehicleProperty: int32_t { * to represent audio module's capability. * * Data type looks like: - * int32Values[0] : stream context as defined in VehicleAudioFocusFlag. + * int32Values[0] : stream context as defined in VehicleAudioContextFlag. * If only physical stream is supported * (configArray[0] == 0), this must represent physical * stream number. * int32Values[1] : maximum volume set to the stream. If there is no - * restriction, this value must be bigger than + * restriction, this value must be bigger than * AUDIO_VOLUME's max value. * * If car does not support this feature, this property must not be @@ -893,7 +985,7 @@ enum VehicleProperty: int32_t { * still use different audio stream for whatever reason. * int32Values[1] : All audio contexts that must be sent through the * physical stream. Flag is defined in - * VehicleAudioFocusFlag. + * VehicleAudioContextFlag. * Setting of this property must be done for all available physical streams * based on audio H/W variant information acquired from AUDIO_HW_VARIANT @@ -942,14 +1034,13 @@ enum VehicleProperty: int32_t { * for the routing. * This property can support up to 128 external routings. * To give full flexibility, there is no standard definition for each bit - * flag and assigning each big flag to specific routing type is decided by + * flag and assigning each bit flag to specific routing type is decided by * VehiclePropConfig#configString. VehiclePropConfig#configString has * format of each entry separated by ',' and each entry has format of * bitFlagPositon:typeString[:physicalStreamNumber]. - * bitFlagPosition: represents which big flag will be set to enable this - * routing. 0 means - * LSB in int32Values[0]. 31 will be MSB in int32Values[0]. 127 will MSB - * in int32Values[3]. + * bitFlagPosition: represents which bit flag will be set to enable this + * routing. 0 means LSB in int32Values[0]. 31 will be MSB in + * int32Values[0]. 127 will MSB in int32Values[3]. * typeString: string representation of external routing. Some types are * already defined in AUDIO_EXT_ROUTING_SOURCE_* and use them first * before adding something custom. Applications will find each routing @@ -1126,10 +1217,11 @@ enum VehicleProperty: int32_t { * change. Instrument cluster still needs to send * event with new mode to trigger actual mode change. * int32Values[1] : The current app context relevant for instrument - * cluster. Use the same flag with VehicleAudioFocusFlag - * but this context represents active apps, not - * active audio. Instrument cluster side may change mode - * depending on the currently active contexts. + * cluster. Use the same flag with + * VehicleAudioContextFlag but this context represents + * active apps, not active audio. Instrument cluster + * side may change mode depending on the currently + * active contexts. * When system boots up, Android side will write {0, 0, 0, 0} when it is * ready to render to instrument cluster. Before this message, rendering * from android must not be visible in the cluster. @@ -1790,85 +1882,240 @@ enum VehicleProperty: int32_t { | VehiclePropertyGroup:SYSTEM | VehiclePropertyType:BOOLEAN | VehicleArea:GLOBAL), + + + /** + * 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 + * + * @since o.mr1 + */ + 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 + * + * @since o.mr1 + */ + 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 + * + * @since o.mr1 + */ + 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 + * + * @since o.mr1 + */ + 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 + * + * @since o.mr1 + */ + OBD2_FREEZE_FRAME_CLEAR = ( + 0x0D03 + | VehiclePropertyGroup:SYSTEM + | VehiclePropertyType:COMPLEX + | VehicleArea:GLOBAL), }; /** * Bit flags for fan direction */ enum VehicleHvacFanDirection : int32_t { - FACE = 0x1, - FLOOR = 0x2, - FACE_AND_FLOOR = 0x3, - DEFROST = 0x4, - DEFROST_AND_FLOOR = 0x5, + FACE = 0x1, + FLOOR = 0x2, + FACE_AND_FLOOR = 0x3, + DEFROST = 0x4, + DEFROST_AND_FLOOR = 0x5, }; /** * Constants relevant to radio. */ enum VehicleRadioConstants : int32_t { - /** Minimum value for the radio preset */ - VEHICLE_RADIO_PRESET_MIN_VALUE = 1, + /** Minimum value for the radio preset */ + VEHICLE_RADIO_PRESET_MIN_VALUE = 1, }; enum VehicleAudioFocusRequest : int32_t { - REQUEST_GAIN = 0x1, - REQUEST_GAIN_TRANSIENT = 0x2, - REQUEST_GAIN_TRANSIENT_MAY_DUCK = 0x3, - /** - * This is for the case where android side plays sound like UI feedback - * and car side does not need to duck existing playback as long as - * requested stream is available. - */ - REQUEST_GAIN_TRANSIENT_NO_DUCK = 0x4, - REQUEST_RELEASE = 0x5, - + REQUEST_GAIN = 0x1, + REQUEST_GAIN_TRANSIENT = 0x2, + REQUEST_GAIN_TRANSIENT_MAY_DUCK = 0x3, + /** + * This is for the case where android side plays sound like UI feedback + * and car side does not need to duck existing playback as long as + * requested stream is available. + */ + REQUEST_GAIN_TRANSIENT_NO_DUCK = 0x4, + REQUEST_RELEASE = 0x5, }; enum VehicleAudioFocusState : int32_t { - /** - * Android side has permanent focus and can play allowed streams. - */ - STATE_GAIN = 0x1, + /** + * Android side has permanent focus and can play allowed streams. + */ + STATE_GAIN = 0x1, - /** - * Android side has transient focus and can play allowed streams. - */ - STATE_GAIN_TRANSIENT = 0x2, + /** + * Android side has transient focus and can play allowed streams. + */ + STATE_GAIN_TRANSIENT = 0x2, - /** - * Car audio module is playing guidance kind of sound outside Android. - * Android side can still play through allowed streams with ducking. - */ - STATE_LOSS_TRANSIENT_CAN_DUCK = 0x3, + /** + * Car audio module is playing guidance kind of sound outside Android. + * Android side can still play through allowed streams with ducking. + */ + STATE_LOSS_TRANSIENT_CAN_DUCK = 0x3, - /** - * Car audio module is playing transient sound outside Android. Android side - * must stop playing any sounds. - */ - STATE_LOSS_TRANSIENT = 0x4, + /** + * Car audio module is playing transient sound outside Android. Android side + * must stop playing any sounds. + */ + STATE_LOSS_TRANSIENT = 0x4, - /** - * Android side has lost focus and cannot play any sound. - */ - STATE_LOSS = 0x5, - - /** - * car audio module is playing safety critical sound, and Android side cannot - * request focus until the current state is finished. car audio module - * restore it to the previous state when it can allow Android to play. - */ - STATE_LOSS_TRANSIENT_EXLCUSIVE = 0x6, + /** + * Android side has lost focus and cannot play any sound. + */ + STATE_LOSS = 0x5, + /** + * car audio module is playing safety critical sound, and Android side cannot + * request focus until the current state is finished. car audio module + * restore it to the previous state when it can allow Android to play. + */ + STATE_LOSS_TRANSIENT_EXLCUSIVE = 0x6, }; /** * Flags to represent multiple streams by combining these. */ enum VehicleAudioStreamFlag : int32_t { - STREAM0_FLAG = (0x1 << 0), - STREAM1_FLAG = (0x1 << 1), - STREAM2_FLAG = (0x1 << 2), + STREAM0_FLAG = (0x1 << 0), + STREAM1_FLAG = (0x1 << 1), + STREAM2_FLAG = (0x1 << 2), }; /** @@ -1876,107 +2123,107 @@ enum VehicleAudioStreamFlag : int32_t { * Can be used for audio related property expecting one stream. */ enum VehicleAudioStream : int32_t { - STREAM0 = 0, - STREAM1 = 1, + STREAM0 = 0, + STREAM1 = 1, }; /** * Flag to represent external focus state (outside Android). */ enum VehicleAudioExtFocusFlag : int32_t { - /** - * No external focus holder. - */ - NONE_FLAG = 0x0, + /** + * No external focus holder. + */ + NONE_FLAG = 0x0, - /** - * Car side (outside Android) has component holding GAIN kind of focus state. - */ - PERMANENT_FLAG = 0x1, + /** + * Car side (outside Android) has component holding GAIN kind of focus state. + */ + PERMANENT_FLAG = 0x1, - /** - * Car side (outside Android) has component holding GAIN_TRANSIENT kind of - * focus state. - */ - TRANSIENT_FLAG = 0x2, + /** + * Car side (outside Android) has component holding GAIN_TRANSIENT kind of + * focus state. + */ + TRANSIENT_FLAG = 0x2, - /** - * Car side is expected to play something while focus is held by Android side. - * One example can be radio attached in car side. But Android's radio app - * still must have focus, and Android side must be in GAIN state, but - * media stream will not be allocated to Android side and car side can play - * radio any time while this flag is active. - */ - PLAY_ONLY_FLAG = 0x4, + /** + * Car side is expected to play something while focus is held by Android side. + * One example can be radio attached in car side. But Android's radio app + * still must have focus, and Android side must be in GAIN state, but + * media stream will not be allocated to Android side and car side can play + * radio any time while this flag is active. + */ + PLAY_ONLY_FLAG = 0x4, - /** - * Car side must mute any media including radio. This can be used with any - * focus request including GAIN* and RELEASE. - */ - MUTE_MEDIA_FLAG = 0x8, + /** + * Car side must mute any media including radio. This can be used with any + * focus request including GAIN* and RELEASE. + */ + MUTE_MEDIA_FLAG = 0x8, }; /** * Index in int32Values for VehicleProperty#AUDIO_FOCUS property. */ enum VehicleAudioFocusIndex : int32_t { - FOCUS = 0, - STREAMS = 1, - EXTERNAL_FOCUS_STATE = 2, - AUDIO_CONTEXTS = 3, + FOCUS = 0, + STREAMS = 1, + EXTERNAL_FOCUS_STATE = 2, + AUDIO_CONTEXTS = 3, }; /** * Flags to tell the current audio context. */ enum VehicleAudioContextFlag : int32_t { - /** Music playback is currently active. */ - MUSIC_FLAG = 0x1, + /** Music playback is currently active. */ + MUSIC_FLAG = 0x1, - /** Navigation is currently running. */ - NAVIGATION_FLAG = 0x2, + /** Navigation is currently running. */ + NAVIGATION_FLAG = 0x2, - /** Voice command session is currently running. */ - VOICE_COMMAND_FLAG = 0x4, + /** Voice command session is currently running. */ + VOICE_COMMAND_FLAG = 0x4, - /** Voice call is currently active. */ - CALL_FLAG = 0x8, + /** Voice call is currently active. */ + CALL_FLAG = 0x8, - /** - * Alarm is active. - * This must be only used in VehicleProperty#AUDIO_ROUTING_POLICY. - */ - ALARM_FLAG = 0x10, + /** + * Alarm is active. + * This must be only used in VehicleProperty#AUDIO_ROUTING_POLICY. + */ + ALARM_FLAG = 0x10, - /** - * Notification sound is active. - * This must be only used in VehicleProperty#AUDIO_ROUTING_POLICY. - */ - NOTIFICATION_FLAG = 0x20, + /** + * Notification sound is active. + * This must be only used in VehicleProperty#AUDIO_ROUTING_POLICY. + */ + NOTIFICATION_FLAG = 0x20, - /** - * Context unknown. Only used for VehicleProperty#AUDIO_ROUTING_POLICY to - * represent default stream for unknown contents. - */ - UNKNOWN_FLAG = 0x40, + /** + * Context unknown. Only used for VehicleProperty#AUDIO_ROUTING_POLICY to + * represent default stream for unknown contents. + */ + UNKNOWN_FLAG = 0x40, - /** Safety alert / warning is played. */ - SAFETY_ALERT_FLAG = 0x80, + /** Safety alert / warning is played. */ + SAFETY_ALERT_FLAG = 0x80, - /** CD / DVD kind of audio is played */ - CD_ROM_FLAG = 0x100, + /** CD / DVD kind of audio is played */ + CD_ROM_FLAG = 0x100, - /** Aux audio input is played */ - AUX_AUDIO_FLAG = 0x200, + /** Aux audio input is played */ + AUX_AUDIO_FLAG = 0x200, - /** system sound like UI feedback */ - SYSTEM_SOUND_FLAG = 0x400, + /** system sound like UI feedback */ + SYSTEM_SOUND_FLAG = 0x400, - /** Radio is played */ - RADIO_FLAG = 0x800, + /** Radio is played */ + RADIO_FLAG = 0x800, - /** Ext source is played. This is for tagging generic ext sources. */ - EXT_SOURCE_FLAG = 0x1000, + /** Ext source is played. This is for tagging generic ext sources. */ + EXT_SOURCE_FLAG = 0x1000, }; /** @@ -1984,65 +2231,65 @@ enum VehicleAudioContextFlag : int32_t { * used in configArray[1] of VehiclePropConfig. */ enum VehicleAudioVolumeCapabilityFlag : int32_t { - /** - * External audio module or vehicle hal has persistent storage - * to keep the volume level. This must be set only when per context - * volume level is supported. When this is set, audio volume level per - * each context will be retrieved from the property when system starts up. - * And external audio module is also expected to adjust volume automatically - * whenever there is an audio context change. - * When this flag is not set, android side will assume that there is no - * persistent storage and stored value in android side will be used to - * initialize the volume level. And android side will set volume level - * of each physical streams whenever there is an audio context change. - */ - PERSISTENT_STORAGE = 0x1, + /** + * External audio module or vehicle hal has persistent storage + * to keep the volume level. This must be set only when per context + * volume level is supported. When this is set, audio volume level per + * each context will be retrieved from the property when system starts up. + * And external audio module is also expected to adjust volume automatically + * whenever there is an audio context change. + * When this flag is not set, android side will assume that there is no + * persistent storage and stored value in android side will be used to + * initialize the volume level. And android side will set volume level + * of each physical streams whenever there is an audio context change. + */ + PERSISTENT_STORAGE = 0x1, - /** - * When this flag is set, the H/W can support only single master volume for - * all streams. - * There is no way to set volume level differently per each stream or context. - */ - MASTER_VOLUME_ONLY = 0x2, + /** + * When this flag is set, the H/W can support only single master volume for + * all streams. + * There is no way to set volume level differently per each stream or context. + */ + MASTER_VOLUME_ONLY = 0x2, }; /** * enum to represent audio volume state. */ enum VehicleAudioVolumeState : int32_t { - STATE_OK = 0, + STATE_OK = 0, - /** - * Audio volume has reached volume limit set in - * VehicleProperty#AUDIO_VOLUME_LIMIT and user's request to increase volume - * further is not allowed. - */ - LIMIT_REACHED = 1, + /** + * Audio volume has reached volume limit set in + * VehicleProperty#AUDIO_VOLUME_LIMIT and user's request to increase volume + * further is not allowed. + */ + LIMIT_REACHED = 1, }; /** * Index in int32Values for VehicleProperty#AUDIO_VOLUME property. */ enum VehicleAudioVolumeIndex : int32_t { - INDEX_STREAM = 0, - INDEX_VOLUME = 1, - INDEX_STATE = 2, + INDEX_STREAM = 0, + INDEX_VOLUME = 1, + INDEX_STATE = 2, }; /** * Index in int32Values for VehicleProperty#AUDIO_VOLUME_LIMIT property. */ enum VehicleAudioVolumeLimitIndex : int32_t { - STREAM = 0, - MAX_VOLUME = 1, + STREAM = 0, + MAX_VOLUME = 1, }; /** * Index in int32Values for VehicleProperty#AUDIO_ROUTING_POLICY property. */ enum VehicleAudioRoutingPolicyIndex : int32_t { - STREAM = 0, - CONTEXTS = 1, + STREAM = 0, + CONTEXTS = 1, }; /** @@ -2054,172 +2301,172 @@ enum VehicleAudioHwVariantConfigFlag : int32_t { * Flag to tell that radio is internal to android and radio must * be treated like other android stream like media. * When this flag is not set or AUDIO_HW_VARIANT does not exist, - * radio is treated as external module. This brins some delta in audio focus + * radio is treated as external module. This may affect audio focus * handling as well. */ INTERNAL_RADIO_FLAG = 0x1, }; enum VehicleApPowerStateConfigFlag : int32_t /* NOTE: type is guessed */ { - /** - * AP can enter deep sleep state. If not set, AP will always shutdown from - * VehicleApPowerState#SHUTDOWN_PREPARE power state. - */ - ENABLE_DEEP_SLEEP_FLAG = 0x1, + /** + * AP can enter deep sleep state. If not set, AP will always shutdown from + * VehicleApPowerState#SHUTDOWN_PREPARE power state. + */ + ENABLE_DEEP_SLEEP_FLAG = 0x1, - /** - * The power controller can power on AP from off state after timeout - * specified in VehicleApPowerSet VEHICLE_AP_POWER_SET_SHUTDOWN_READY message. - */ - CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2, + /** + * The power controller can power on AP from off state after timeout + * specified in VehicleApPowerSet VEHICLE_AP_POWER_SET_SHUTDOWN_READY message. + */ + CONFIG_SUPPORT_TIMER_POWER_ON_FLAG = 0x2, }; enum VehicleApPowerState : int32_t /* NOTE: type is guessed */ { - /** vehicle HAL will never publish this state to AP */ - OFF = 0, + /** vehicle HAL will never publish this state to AP */ + OFF = 0, - /** vehicle HAL will never publish this state to AP */ - DEEP_SLEEP = 1, + /** vehicle HAL will never publish this state to AP */ + DEEP_SLEEP = 1, - /** AP is on but display must be off. */ - ON_DISP_OFF = 2, + /** AP is on but display must be off. */ + ON_DISP_OFF = 2, - /** AP is on with display on. This state allows full user interaction. */ - ON_FULL = 3, + /** AP is on with display on. This state allows full user interaction. */ + ON_FULL = 3, - /** - * The power controller has requested AP to shutdown. AP can either enter - * sleep state or start full shutdown. AP can also request postponing - * shutdown by sending VehicleApPowerSetState#SHUTDOWN_POSTPONE message. The - * power controller must change power state to this state to shutdown - * system. - * - * int32Values[1] : one of enum_vehicle_ap_power_state_shutdown_param_type - */ - SHUTDOWN_PREPARE = 4, + /** + * The power controller has requested AP to shutdown. AP can either enter + * sleep state or start full shutdown. AP can also request postponing + * shutdown by sending VehicleApPowerSetState#SHUTDOWN_POSTPONE message. The + * power controller must change power state to this state to shutdown + * system. + * + * int32Values[1] : one of enum_vehicle_ap_power_state_shutdown_param_type + */ + SHUTDOWN_PREPARE = 4, }; enum VehicleApPowerStateShutdownParam : int32_t { - /** AP must shutdown immediately. Postponing is not allowed. */ - SHUTDOWN_IMMEDIATELY = 1, + /** AP must shutdown immediately. Postponing is not allowed. */ + SHUTDOWN_IMMEDIATELY = 1, - /** AP can enter deep sleep instead of shutting down completely. */ - CAN_SLEEP = 2, + /** AP can enter deep sleep instead of shutting down completely. */ + CAN_SLEEP = 2, - /** AP can only shutdown with postponing allowed. */ - SHUTDOWN_ONLY = 3, + /** AP can only shutdown with postponing allowed. */ + SHUTDOWN_ONLY = 3, }; enum VehicleApPowerSetState : int32_t /* NOTE: type is guessed */ { - /** - * AP has finished boot up, and can start shutdown if requested by power - * controller. - */ - BOOT_COMPLETE = 0x1, + /** + * AP has finished boot up, and can start shutdown if requested by power + * controller. + */ + BOOT_COMPLETE = 0x1, - /** - * AP is entering deep sleep state. How this state is implemented may vary - * depending on each H/W, but AP's power must be kept in this state. - */ - DEEP_SLEEP_ENTRY = 0x2, + /** + * AP is entering deep sleep state. How this state is implemented may vary + * depending on each H/W, but AP's power must be kept in this state. + */ + DEEP_SLEEP_ENTRY = 0x2, - /** - * AP is exiting from deep sleep state, and is in - * VehicleApPowerState#SHUTDOWN_PREPARE state. - * The power controller may change state to other ON states based on the - * current state. - */ - DEEP_SLEEP_EXIT = 0x3, + /** + * AP is exiting from deep sleep state, and is in + * VehicleApPowerState#SHUTDOWN_PREPARE state. + * The power controller may change state to other ON states based on the + * current state. + */ + DEEP_SLEEP_EXIT = 0x3, - /** - * int32Values[1]: Time to postpone shutdown in ms. Maximum value can be - * 5000 ms. - * If AP needs more time, it will send another POSTPONE - * message before the previous one expires. - */ - SHUTDOWN_POSTPONE = 0x4, + /** + * int32Values[1]: Time to postpone shutdown in ms. Maximum value can be + * 5000 ms. + * If AP needs more time, it will send another POSTPONE + * message before the previous one expires. + */ + SHUTDOWN_POSTPONE = 0x4, - /** - * AP is starting shutting down. When system completes shutdown, everything - * will stop in AP as kernel will stop all other contexts. It is - * responsibility of vehicle HAL or lower level to synchronize that state - * with external power controller. As an example, some kind of ping - * with timeout in power controller can be a solution. - * - * int32Values[1]: Time to turn on AP in secs. Power controller may turn on - * AP after specified time so that AP can run tasks like - * update. If it is set to 0, there is no wake up, and power - * controller may not necessarily support wake-up. If power - * controller turns on AP due to timer, it must start with - * VehicleApPowerState#ON_DISP_OFF state, and after - * receiving VehicleApPowerSetState#BOOT_COMPLETE, it shall - * do state transition to - * VehicleApPowerState#SHUTDOWN_PREPARE. - */ - SHUTDOWN_START = 0x5, + /** + * AP is starting shutting down. When system completes shutdown, everything + * will stop in AP as kernel will stop all other contexts. It is + * responsibility of vehicle HAL or lower level to synchronize that state + * with external power controller. As an example, some kind of ping + * with timeout in power controller can be a solution. + * + * int32Values[1]: Time to turn on AP in secs. Power controller may turn on + * AP after specified time so that AP can run tasks like + * update. If it is set to 0, there is no wake up, and power + * controller may not necessarily support wake-up. If power + * controller turns on AP due to timer, it must start with + * VehicleApPowerState#ON_DISP_OFF state, and after + * receiving VehicleApPowerSetState#BOOT_COMPLETE, it shall + * do state transition to + * VehicleApPowerState#SHUTDOWN_PREPARE. + */ + SHUTDOWN_START = 0x5, - /** - * User has requested to turn off headunit's display, which is detected in - * android side. - * The power controller may change the power state to - * VehicleApPowerState#ON_DISP_OFF. - */ - DISPLAY_OFF = 0x6, + /** + * User has requested to turn off headunit's display, which is detected in + * android side. + * The power controller may change the power state to + * VehicleApPowerState#ON_DISP_OFF. + */ + DISPLAY_OFF = 0x6, - /** - * User has requested to turn on headunit's display, most probably from power - * key input which is attached to headunit. The power controller may change - * the power state to VehicleApPowerState#ON_FULL. - */ - DISPLAY_ON = 0x7, + /** + * User has requested to turn on headunit's display, most probably from power + * key input which is attached to headunit. The power controller may change + * the power state to VehicleApPowerState#ON_FULL. + */ + DISPLAY_ON = 0x7, }; /** * Index in int32Values for VehicleProperty#AP_POWER_STATE property. */ enum VehicleApPowerStateIndex : int32_t { - STATE = 0, - ADDITIONAL = 1, + STATE = 0, + ADDITIONAL = 1, }; /** * Enum to represent bootup reason. */ enum VehicleApPowerBootupReason : int32_t { - /** - * Power on due to user's pressing of power key or rotating of ignition - * switch. - */ - USER_POWER_ON = 0, + /** + * Power on due to user's pressing of power key or rotating of ignition + * switch. + */ + USER_POWER_ON = 0, - /** - * Automatic power on triggered by door unlock or any other kind of automatic - * user detection. - */ - USER_UNLOCK = 1, + /** + * Automatic power on triggered by door unlock or any other kind of automatic + * user detection. + */ + USER_UNLOCK = 1, - /** - * Automatic power on triggered by timer. This only happens when AP has asked - * wake-up after - * certain time through time specified in - * VehicleApPowerSetState#SHUTDOWN_START. - */ - TIMER = 2, + /** + * Automatic power on triggered by timer. This only happens when AP has asked + * wake-up after + * certain time through time specified in + * VehicleApPowerSetState#SHUTDOWN_START. + */ + TIMER = 2, }; enum VehicleHwKeyInputAction : int32_t { - /** Key down */ - ACTION_DOWN = 0, + /** Key down */ + ACTION_DOWN = 0, - /** Key up */ - ACTION_UP = 1, + /** Key up */ + ACTION_UP = 1, }; enum VehicleDisplay : int32_t { - /** center console */ - MAIN = 0, + /** center console */ + MAIN = 0, - INSTRUMENT_CLUSTER = 1, + INSTRUMENT_CLUSTER = 1, }; /** @@ -2312,11 +2559,11 @@ enum VehiclePropertyChangeMode : int32_t { * the expected output. */ enum VehiclePropertyAccess : int32_t { - NONE = 0x00, + NONE = 0x00, - READ = 0x01, - WRITE = 0x02, - READ_WRITE = 0x03, + READ = 0x01, + WRITE = 0x02, + READ_WRITE = 0x03, }; /** @@ -2325,32 +2572,32 @@ enum VehiclePropertyAccess : int32_t { * The driving states determine what features of the UI will be accessible. */ enum VehicleDrivingStatus : int32_t { - UNRESTRICTED = 0x00, - NO_VIDEO = 0x01, - NO_KEYBOARD_INPUT = 0x02, - NO_VOICE_INPUT = 0x04, - NO_CONFIG = 0x08, - LIMIT_MESSAGE_LEN = 0x10, + UNRESTRICTED = 0x00, + NO_VIDEO = 0x01, + NO_KEYBOARD_INPUT = 0x02, + NO_VOICE_INPUT = 0x04, + NO_CONFIG = 0x08, + LIMIT_MESSAGE_LEN = 0x10, }; /** * Various gears which can be selected by user and chosen in system. */ enum VehicleGear: int32_t { - GEAR_NEUTRAL = 0x0001, - GEAR_REVERSE = 0x0002, - GEAR_PARK = 0x0004, - GEAR_DRIVE = 0x0008, - GEAR_LOW = 0x0010, - GEAR_1 = 0x0010, - GEAR_2 = 0x0020, - GEAR_3 = 0x0040, - GEAR_4 = 0x0080, - GEAR_5 = 0x0100, - GEAR_6 = 0x0200, - GEAR_7 = 0x0400, - GEAR_8 = 0x0800, - GEAR_9 = 0x1000, + GEAR_NEUTRAL = 0x0001, + GEAR_REVERSE = 0x0002, + GEAR_PARK = 0x0004, + GEAR_DRIVE = 0x0008, + GEAR_LOW = 0x0010, + GEAR_1 = 0x0010, + GEAR_2 = 0x0020, + GEAR_3 = 0x0040, + GEAR_4 = 0x0080, + GEAR_5 = 0x0100, + GEAR_6 = 0x0200, + GEAR_7 = 0x0400, + GEAR_8 = 0x0800, + GEAR_9 = 0x1000, }; /** @@ -2610,73 +2857,73 @@ enum VehiclePropertyOperation : int32_t { enum SubscribeFlags : int32_t { - UNDEFINED = 0x0, + UNDEFINED = 0x0, - /** - * Subscribe to event that was originated in vehicle HAL - * (most likely this event came from the vehicle itself). - */ - HAL_EVENT = 0x1, + /** + * Subscribe to event that was originated in vehicle HAL + * (most likely this event came from the vehicle itself). + */ + HAL_EVENT = 0x1, - /** - * Use this flag to subscribe on events when IVehicle#set(...) was called by - * vehicle HAL's client (e.g. Car Service). - */ - SET_CALL = 0x2, + /** + * Use this flag to subscribe on events when IVehicle#set(...) was called by + * vehicle HAL's client (e.g. Car Service). + */ + SET_CALL = 0x2, - DEFAULT = HAL_EVENT, + DEFAULT = HAL_EVENT, }; /** * Encapsulates information about subscription to vehicle property events. */ struct SubscribeOptions { - /** Property to subscribe */ - int32_t propId; + /** Property to subscribe */ + int32_t propId; - /** - * Area ids - this must be a bit mask of areas to subscribe or 0 to subscribe - * to all areas. - */ - int32_t vehicleAreas; + /** + * Area ids - this must be a bit mask of areas to subscribe or 0 to subscribe + * to all areas. + */ + int32_t vehicleAreas; - /** - * Sample rate in Hz. - * - * Must be provided for properties with - * VehiclePropertyChangeMode::CONTINUOUS. The value must be within - * VehiclePropConfig#minSamplingRate .. VehiclePropConfig#maxSamplingRate - * for a given property. - * This value indicates how many updates per second client wants to receive. - */ - float sampleRate; + /** + * Sample rate in Hz. + * + * Must be provided for properties with + * VehiclePropertyChangeMode::CONTINUOUS. The value must be within + * VehiclePropConfig#minSamplingRate .. VehiclePropConfig#maxSamplingRate + * for a given property. + * This value indicates how many updates per second client wants to receive. + */ + float sampleRate; - /** Flags that indicate what kind of events listen to. */ - SubscribeFlags flags; + /** Flags that indicate what kind of events listen to. */ + SubscribeFlags flags; }; /** Error codes used in vehicle HAL interface. */ enum StatusCode : int32_t { - OK = 0, + OK = 0, - /** Try again. */ - TRY_AGAIN = 1, + /** Try again. */ + TRY_AGAIN = 1, - /** Invalid argument provided. */ - INVALID_ARG = 2, + /** Invalid argument provided. */ + INVALID_ARG = 2, - /** - * This code must be returned when device that associated with the vehicle - * property is not available. For example, when client tries to set HVAC - * temperature when the whole HVAC unit is turned OFF. - */ - NOT_AVAILABLE = 3, + /** + * This code must be returned when device that associated with the vehicle + * property is not available. For example, when client tries to set HVAC + * temperature when the whole HVAC unit is turned OFF. + */ + NOT_AVAILABLE = 3, - /** Access denied */ - ACCESS_DENIED = 4, + /** Access denied */ + ACCESS_DENIED = 4, - /** Something unexpected has happened in Vehicle HAL */ - INTERNAL_ERROR = 5, + /** Something unexpected has happened in Vehicle HAL */ + INTERNAL_ERROR = 5, }; enum Wheel : int32_t { @@ -2687,3 +2934,460 @@ enum Wheel : int32_t { LEFT_REAR = 0x4, RIGHT_REAR = 0x8, }; + +/** + * 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, +}; + diff --git a/automotive/vehicle/2.1/Android.bp b/automotive/vehicle/2.1/Android.bp deleted file mode 100644 index 447c08e336..0000000000 --- a/automotive/vehicle/2.1/Android.bp +++ /dev/null @@ -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", - ], -} diff --git a/automotive/vehicle/2.1/Android.mk b/automotive/vehicle/2.1/Android.mk deleted file mode 100644 index 3001da05c4..0000000000 --- a/automotive/vehicle/2.1/Android.mk +++ /dev/null @@ -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)) diff --git a/automotive/vehicle/2.1/IVehicle.hal b/automotive/vehicle/2.1/IVehicle.hal deleted file mode 100644 index a22d1e685c..0000000000 --- a/automotive/vehicle/2.1/IVehicle.hal +++ /dev/null @@ -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 { -}; diff --git a/automotive/vehicle/2.1/default/Android.bp b/automotive/vehicle/2.1/default/Android.bp deleted file mode 100644 index f6743f261f..0000000000 --- a/automotive/vehicle/2.1/default/Android.bp +++ /dev/null @@ -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", - ], -} diff --git a/automotive/vehicle/2.1/default/android.hardware.automotive.vehicle@2.1-service.rc b/automotive/vehicle/2.1/default/android.hardware.automotive.vehicle@2.1-service.rc deleted file mode 100644 index 8929d25668..0000000000 --- a/automotive/vehicle/2.1/default/android.hardware.automotive.vehicle@2.1-service.rc +++ /dev/null @@ -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 diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultConfig.h b/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultConfig.h deleted file mode 100644 index 701317b1c9..0000000000 --- a/automotive/vehicle/2.1/default/impl/vhal_v2_1/DefaultConfig.h +++ /dev/null @@ -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 -#include - -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_ diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp b/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp deleted file mode 100644 index 568d62343d..0000000000 --- a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.cpp +++ /dev/null @@ -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 - -#include -#include -#include -#include - -#include "EmulatedVehicleHal.h" - -#define DEBUG_SOCKET (33452) - -namespace android { -namespace hardware { -namespace automotive { -namespace vehicle { -namespace V2_1 { - -namespace impl { - -static std::unique_ptr fillDefaultObd2Frame( - size_t numVendorIntegerSensors, - size_t numVendorFloatSensors) { - using V2_0::toInt; - std::unique_ptr 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(propConfig.configArray[0]), - static_cast(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(propConfig.configArray[0]), - static_cast(propConfig.configArray[1])); - - static std::vector 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 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 diff --git a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.h b/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.h deleted file mode 100644 index 7cc3b79679..0000000000 --- a/automotive/vehicle/2.1/default/impl/vhal_v2_1/EmulatedVehicleHal.h +++ /dev/null @@ -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 - -#include - -#include -#include -#include -#include - -#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_ diff --git a/automotive/vehicle/2.1/default/service.cpp b/automotive/vehicle/2.1/default/service.cpp deleted file mode 100644 index 03a0a5df16..0000000000 --- a/automotive/vehicle/2.1/default/service.cpp +++ /dev/null @@ -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 -#include - -#include - -#include - -#include -#include -#include - -#include - -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 getAllPropConfigs(getAllPropConfigs_cb _hidl_cb) override { - return mVehicle20->getAllPropConfigs(_hidl_cb); - } - - Return getPropConfigs(const hidl_vec& properties, - getPropConfigs_cb _hidl_cb) override { - return mVehicle20->getPropConfigs(properties, _hidl_cb); - } - - Return get(const V2_0::VehiclePropValue& requestedPropValue, - get_cb _hidl_cb) override { - return mVehicle20->get(requestedPropValue, _hidl_cb); - } - - Return set(const VehiclePropValue& value) override { - return mVehicle20->set(value); - } - - Return subscribe(const sp& callback, - const hidl_vec& - options) override { - return mVehicle20->subscribe(callback, options); - } - - Return unsubscribe(const sp& callback, - int32_t propId) override { - return mVehicle20->unsubscribe(callback, propId); - } - - Return 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(); - auto hal = std::make_unique(store.get()); - auto emulator = std::make_unique(hal.get()); - auto vehicleManager = std::make_unique(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; -} diff --git a/automotive/vehicle/2.1/default/tests/Obd2SensorStore_test.cpp b/automotive/vehicle/2.1/default/tests/Obd2SensorStore_test.cpp deleted file mode 100644 index a01c0f498c..0000000000 --- a/automotive/vehicle/2.1/default/tests/Obd2SensorStore_test.cpp +++ /dev/null @@ -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 - -#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 diff --git a/automotive/vehicle/2.1/types.hal b/automotive/vehicle/2.1/types.hal deleted file mode 100644 index 569e1a5510..0000000000 --- a/automotive/vehicle/2.1/types.hal +++ /dev/null @@ -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, -}; diff --git a/current.txt b/current.txt index f8cdc930b3..61e4ca8a61 100644 --- a/current.txt +++ b/current.txt @@ -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