Clone this repo:
  1. 06a81cf Get imported packages based on granular names. by Steven Moreland · 2 days ago master
  2. c231fc4 Merge "Add libbase dependency to hidl adapters." by Treehugger Robot · 2 weeks ago
  3. 0d93b14 Error if hidl-gen args override each other. by Steven Moreland · 2 weeks ago
  4. e56a217 Merge changes Ia29c8ae4,I8ca07335 by Treehugger Robot · 2 weeks ago
  5. 31195f2 Merge "Add implementors notes to -Landroidbp-impl" by Treehugger Robot · 2 weeks 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