ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
อินเทอร์เฟซ 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 UTC
[[["เข้าใจง่าย","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 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. |"]]