VEHICLE_CAPABILITIES
The closed enum of vehicle / hardware capabilities every mini-app declares + every host emits. Bit positions are frozen across SDK + Dart + Kotlin + Python.
The canonical list of capability strings — the union of every hardware feature a mini-app might depend on, mirrored across all four languages of the platform (TypeScript SDK, Dart host UI, Kotlin host native, Python backend).
Why an array, not an enum?
The list is order-sensitive: each entry's index is its bit
position in the packed capabilityBits
integer. Reordering the array would silently change the meaning of
every bitmask currently persisted in:
- The backend's
vehicle_capabilities.capability_bitsBIGINT column - Every cached host snapshot
A CI drift check (scripts/check-capability-drift.mjs) fails the SDK
PR if the four mirrors disagree on order or content.
The list
| Bit | String | Meaning | Default state |
|---|---|---|---|
| 0 | display.read | Enumerate displays via display.list + receive hot-plug events. | All BYD trims. |
| 1 | pkg.read | Enumerate installed packages via pkg.list. | All BYD trims. |
| 2 | pkg.launch.ivi | Launch a package on the IVI (default) display. | All trims. |
| 3 | pkg.launch.passenger | Launch a package on the passenger panel. Routed via am start --display N on Di5.1, via DiShare cast on Di5.0. | Di5.1 trims (L8, L5L); Di5.0 trims via DiShare. |
| 4 | pkg.launch.cluster.pixel | Launch a package on the instrument cluster with full pixel control. | L8, L5L only. |
| 5 | pkg.launch.cluster.icons | Toggle cluster icons / themes via the MCU mux (IAutoContainer.sendInfo) — no pixel control. | L5 family (L5, L5U, L5L). |
| 6 | pkg.launch.dishare | Use BYD's DiShare mirror chain to cast to the passenger panel. | Di5.0 trims (L5, L5U) where direct am start --display N is silently dropped. |
| 7 | surface.write.ivi | Render a host-managed WebView surface on the IVI. | All trims. |
| 8 | surface.write.passenger | Same on the passenger panel. Not included in DiShare cars (DiShare casts an existing activity, can't host the WebView surface). | Di5.1 trims with showFission2. |
| 9 | surface.write.cluster | Render on the cluster (paired with pkg.launch.cluster.pixel). | L8, L5L only. |
| 10 | cursor.write | Inject a synthetic cursor on a non-default display. Requires the host's a11y bridge. | All trims (a11y granted by AdbBootstrap). |
| 11 | gesture.dispatch | Dispatch synthetic taps / swipes / long-presses via the a11y bridge. | All trims. |
| 12 | ac.get | Read AC state (power, fan, temperature, mode). | All BYD trims (every trim ships byd_airconditioning). |
| 13 | ac.set | Write AC state. | All BYD trims. |
| 14 | door.set | Lock / unlock / open doors. | All BYD trims. |
| 15 | window.set | Move power windows. | All BYD trims. |
Bit position is VEHICLE_CAPABILITIES.indexOf(cap) — the SDK
helper bitsFromCapabilities
does the conversion for you.
Adding a new capability
The list is append-only. To add a new capability:
- Append the string to
VEHICLE_CAPABILITIESinsrc/types/vehicle-capabilities.ts(this SDK). - Append the same string to all three mirror files:
car-i99dash/lib/core/car/vehicle_capability.dartcar-i99dash/android/.../car/VehicleCapability.ktbackend-i99dash/app/domain/vehicle_capabilities/constants.py
- Run
node scripts/check-capability-drift.mjs— it'll reject the PR if any mirror is missing or out of order. - Update the relevant per-trim entry in the static seed
(
CarProfileSeed.kt) when applicable. - Bump the SDK minor version.
Removing or renaming a capability is not supported — every persisted bitmask carries the historical position. If a feature truly disappears, leave the slot reserved with a deprecated marker in the source comment and stop seeding it.
Bit-budget headroom
Bits 0–30 are usable on the SDK wire (JS bitwise ops are signed
32-bit). The host stores the bitmask as a Java Long (64-bit) and
the backend as BIGINT, so the bottleneck is the SDK. We're at 16
of 31 today. When you cross 25, plan the wire migration to a
length-prefixed bit string before you cross 31.
Type signature
Prop
Type
Source
- Import:
import { VEHICLE_CAPABILITIES } from 'i99dash' - Subpath:
types - File:
src/types/vehicle-capabilities.ts
Related
bitsFromCapabilities— pack a capability list into a bitmask.capabilitiesFromBits— inverse decode.hasAllCapabilities— subset check (one AND).VehicleCapabilitiesSnapshot— wire shape.- Vehicle profile concept — the full model.
- Trim × capability matrix — what's seeded per trim.