tomtom. ivi. platform. vehiclefunctions. api. common. vehiclefunctions
This package contains the classes to communicate with a vehicle's properties, via the Android Car service. We provide these classes to make communicating with Android Car via LiveData easier, as TomTom Digital Cockpit uses LiveData extensively throughout its codebase.
Not only the type of vehicle functions differ per vehicle and manufacturer, also the interfaces to access those vehicle functions vary from CAN to MOST to Ethernet. To enable TomTom Digital Cockpit's services and apps to access those lower level vehicle functions in a consistent and uniform way, TomTom Digital Cockpit provides the means to abstract their access.
The vehicle function values are accessed via the VehicleProperties class. It has inner classes, each derived from VehicleProperty, for different types of vehicle properties:
VehicleProperties.BooleanProperty for boolean values
VehicleProperties.ListProperty for properties that contain multiple values
VehicleProperties.NumberProperty for integer and floating point values
VehicleProperties.RangedProperty for numerical values that operate inside a certain range
VehicleProperties.RestrictedSetProperty for a set of values, of which only certain combinations are allowed
VehicleProperties.SetProperty for sets of multiple values
A vehicle property may or may not always be available. A vehicle platform may not possess a property, or perhaps the sensor for that property is malfunctioning. Services that pass these property values to frontends therefore need to adhere to a protocol. A vehicle property is considered:
Unsupported when it is not supported by the vehicle platform; the property will have the value
Unavailable when it is temporarily unavailable or has an invalid value; the property's value will be
Available when it is available and has a valid value; the property's value will be non-
Zones and areas
Vehicle properties may belong to an area of the vehicle, like SeatArea or WindowArea. This means that a property may have multiple values, one for each zone in that area; see VehicleZoneProperty. For example, the SeatArea can be zoned using any combination of:
You can use one of these to get a property value of the left side of the vehicle by writing:
val hasPropertyOnLeftSide: Boolean = vehicleZoneProperty.isAreaSupported(FirstRowLeftSeatArea)
val propertyOnLeftSide: VehicleProperty = vehicleZoneProperty.getPropertyForArea(FirstRowLeftSeatArea)
val valueOnLeftSide = propertyOnLeftSide?.value
Specifies the physical shape and electrical characteristics of a charging connector.
Represents a point in the charging curve of a battery. The charging curve shows the charge power depending on how full the battery is. Typically when the battery's charge level is nearly empty it charges quickly, and when it's nearly full, slowly. The charging curve is expressed by a sequence of these points.
A zone property is used for VehicleProperty instances which are bound to vehicle area zones. The zone property can be in one of 4 states: