• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# hidl-gen
2
3Full documentation can be found here:
4<https://source.android.com/devices/architecture/hidl/>
5
6hidl-gen is a compiler for the HIDL (HAL Interface Design Language) which generates
7C++ and Java endpoints for RPC mechanisms. The main userspace libraries which this
8compiler uses can be found at system/libhidl.
9
10## 1. Build
11
12```
13m hidl-gen
14```
15
16## 2. Run
17
18Note that options for hidl-gen expected to be invoked by the build system
19are marked with 'internal' in the help menu.
20
21```
22hidl-gen -h
23
24hidl-gen -o output -L c++-impl -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0
25```
26
27Some defaults for package roots are also provided
28
29```
30hidl-gen -o output -L c++-impl android.hardware.nfc@1.0
31hidl-gen -o output -L vts android.hardware.nfc@1.0
32hidl-gen -L hash android.hardware.nfc@1.0
33```
34
35Example command for vendor project
36
37```
38hidl-gen -L c++-impl -r vendor.foo:vendor/foo/interfaces vendor.foo.nfc@1.0
39```
40
41See update-makefiles-helper.sh and update-all-google-makefiles.sh for examples
42of how to generate HIDL makefiles (using the -Landroidbp option).
43
44# c2hal
45
46This is a helper tool to convert C headers to valid .hal files.
47
48```
49m c2hal && c2hal -h
50```
51