tree: 2ad59b2d8f2ed30985d0f7c64bcae55e1d572823 [path history] [tgz]
  1. meta/
  2. BUILD.bazel
  3. child-driver.bind
  4. child-driver.cc
  5. child-driver.h
  6. parent-driver.bind
  7. parent-driver.cc
  8. parent-driver.h
  9. README.md
  10. testfidl.fidl
  11. testlibrary.bind
src/bind_library/README.md

Bind library code generation driver sample

This project is a sample of the bind library code generation feature. It contaains two drivers, a parent and child.

The parent driver creates a child node with some properties from the bind library's generated C++ library to showcase its usage in code.

The child driver will bind to this node by specifying in its bind rules the node properties the parent driver has specified.

To run this sample you can use the QEMU emulator which can be started by following steps 1-5 from start-the-emulator.

Then you can use Bazel to run both the parent and child drivers.

Run the parent:

bazel run --config=fuchsia_x64 //src/bind_library:parent_pkg.parent_component

Confirm that the parent driver was bound to a node.

Run the child:

bazel run --config=fuchsia_x64 //src/bind_library:child_pkg.child_component

Confirm that the child driver was bound to a node.

You can check the logs of these drivers using:

ffx log --tags driver --filter universe-pkg-drivers

You should see the following logs:

[parent-driver.cc:128] Received TestingProtocol.Get request.
[child-driver.cc:46] Succeeded!