Kể từ ngày 27 tháng 3 năm 2025, bạn nên sử dụng android-latest-release
thay vì aosp-main
để xây dựng và đóng góp cho AOSP. Để biết thêm thông tin, hãy xem phần Thay đổi đối với AOSP.
Giao diện HIDL VHAL
Sử dụng bộ sưu tập để sắp xếp ngăn nắp các trang
Lưu và phân loại nội dung dựa trên lựa chọn ưu tiên của bạn.
Giao diện HIDL VHAL được xác định tại IVehicle.hal
và cung cấp các phương thức này.
Phương thức |
Mô tả |
---|
getAllPropConfigs() tạo
(vec<VehiclePropConfig>propConfigs);
Liệt kê cấu hình của tất cả các thuộc tính mà VHAL hỗ trợ. CarService chỉ sử dụng các thuộc tính được hỗ trợ.
|
ongetPropConfigs(vec props) tạo
(StatusCode status,vec<VehiclePropConfig> propConfigs);
Trả về cấu hình của các thuộc tính đã chọn.
|
set(VehiclePropValue propValue) tạo
(StatusCodestatus);
Ghi một giá trị vào một thuộc tính. Kết quả của thao tác ghi được xác định theo từng thuộc tính.
|
subscribe(IVehicleCallback callback, vec options)
tạo (StatusCode status);
Bắt đầu theo dõi thay đổi về giá trị thuộc tính.
|
unsubscribe(IVehicleCallback callback, int32_t propId)
tạo (StatusCode status);
Ngừng theo dõi thay đổi về giá trị thuộc tính cho một tài sản đã đăng ký trước đó.
|
HIDL VHAL sử dụng các giao diện gọi lại sau:
Lệnh gọi lại |
Mô tả |
---|
oneway |
onPropertyEvent(vecpropValues);
Thông báo về thay đổi giá trị của thuộc tính xe. Chỉ áp dụng cho các tài sản đã đăng ký.
|
oneway |
onPropertySetError(StatusCode errorCode,int32_t propId,int32_tareaId);
Trả về các lỗi tập hợp thuộc tính không đồng bộ không thể liên kết với một thao tác tập hợp cụ thể.
|
Nội dung và mã mẫu trên trang này phải tuân thủ các giấy phép như mô tả trong phần Giấy phép nội dung. Java và OpenJDK là nhãn hiệu hoặc nhãn hiệu đã đăng ký của Oracle và/hoặc đơn vị liên kết của Oracle.
Cập nhật lần gần đây nhất: 2025-07-26 UTC.
[[["Dễ hiểu","easyToUnderstand","thumb-up"],["Giúp tôi giải quyết được vấn đề","solvedMyProblem","thumb-up"],["Khác","otherUp","thumb-up"]],[["Thiếu thông tin tôi cần","missingTheInformationINeed","thumb-down"],["Quá phức tạp/quá nhiều bước","tooComplicatedTooManySteps","thumb-down"],["Đã lỗi thời","outOfDate","thumb-down"],["Vấn đề về bản dịch","translationIssue","thumb-down"],["Vấn đề về mẫu/mã","samplesCodeIssue","thumb-down"],["Khác","otherDown","thumb-down"]],["Cập nhật lần gần đây nhất: 2025-07-26 UTC."],[],[],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. |"]]