Mulai 27 Maret 2025, sebaiknya gunakan android-latest-release
, bukan aosp-main
, untuk mem-build dan berkontribusi pada AOSP. Untuk mengetahui informasi selengkapnya, lihat Perubahan pada AOSP.
Antarmuka VHAL HIDL
Tetap teratur dengan koleksi
Simpan dan kategorikan konten berdasarkan preferensi Anda.
Antarmuka VHAL HIDL ditentukan di
IVehicle.hal
dan menyediakan metode ini.
Metode |
Deskripsi |
---|
getAllPropConfigs() menghasilkan
(vec<VehiclePropConfig>propConfigs);
Mencantumkan konfigurasi semua properti yang didukung oleh VHAL. CarService hanya menggunakan properti
yang didukung.
|
ongetPropConfigs(vec props) menghasilkan
(StatusCode status,vec<VehiclePropConfig> propConfigs);
Menampilkan konfigurasi properti yang dipilih.
|
set(VehiclePropValue propValue) menghasilkan
(StatusCodestatus);
Menulis nilai ke properti. Hasil penulisan ditentukan per properti.
|
subscribe(IVehicleCallback callback, vec options)
menghasilkan (StatusCode status);
Mulai memantau perubahan nilai properti.
|
unsubscribe(IVehicleCallback callback, int32_t propId)
menghasilkan (StatusCode status);
Berhenti memantau perubahan nilai properti untuk properti yang sebelumnya berlangganan.
|
HIDL VHAL menggunakan antarmuka callback ini:
Callback |
Deskripsi |
---|
oneway |
onPropertyEvent(vecpropValues);
Memberi tahu perubahan nilai properti kendaraan. Hanya berlaku untuk properti yang dilanggani.
|
oneway |
onPropertySetError(StatusCode errorCode,int32_t propId,int32_tareaId);
Menampilkan error set properti asinkron yang tidak dapat dikaitkan dengan operasi set tertentu.
|
Konten dan contoh kode di halaman ini tunduk kepada lisensi yang dijelaskan dalam Lisensi Konten. Java dan OpenJDK adalah merek dagang atau merek dagang terdaftar dari Oracle dan/atau afiliasinya.
Terakhir diperbarui pada 2025-07-26 UTC.
[[["Mudah dipahami","easyToUnderstand","thumb-up"],["Memecahkan masalah saya","solvedMyProblem","thumb-up"],["Lainnya","otherUp","thumb-up"]],[["Informasi yang saya butuhkan tidak ada","missingTheInformationINeed","thumb-down"],["Terlalu rumit/langkahnya terlalu banyak","tooComplicatedTooManySteps","thumb-down"],["Sudah usang","outOfDate","thumb-down"],["Masalah terjemahan","translationIssue","thumb-down"],["Masalah kode / contoh","samplesCodeIssue","thumb-down"],["Lainnya","otherDown","thumb-down"]],["Terakhir diperbarui pada 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. |"]]