Clone this repo:
  1. 5b19e31 Merge changes Ifb3dd0aa,I9a3b823c,I9d312962,I4b708f54 by Treehugger Robot · 29 hours ago master
  2. f5cf3ce hidl-gen: tests for hashing. by Steven Moreland · 31 hours ago
  3. f46f091 c2hal_test: fixing several issues by Steven Moreland · 32 hours ago
  4. 4ff7420 hidl-gen: better error message for -r by Steven Moreland · 32 hours ago
  5. 3b1ce26 hidl-gen: Add -Lcheck. by Steven Moreland · 32 hours 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