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:

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

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract class SeatArea : VehicleArea

An abstract class which needs to be extended by classes which represent a seat vehicle area.

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract class VehicleArea : Parcelable

A base class which needs to be extended by classes which represent a general vehicle area. Examples of this include:

Link copied to clipboard
data class VehicleEngineType(val id: String) : Parcelable

Defines the type of a vehicle's engine.

Link copied to clipboard
data class VehicleEvChargingConnector(val chargingStationConnectorTypes: Set<VehicleEvChargingConnector.ChargingStationConnectorType>, val electricCurrentType: VehicleEvChargingConnector.ElectricCurrentType, val maxVoltage: Voltage?, val maxCurrent: ElectricCurrent?, val maxPower: Power?, @FloatRange(from = 0.0, to = 1.0) val efficiency: Float?, val baseLoad: Power?) : Parcelable

Specifies the physical shape and electrical characteristics of a charging connector.

Link copied to clipboard
data class VehicleEvChargingCurvePoint(val batteryChargeLevel: Energy, val maxChargingPower: Power) : Parcelable

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.

Link copied to clipboard

Provides the parameters of the consumption model, which is used to estimate how much energy the vehicle requires for driving.

Link copied to clipboard
data class VehicleEvSpeedConsumption(val speed: Speed, val consumption: Force) : Parcelable

Defines the speed/consumption-rate point of a consumption curve.

Link copied to clipboard
data class VehicleExteriorDimensions(val height: Distance, val length: Distance, val width: Distance) : Parcelable

Describes the exterior dimensions of a vehicle.

Link copied to clipboard

A base class which needs to be extended by classes which represent a vehicle fan direction.

Link copied to clipboard

A class holding a vehicle property.

Link copied to clipboard
data class VehicleType(val id: String) : Parcelable

Defines a type of vehicle, commonly used for navigation purposes.

Link copied to clipboard
data class VehicleZone<A : VehicleArea>(val areas: Set<A>) : Parcelable

The zone is a set of VehicleArea items which a specific property is bound to.

Link copied to clipboard

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:

Link copied to clipboard
abstract class WindowArea : VehicleArea

An abstract class which needs to be extended by classes which represent a window vehicle area.

Link copied to clipboard

Functions

Link copied to clipboard

Retrieve the VehicleProperty for a given VehicleArea.