• 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> **_NOTE:_**  When using the -Landroidbp option, you can force generated
45> modules to be installed in `/system_ext` rather than other partition by putting a
46> marker file `.hidl_for_system_ext` alongside `*.hal` files.
47
48> **_NOTE:_**  You can also install the vendor variant of the generated modules
49> to be installed in `/odm` rather than `/vendor` by putting a marker file
50> `.hidl_for_odm` alongside `*.hal` files.
51
52# c2hal
53
54This is a helper tool to convert C headers to valid .hal files.
55
56```
57m c2hal && c2hal -h
58```
59