自 2025 年 3 月 27 日起,我們建議您使用 android-latest-release
而非 aosp-main
建構及貢獻 AOSP。詳情請參閱「Android 開放原始碼計畫變更」。
HIDL VHAL 介面
透過集合功能整理內容
你可以依據偏好儲存及分類內容。
HIDL VHAL 介面是在 IVehicle.hal
中定義,並提供這些方法。
方法 |
說明 |
---|
getAllPropConfigs() 產生
(vec<VehiclePropConfig>propConfigs);
列出 VHAL 支援的所有資源設定。CarService 只會使用支援的屬性。
|
ongetPropConfigs(vec props) 產生
(StatusCode status,vec<VehiclePropConfig> propConfigs);
|
set(VehiclePropValue propValue) 產生
(StatusCodestatus);
|
subscribe(IVehicleCallback callback, vec options)
產生 (StatusCode status);
|
unsubscribe(IVehicleCallback callback, int32_t propId)
產生 (StatusCode status);
|
HIDL VHAL 會使用下列回呼介面:
回撥電話 |
說明 |
---|
oneway |
onPropertyEvent(vecpropValues);
通知車輛屬性的值變更。僅適用於已訂閱的資源。
|
oneway |
onPropertySetError(StatusCode errorCode,int32_t propId,int32_tareaId);
傳回無法與特定集合運算建立關聯的非同步屬性集合錯誤。
|
這個頁面中的內容和程式碼範例均受《內容授權》中的授權所規範。Java 與 OpenJDK 是 Oracle 和/或其關係企業的商標或註冊商標。
上次更新時間:2025-07-26 (世界標準時間)。
[[["容易理解","easyToUnderstand","thumb-up"],["確實解決了我的問題","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["缺少我需要的資訊","missingTheInformationINeed","thumb-down"],["過於複雜/步驟過多","tooComplicatedTooManySteps","thumb-down"],["過時","outOfDate","thumb-down"],["翻譯問題","translationIssue","thumb-down"],["示例/程式碼問題","samplesCodeIssue","thumb-down"],["其他","otherDown","thumb-down"]],["上次更新時間:2025-07-26 (世界標準時間)。"],[],[],null,["# HIDL VHAL interface\n\nThe HIDL VHAL interface is defined at\n[`IVehicle.hal`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/automotive/vehicle/2.0/IVehicle.hal)\nand provides these methods.\n\n| Method | Description |\n|--------|-------------|\n| `getAllPropConfigs()` **generates** `(vec\u003cVehiclePropConfig\u003epropConfigs);` Lists the configuration of all properties supported by the VHAL. CarService uses supported properties only. ||\n| `ongetPropConfigs(vec` props) **generates** `(StatusCode status,vec\u003cVehiclePropConfig\u003e propConfigs);` Returns the configuration of selected properties. ||\n| `set(VehiclePropValue propValue)` **generates** `(StatusCodestatus);` Writes a value to a property. The result of the write is defined per property. ||\n| `subscribe(IVehicleCallback callback, vec` options) **generates** `(StatusCode status);` Starts monitoring a property value change. ||\n| `unsubscribe(IVehicleCallback callback, int32_t propId)` **generates** `(StatusCode status);` Stops monitoring a property value change for a previous subscribed property. ||\n\nThe HIDL VHAL uses these callback interfaces:\n\n| Callback | Description |\n|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `oneway` | `onPropertyEvent(vec`propValues); Notifies vehicle property's value change. Apply only to subscribed properties. |\n| `oneway` | `onPropertySetError(StatusCode errorCode,int32_t propId,int32_tareaId);` Returns async property set errors that can not be associated with a specific set operation. |"]]