Skip to main content

Capability

Use checkXxxCapabilities to check feature support and allowed ranges. onComplete returns per-feature support information. Return types vary by API; see the capability package for shared models. See Obtaining a domain object for how to get a domain object, and API Reference for detailed API specifications.

This documentation tree describes capability APIs that also return CapabilityConfig.

TypeDescription
CapabilityConfigPer-feature access level (AccessType: NONE, READ, WRITE, READ_WRITE)
AreaBoundsPer-area allowed value range (minValue, maxValue)
Map<Area, AreaBounds>Map of AreaBounds by area (e.g. DoorArea)

The examples below assume the Vehicle instance (vehicle) has already been initialized.

val door = vehicle.getDoor()
door.checkDoorPositionCapabilities(
onComplete = { config, areaMap ->
when (config.accessType) {
AccessType.READ, AccessType.READ_WRITE -> {
val bounds = areaMap[DoorArea(DoorValue.ROW_1_LEFT)]
// Use bounds?.minValue / bounds?.maxValue, then call getCurrentDoorPosition
}
else -> {
// NONE or WRITE only — disable UI or use an alternate flow
}
}
},
onFailed = { e: Exception ->
if (e is VehicleException) {
// Capability lookup failed: e.errorCode
}
}
)