commit | ac816ff50a1fc29894ca815f1af9ce6decdf840f | [log] [tgz] |
---|---|---|
author | Steven Moreland <smoreland@google.com> | Mon Dec 09 15:29:13 2019 -0800 |
committer | Steven Moreland <smoreland@google.com> | Mon Dec 09 23:58:39 2019 +0000 |
tree | 3dcc9c6c22e3843d1668f91493f19c5ea2aa0601 | |
parent | 4a385ed6b8c637c832cc351af43077a525633abb [diff] |
c++-impl: remove version from namespace When people explicitly specify versions in their interfaces, it makes it much easier to update later. It's quite problematic when people have "Foo" (meaning V1_0::Foo) and then this type is moved into a new namespace (then Foo has to be found and changed to V1_0::Foo). However, if people refer to V1_0::Foo from the start, they can immediately start referring to V1_1::Foo in the future. Currently, it seems types' full namespaces are output (e.g. we have sp<android::hardware::foo::V1_0::INfc> in the output). Ideally this would be sp<V1_0::INfc> only, but more refactoring would be required to implement this (this has been the case since e30ee9b06ac578006161e84633db91289f889068). Fixes: 145814082 Test: ./test/run_all_host_tests.sh Change-Id: Ic8b4a1e2b5b2ea52a65e9b88699b9ca158378d00
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.
m hidl-gen
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).
This is a helper tool to convert C headers to valid .hal files.
m c2hal && c2hal -h