Skip to main content

Capability

Use checkXxxCapabilities to check whether a feature is supported and determine its allowed range. onComplete returns feature-level support information. The return type depends on the API. For shared models, see the capability package. For obtaining a domain object, see Obtaining a domain object. For detailed API specifications, see API Reference.

This documentation tree describes capability APIs that also return CapabilityConfig.

TypeDescription
CapabilityConfigFeature-level access (AccessType: NONE, READ, WRITE, or READ_WRITE)
AreaBoundsAllowed value range for an area (minValue, maxValue)
Map<Area, AreaBounds>A map of areas, such as DoorArea, to AreaBounds

The following example assumes that 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
}
}
)