Get
Use getCurrentXxx to read vehicle status and setting values. Results are delivered asynchronously via onComplete(value) / onFailed. See Obtaining a domain object for how to get a domain object, and API Reference for detailed API specifications.
The examples below assume 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;
}
);