Package com.tomtom.ivi.platform.vehiclefunctions.api.service.vehiclehvac

This package contains the VehicleHvacService interface which provides access to state information coming from the vehicle heating, ventilation and air conditioning (HVAC) controls.

Vehicle heating, ventilation and air conditioning service

The HVAC service is an IVI service. It is responsible for providing access to state information coming from vehicle heating, ventilation and air conditioning controls. The Android vehicle hardware abstraction layer (VHAL) is used to determine the state of the provided controls.

Using vehicle heating, ventilation and air conditioning service API

To use the vehicle heating, ventilation and air conditioning service, add a dependency to the VehicleHvacService to your gradle file:

dependencies {
implementation("com.tomtom.ivi.platform:platform_vehiclefunctions_api_service_vehiclehvac")
}

To get access to the VehicleHvacService API, you need to first get a VehicleHvacServiceApi instance by calling the companion function VehicleHvacService.createApi(...).

val vehicleHvacService = VehicleHvacService.createApi(lifecycleOwner, iviServiceProvider)

Once you have the VehicleHvacServiceApi instance, you can use it to interact with the service API, and observe any property provided by the service.

val isAirConditionerAvailable = vehicleHvacService.isAirConditionerOn.map { vehicleProperty ->
when {
vehicleProperty == null -> false // Property is not supported
vehicleProperty.value == null -> false // Property is supported but not available
else -> true // Property is supported and available
}
}

Note: The service may not be ready when a client calls the service API. Check the service availability by observing the serviceAvailable property:

vehicleHvacService.serviceAvailable.observe(lifecycleOwner) {
if (it) {
// Service is available
} else {
// Service is not available
}
}

Types

Link copied to clipboard
interface VehicleHvacService

The VehicleHvacService interface provides access to state information coming from the vehicle Heating Ventilation and Air Conditioning (HVAC) controls via properties and exposes methods to update the values of the HVAC controls.