Package-level declarations
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.
Vehicles offer a wide range of vehicle functions: comfort functions like HVAC, operational controls like window controls, and safety functions like Adaptive Cruise Control or Lane Departure Warning.
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.
Vehicle properties
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
null
Unavailable when it is temporarily unavailable or has an invalid value; the property's value will be
null
Available when it is available and has a valid value; the property's value will be non-
null
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
Types
An abstract class which needs to be extended by classes which represent a seat vehicle area.
A base class which needs to be extended by classes which represent a general vehicle area. Examples of this include:
Defines the type of a vehicle's engine.
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.
Provides the parameters of the consumption model, which is used to estimate how much energy the vehicle requires for driving.
Defines the speed/consumption-rate point of a consumption curve.
Describes the exterior dimensions of a vehicle.
A base class which needs to be extended by classes which represent a vehicle fan direction.
Defines the power states of a vehicle.
A class holding a vehicle property.
Defines a type of vehicle, commonly used for navigation purposes.
The zone is a set of VehicleArea items which a specific property is bound to.
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:
An abstract class which needs to be extended by classes which represent a window vehicle area.
Functions
Retrieve the VehicleProperty for a given VehicleArea.