IFoo: send struct with fmq.
authorSteven Moreland <smoreland@google.com>
Fri, 5 Oct 2018 16:42:21 +0000 (09:42 -0700)
committerSteven Moreland <smoreland@google.com>
Mon, 8 Oct 2018 20:11:34 +0000 (20:11 +0000)
Bug: 117239572
Test: hidl_test
Change-Id: I968916a9d62e1c8f7a237bd24e6b4267dd013366

tests/bar/1.0/default/Bar.cpp
tests/bar/1.0/default/Bar.h
tests/foo/1.0/IFoo.hal
tests/foo/1.0/default/Foo.cpp
tests/foo/1.0/default/Foo.h

index 46144281d7d1a98be7614810380ec6b57b7f10f4..0a57b40cf513c46563f3c0393e1c8e9a3f5952c5 100644 (file)
@@ -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);
 }
index acb976f85fc8378ebd3587c70e9d41ea1bfe9609..4372266eeb8526462ec799e4a0ff7d6d73c0faae 100644 (file)
@@ -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,
index 9642e2a8e4f9d9c8179465075b2b428fa08d96de..f54994f5dd579ba648b767f7eb671830d36912e8 100644 (file)
@@ -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);
 };
index a31ab9f011bbed9384462472a1827320d1983449..461568bb7557d1fdcae12797bb9996ded76b446c 100644 (file)
@@ -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();
 }
index 7dd672b830ca5d08f9b2132442a817414e740755..d73179a8d06fd7c26c3ab508a5b714eb99b1082d 100644 (file)
@@ -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;
 };