Arrays in .hal files are now exposed to C++ as hidl_array<T, SIZE ...>

instead of as native arrays. This allows them to be copied which in turn lets
them exist in vectors. In the Java backend, vectors are limited to
one-dimensional arrays and scalar arrays are properly wrapped,
i.e. vec<uint8_t[]> => Vector<Byte[]>

Change-Id: I47524ec8423dfb41a436df36af8fa05eb8b3c0cc
Bug: 31682327
Test: hidl_test and hidl_test_java
7 files changed
tree: 478d75ee43ab1b43b1302f73d8e214b8f5071039
  1. c2hal/
  2. test/
  3. utils/
  4. Android.bp
  5. Annotation.cpp
  6. Annotation.h
  7. ArrayType.cpp
  8. ArrayType.h
  9. AST.cpp
  10. AST.h
  11. CompoundType.cpp
  12. CompoundType.h
  13. ConstantExpression.cpp
  14. ConstantExpression.h
  15. Coordinator.cpp
  16. Coordinator.h
  17. EnumType.cpp
  18. EnumType.h
  19. FQName.cpp
  20. FQName.h
  21. generateCpp.cpp
  22. generateCppImpl.cpp
  23. generateJava.cpp
  24. generateVts.cpp
  25. GenericBinder.cpp
  26. GenericBinder.h
  27. HandleType.cpp
  28. HandleType.h
  29. hidl-gen_l.ll
  30. hidl-gen_y.yy
  31. Interface.cpp
  32. Interface.h
  33. main.cpp
  34. Method.cpp
  35. Method.h
  36. MODULE_LICENSE_APACHE2
  37. NamedType.cpp
  38. NamedType.h
  39. NOTICE
  40. PredefinedType.cpp
  41. PredefinedType.h
  42. README.md
  43. ScalarType.cpp
  44. ScalarType.h
  45. Scope.cpp
  46. Scope.h
  47. StringType.cpp
  48. StringType.h
  49. Type.cpp
  50. Type.h
  51. TypeDef.cpp
  52. TypeDef.h
  53. VectorType.cpp
  54. VectorType.h
README.md

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:

hidl-gen -o output -L c++ android.hardware.nfc@1.0::INfc.hal
hidl-gen -o output -L vts android.hardware.nfc@1.0
hidl-gen -o test -L c++ -r android.hardware:/home/android/master/hardware/interfaces android.hardware.nfc@1.0