VhalPropertyDelegate

class VhalPropertyDelegate<ValueType>(    vhalPropertyId: Int,     serviceProperty: KMutableProperty<ValueType?>,     valueConverter: VhalPropertyDelegate.ValueConverter<ValueType>,     sensorRateHz: Float = CarPropertyManager.SENSOR_RATE_ONCHANGE)

Maps an Android Vehicle Hardware Abstraction Layer property to a ValueType.

CarPropertyValue does not contain a valid value for the particular property.

Parameters

ValueType

A generic property type. Commonly used types are VehicleProperties subtypes or VehicleZoneProperty.

vhalPropertyId

An ID referring to the VHAL property.

serviceProperty

The property of the property service to be set to the value of the VHAL property.

valueConverter

A ValueConverter implementation that converts the parameters value, areaId and range to a ValueType.

Note: The singleBooleanConverter is an example of a simple implementation of the ValueConverter interface.

sensorRateHz

How fast the property events are delivered in Hz. See CarPropertyManager's SENSOR_RATE_* constants for common values.

Constructors

Link copied to clipboard
fun <ValueType> VhalPropertyDelegate(    vhalPropertyId: Int,     serviceProperty: KMutableProperty<ValueType?>,     valueConverter: VhalPropertyDelegate.ValueConverter<ValueType>,     sensorRateHz: Float = CarPropertyManager.SENSOR_RATE_ONCHANGE)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface ValueConverter<ValueType>

A generic interface for converting a property's VHAL information to an IVI property of type ValueType.