Package com.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.

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
object FaceFanDirection : VehicleFanDirection
Link copied to clipboard
object FirstRoofTopWindowArea : WindowArea
Link copied to clipboard
object FirstRowCenterSeatArea : SeatArea
Link copied to clipboard
object FirstRowLeftSeatArea : SeatArea
Link copied to clipboard
object FirstRowLeftWindowArea : WindowArea
Link copied to clipboard
object FirstRowRightSeatArea : SeatArea
Link copied to clipboard
object FirstRowRightWindowArea : WindowArea
Link copied to clipboard
object FloorFanDirection : VehicleFanDirection
Link copied to clipboard
object FrontWindowArea : WindowArea
Link copied to clipboard
object RearWindowArea : WindowArea
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
object SecondRoofTopWindowArea : WindowArea
Link copied to clipboard
object SecondRowCenterSeatArea : SeatArea
Link copied to clipboard
object SecondRowLeftSeatArea : SeatArea
Link copied to clipboard
object SecondRowLeftWindowArea : WindowArea
Link copied to clipboard
object SecondRowRightSeatArea : SeatArea
Link copied to clipboard
object SecondRowRightWindowArea : WindowArea
Link copied to clipboard
object ThirdRowCenterSeatArea : SeatArea
Link copied to clipboard
object ThirdRowLeftSeatArea : SeatArea
Link copied to clipboard
object ThirdRowLeftWindowArea : WindowArea
Link copied to clipboard
object ThirdRowRightSeatArea : SeatArea
Link copied to clipboard
object ThirdRowRightWindowArea : WindowArea
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
data class VehicleEvConsumptionModel(val consumptionCurve: Set<VehicleEvSpeedConsumption>?) : Parcelable

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
abstract class VehicleFanDirection : Parcelable

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

Link copied to clipboard
class VehicleProperties

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
data class VehicleZoneProperty<A : VehicleArea, T : VehicleProperties.VehicleProperty<*>>(val zoneProperties: Map<VehicleZone<A>, T>) : Parcelable

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
object WindowFanDirection : VehicleFanDirection

Functions

Link copied to clipboard
operator fun <A : VehicleArea, T : VehicleProperties.VehicleProperty<*>> Map<VehicleZone<A>, T>.get(area: VehicleArea): T?

Retrieve the VehicleProperty for a given VehicleArea.