Get
Use getCurrentXxx to retrieve vehicle states and configuration values. Results are delivered asynchronously through onComplete(value) or onFailed. For obtaining a domain object, see Obtaining a domain object. For detailed API specifications, see API Reference.
The following example assumes that the Vehicle instance (vehicle) has already been initialized.
- Kotlin
- Java
val door = vehicle.getDoor()
door.getCurrentDoorPosition(
area = DoorArea(DoorValue.ROW_1_LEFT),
onComplete = { pos: Int? ->
// do something
},
onFailed = { e: Exception ->
// do something
}
)
val display = vehicle.getDisplay()
display.getCurrentTemperatureDisplayUnit(
onComplete = { unit: TemperatureUnit? ->
// do something
},
onFailed = { e: Exception ->
// do something
}
)
Door door = vehicle.getDoor();
door.getCurrentDoorPosition(
new DoorArea(DoorValue.ROW_1_LEFT),
pos -> {
// do something
return Unit.INSTANCE;
},
e -> {
// do something
return Unit.INSTANCE;
}
);
Display display = vehicle.getDisplay();
display.getCurrentTemperatureDisplayUnit(
unit -> {
// do something
return Unit.INSTANCE;
},
e -> {
// do something
return Unit.INSTANCE;
}
);