tree: ad777128315a58e7fa90fc9a5b08364ae64d8643 [path history] [tgz]
  1. AST.cpp
  2. AST.h
  3. Android.bp
  4. Annotation.cpp
  5. Annotation.h
  6. ArrayType.cpp
  7. ArrayType.h
  8. CleanSpec.mk
  9. CompileToggles.h
  10. CompoundType.cpp
  11. CompoundType.h
  12. ConstantExpression.cpp
  13. ConstantExpression.h
  14. Coordinator.cpp
  15. Coordinator.h
  16. DeathRecipientType.cpp
  17. DeathRecipientType.h
  18. DocComment.cpp
  19. DocComment.h
  20. EnumType.cpp
  21. EnumType.h
  22. FmqType.cpp
  23. FmqType.h
  24. HandleType.cpp
  25. HandleType.h
  26. HidlTypeAssertion.cpp
  27. HidlTypeAssertion.h
  28. Interface.cpp
  29. Interface.h
  30. Location.cpp
  31. Location.h
  32. MODULE_LICENSE_APACHE2
  33. MemoryType.cpp
  34. MemoryType.h
  35. Method.cpp
  36. Method.h
  37. NOTICE
  38. NamedType.cpp
  39. NamedType.h
  40. OWNERS
  41. PREUPLOAD.cfg
  42. PointerType.cpp
  43. PointerType.h
  44. README.md
  45. RefType.cpp
  46. RefType.h
  47. Reference.h
  48. ScalarType.cpp
  49. ScalarType.h
  50. Scope.cpp
  51. Scope.h
  52. StringType.cpp
  53. StringType.h
  54. Type.cpp
  55. Type.h
  56. TypeDef.cpp
  57. TypeDef.h
  58. VectorType.cpp
  59. VectorType.h
  60. build/
  61. c2hal/
  62. docs/
  63. generateCpp.cpp
  64. generateCppAdapter.cpp
  65. generateCppImpl.cpp
  66. generateDependencies.cpp
  67. generateJava.cpp
  68. generateVts.cpp
  69. hashing/
  70. hidl-gen_l.h
  71. hidl-gen_l.ll
  72. hidl-gen_y.yy
  73. host_utils/
  74. main.cpp
  75. scripts/
  76. test/
  77. update-all-google-makefiles.sh
  78. update-makefiles-helper.sh
  79. utils/
README.md

hidl-gen

Full documentation can be found here: https://source.android.com/devices/architecture/hidl/

hidl-gen is a compiler for the HIDL (HAL Interface Design Language) which generates C++ and Java endpoints for RPC mechanisms. The main userspace libraries which this compiler uses can be found at system/libhidl.

1. Build

m hidl-gen

2. Run

Note that options for hidl-gen expected to be invoked by the build system are marked with ‘internal’ in the help menu.

hidl-gen -h

hidl-gen -o output -L c++-impl -r android.hardware:hardware/interfaces -r android.hidl:system/libhidl/transport android.hardware.nfc@1.0

Some defaults for package roots are also provided

hidl-gen -o output -L c++-impl android.hardware.nfc@1.0
hidl-gen -o output -L vts android.hardware.nfc@1.0
hidl-gen -L hash android.hardware.nfc@1.0

Example command for vendor project

hidl-gen -L c++-impl -r vendor.foo:vendor/foo/interfaces vendor.foo.nfc@1.0

See update-makefiles-helper.sh and update-all-google-makefiles.sh for examples of how to generate HIDL makefiles (using the -Landroidbp option).

c2hal

This is a helper tool to convert C headers to valid .hal files.

m c2hal && c2hal -h

docs

This tool generates html documentation for hal interfaces.

m hidl-doc && hidl-doc -h