diff options
author | Steven Moreland <smoreland@google.com> | 2018-10-05 09:42:21 -0700 |
---|---|---|
committer | Steven Moreland <smoreland@google.com> | 2018-10-08 20:11:34 +0000 |
commit | 2b01956dac6125a54efa78b31ab52ffec50ebb8f (patch) | |
tree | ed2eb087bcd940c7ab743b3389475bec46fbde0b /tests | |
parent | 999693e4e83c71c7d84a10825d4f5101f5f2c0b1 (diff) | |
download | platform_hardware_interfaces-2b01956dac6125a54efa78b31ab52ffec50ebb8f.tar.gz platform_hardware_interfaces-2b01956dac6125a54efa78b31ab52ffec50ebb8f.tar.bz2 platform_hardware_interfaces-2b01956dac6125a54efa78b31ab52ffec50ebb8f.zip |
IFoo: send struct with fmq.
Bug: 117239572
Test: hidl_test
Change-Id: I968916a9d62e1c8f7a237bd24e6b4267dd013366
Diffstat (limited to 'tests')
-rw-r--r-- | tests/bar/1.0/default/Bar.cpp | 4 | ||||
-rw-r--r-- | tests/bar/1.0/default/Bar.h | 2 | ||||
-rw-r--r-- | tests/foo/1.0/IFoo.hal | 6 | ||||
-rw-r--r-- | tests/foo/1.0/default/Foo.cpp | 5 | ||||
-rw-r--r-- | tests/foo/1.0/default/Foo.h | 3 |
5 files changed, 20 insertions, 0 deletions
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp index 46144281d7..0a57b40cf5 100644 --- a/tests/bar/1.0/default/Bar.cpp +++ b/tests/bar/1.0/default/Bar.cpp @@ -149,6 +149,10 @@ Return<void> Bar::closeHandles() { return mFoo->closeHandles(); } +Return<void> Bar::repeatWithFmq(const IFoo::WithFmq& withFmq, repeatWithFmq_cb _hidl_cb) { + return mFoo->repeatWithFmq(withFmq, _hidl_cb); +} + Return<void> Bar::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) { return mFoo->echoNullInterface(cb, _hidl_cb); } diff --git a/tests/bar/1.0/default/Bar.h b/tests/bar/1.0/default/Bar.h index acb976f85f..4372266eeb 100644 --- a/tests/bar/1.0/default/Bar.h +++ b/tests/bar/1.0/default/Bar.h @@ -56,6 +56,8 @@ struct Bar : public IBar { virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override; virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override; virtual Return<void> closeHandles() override; + virtual Return<void> repeatWithFmq(const IFoo::WithFmq& withFmq, + repeatWithFmq_cb _hidl_cb) override; Return<void> haveAVectorOfInterfaces( const hidl_vec<sp<ISimple> > &in, diff --git a/tests/foo/1.0/IFoo.hal b/tests/foo/1.0/IFoo.hal index 9642e2a8e4..f54994f5dd 100644 --- a/tests/foo/1.0/IFoo.hal +++ b/tests/foo/1.0/IFoo.hal @@ -121,6 +121,10 @@ interface IFoo { bitfield<BitField> bf; }; + struct WithFmq { + fmq_sync<uint8_t> descSync; + }; + enum Discriminator : uint8_t { BOOL, INT, @@ -204,4 +208,6 @@ interface IFoo { createMyHandle() generates (MyHandle h); createHandles(uint32_t size) generates (vec<handle> handles); closeHandles(); + + repeatWithFmq(WithFmq withFmq) generates (WithFmq withFmq); }; diff --git a/tests/foo/1.0/default/Foo.cpp b/tests/foo/1.0/default/Foo.cpp index a31ab9f011..461568bb75 100644 --- a/tests/foo/1.0/default/Foo.cpp +++ b/tests/foo/1.0/default/Foo.cpp @@ -379,6 +379,11 @@ Return<void> Foo::echoNullInterface(const sp<IFooCallback> &cb, echoNullInterfac return Void(); } +Return<void> Foo::repeatWithFmq(const IFoo::WithFmq& withFmq, repeatWithFmq_cb _hidl_cb) { + _hidl_cb(withFmq); + return Void(); +} + IFoo* HIDL_FETCH_IFoo(const char* /* name */) { return new Foo(); } diff --git a/tests/foo/1.0/default/Foo.h b/tests/foo/1.0/default/Foo.h index 7dd672b830..d73179a8d0 100644 --- a/tests/foo/1.0/default/Foo.h +++ b/tests/foo/1.0/default/Foo.h @@ -53,6 +53,8 @@ struct Foo : public IFoo { virtual Return<void> createMyHandle(createMyHandle_cb _hidl_cb) override; virtual Return<void> createHandles(uint32_t size, createHandles_cb _hidl_cb) override; virtual Return<void> closeHandles() override; + virtual Return<void> repeatWithFmq(const IFoo::WithFmq& withFmq, + repeatWithFmq_cb _hidl_cb) override; Return<void> haveAVectorOfInterfaces( const hidl_vec<sp<ISimple> > &in, @@ -63,6 +65,7 @@ struct Foo : public IFoo { haveAVectorOfGenericInterfaces_cb _hidl_cb) override; Return<void> echoNullInterface(const sp<IFooCallback> &cb, echoNullInterface_cb _hidl_cb) override; + private: std::vector<::native_handle_t *> mHandles; }; |