From 2b01956dac6125a54efa78b31ab52ffec50ebb8f Mon Sep 17 00:00:00 2001 From: Steven Moreland Date: Fri, 5 Oct 2018 09:42:21 -0700 Subject: [PATCH] IFoo: send struct with fmq. Bug: 117239572 Test: hidl_test Change-Id: I968916a9d62e1c8f7a237bd24e6b4267dd013366 --- tests/bar/1.0/default/Bar.cpp | 4 ++++ tests/bar/1.0/default/Bar.h | 2 ++ tests/foo/1.0/IFoo.hal | 6 ++++++ tests/foo/1.0/default/Foo.cpp | 5 +++++ tests/foo/1.0/default/Foo.h | 3 +++ 5 files changed, 20 insertions(+) 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 Bar::closeHandles() { return mFoo->closeHandles(); } +Return Bar::repeatWithFmq(const IFoo::WithFmq& withFmq, repeatWithFmq_cb _hidl_cb) { + return mFoo->repeatWithFmq(withFmq, _hidl_cb); +} + Return Bar::echoNullInterface(const sp &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 createMyHandle(createMyHandle_cb _hidl_cb) override; virtual Return createHandles(uint32_t size, createHandles_cb _hidl_cb) override; virtual Return closeHandles() override; + virtual Return repeatWithFmq(const IFoo::WithFmq& withFmq, + repeatWithFmq_cb _hidl_cb) override; Return haveAVectorOfInterfaces( const hidl_vec > &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 bf; }; + struct WithFmq { + fmq_sync descSync; + }; + enum Discriminator : uint8_t { BOOL, INT, @@ -204,4 +208,6 @@ interface IFoo { createMyHandle() generates (MyHandle h); createHandles(uint32_t size) generates (vec 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 Foo::echoNullInterface(const sp &cb, echoNullInterfac return Void(); } +Return 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 createMyHandle(createMyHandle_cb _hidl_cb) override; virtual Return createHandles(uint32_t size, createHandles_cb _hidl_cb) override; virtual Return closeHandles() override; + virtual Return repeatWithFmq(const IFoo::WithFmq& withFmq, + repeatWithFmq_cb _hidl_cb) override; Return haveAVectorOfInterfaces( const hidl_vec > &in, @@ -63,6 +65,7 @@ struct Foo : public IFoo { haveAVectorOfGenericInterfaces_cb _hidl_cb) override; Return echoNullInterface(const sp &cb, echoNullInterface_cb _hidl_cb) override; + private: std::vector<::native_handle_t *> mHandles; };