Clone this repo:
  1. 4f4b382 Also track imported but not referenced types if hidl-gen is running by Andreas Huber · 4 days ago master
  2. ffa2528 Adapter packages are completely static. by Steven Moreland · 6 days ago
  3. 12ff126 Add missing dependency for some libs. by Steven Moreland · 6 days ago
  4. 3ba4df6 Update makefiles for hidl_interface. by Steven Moreland · 9 days ago
  5. b8f09fe Merge changes from topic "hidl-soong-plugin" by Treehugger Robot · 8 days ago

hidl-gen user guide

1. Build

croot
make hidl-gen

2. Run

hidl-gen -o output-path -L language (-r interface-root) fqname

output-path: directory to store the output files.
language: output file for given language. e.g.c++, vts..

fqname: fully qualified name of the input files.
For singe file input, follow the format: package@version::fileName
For directory input, follow the format: package@version

interface-root(optional): prefix and root path for fqname.
If not set, use the default prefix: android.hardware and default root path
defined in $TOP.

examples:

croot
hidl-gen -o output -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0::INfc.hal
hidl-gen -o output -L vts -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0
hidl-gen -o test -L c++ -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0
hidl-gen -L hash -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0