Clone this repo:
  1. aef004d Merge "Remove #include <sys/dir.h> for bionic" by Treehugger Robot · 20 hours ago master
  2. d2f4be3 Merge "Add support for relative package paths." by Treehugger Robot · 21 hours ago
  3. 80ccd1a Merge changes from topic "hidl-host-test" by Treehugger Robot · 22 hours ago
  4. 745a168 Merge "Fix typo in hidl_error_test.sh usage." by Treehugger Robot · 22 hours ago
  5. 37d2611 Better error messages for enum storage type. by Steven Moreland · 2 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