commit | f5cc2f74e86504f7904a0a24e7fcc00fa19cd579 | [log] [tgz] |
---|---|---|
author | Yifan Hong <elsk@google.com> | Wed Jan 04 18:02:34 2017 -0800 |
committer | Yifan Hong <elsk@google.com> | Thu Jan 12 17:05:17 2017 -0800 |
tree | d1921bdd033ebe8bc7e871dd84e937ed98d989f7 | |
parent | 5202fb7533be3bf12f9d3595e854ff08549c0c6d [diff] |
Emit toString functions for all types. * toString() is mainly for debugging purposes only. * For HIDL internal types (hidl_string, hidl_vec, etc.) toString() is found in ::android::hardware::details. * For a user defined type android.hardware.foo@1.0::IFoo.Type, toString() is found in ::android::hardware::foo::V1_0. * For bitfield<::anroid::hardware::foo::V1_0::T> that gets translated to the underlying numeric type of T, it doesn't make sense to override toString(). A templated toString() function for each user-defined HIDL enum \ is introduced into the same namespace; call it with using namespace ::android::hardware::foo::V1_0; toString<IFoo::MyEnumType>(value); Test: hidl_test and look at the output of logcat Bug: 33459772 Change-Id: I70eee018e31d700bf1376334276dbd343af5615f
croot make hidl-gen
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