ตั้งแต่วันที่ 27 มีนาคม 2025 เป็นต้นไป เราขอแนะนำให้ใช้ android-latest-release
แทน aosp-main
เพื่อสร้างและมีส่วนร่วมใน AOSP โปรดดูข้อมูลเพิ่มเติมที่หัวข้อการเปลี่ยนแปลงใน AOSP
แก้ไขข้อบกพร่อง VHAL
จัดทุกอย่างให้เป็นระเบียบอยู่เสมอด้วยคอลเล็กชัน
บันทึกและจัดหมวดหมู่เนื้อหาตามค่ากำหนดของคุณ
คุณใช้วิธีการต่อไปนี้เพื่อถ่ายโอนข้อมูลการแก้ไขข้อบกพร่อง VHAL ได้ ซึ่งจะเรียกใช้เมธอด dump()
ในอินเทอร์เฟซ VHAL ซึ่งไม่ได้แสดงในอินเทอร์เฟซ แต่รับช่วงมาโดยปริยายสำหรับบริการ AIDL ทั้งหมด โดยมีอาร์กิวเมนต์เพิ่มเติมทั้งหมดที่ระบุไว้ในคําสั่ง
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default
ใช้คำสั่งต่อไปนี้เพื่อแสดงรายการคำสั่งแก้ไขข้อบกพร่องที่รองรับสำหรับ VHAL อ้างอิง
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --help
ตัวอย่างเช่น VHAL อ้างอิงรองรับการอ่านค่าพร็อพเพอร์ตี้ (เช่น INFO_VIN
) ผ่าน
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get INFO_VIN
หรือ
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get 0x11100100
หากต้องการตั้งค่าพร็อพเพอร์ตี้ ให้ใช้ --set
เช่น หากต้องการตั้งค่า SEAT_MEMORY_SELECT
ให้กับรหัสพื้นที่ ROW_1_LEFT
เป็นค่า 1
ให้ทำดังนี้
adb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --set SEAT_MEMORY_SELECT -a ROW_1_LEFT -i 1
สำหรับ HIDL VHAL ให้ใช้
adb root && adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default
นอกจากนี้ คุณยังใช้การทดสอบ VTS VtsHalAutomotiveVehicle_TargetTest
เพื่อยืนยันการติดตั้งใช้งาน VHAL ได้ด้วย ระบบจะข้ามกรณีทดสอบ useAidlBackend
หรือ useHidlBackend
หากไม่มีแบ็กเอนด์ที่เฉพาะเจาะจง นอกจากนี้ คุณยังข้ามการทดสอบบางอย่างสําหรับแบ็กเอนด์ AIDL หรือ HIDL ได้หากแบ็กเอนด์ไม่รองรับฟีเจอร์นี้
การทดสอบ VTS จะยืนยันว่าพร็อพเพอร์ตี้ระบบที่รองรับทั้งหมดมีการกําหนดค่าที่ถูกต้อง รวมถึงยืนยันการดำเนินการ VHAL พื้นฐานสำหรับพร็อพเพอร์ตี้ที่รองรับด้วย
ตัวอย่างเนื้อหาและโค้ดในหน้าเว็บนี้ขึ้นอยู่กับใบอนุญาตที่อธิบายไว้ในใบอนุญาตการใช้เนื้อหา 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,["# Debug VHAL\n\nYou can use the following instructions to dump VHAL debug information. This calls the\n`dump()` method in the VHAL interface, which isn't listed in the interface but is\nimplicitly inherited for all AIDL services, with all the additional arguments provided in the\ncommand. \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default\n```\n\nUse the following command to list the supported debug commands for the reference VHAL: \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --help\n```\n\nFor example, the reference VHAL supports reading a property value\n(such as `INFO_VIN`) through: \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get INFO_VIN\n```\nor \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --get 0x11100100\n```\n\nTo set a property value, use `--set`, for example, to set `SEAT_MEMORY_SELECT`\nfor the area ID: `ROW_1_LEFT` to value `1`: \n\n```\nadb root && adb shell dumpsys android.hardware.automotive.vehicle.IVehicle/default --set SEAT_MEMORY_SELECT -a ROW_1_LEFT -i 1\n```\n\nFor the HIDL VHAL, use: \n\n```\nadb root && adb shell lshal debug android.hardware.automotive.vehicle@2.0::IVehicle/default\n```\n\nYou can also use the VTS test,\n[`VtsHalAutomotiveVehicle_TargetTest`](https://android.googlesource.com/platform/hardware/interfaces/+/refs/heads/android16-release/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp),\nto verify your VHAL implementation. Either test case, `useAidlBackend` or\n`useHidlBackend`, is skipped if the specific backend isn't available. Some tests\ncan also be skipped for the AIDL or HIDL backend if the backend doesn't support this feature.\n\nThe VTS test verifies all supported system properties has correct configurations. It also\nverifies basic VHAL operations for supported properties."]]