tree: 55843ff4f4833a2726c2b7b0d209637c46b5459e [path history] [tgz]
  1. controller/
  2. driver/
  3. README.md
src/composite_sample/README.md

Composite Device Sample

This sample project contains a Fuchsia driver for a composite device node. The driver binds with multiple parent device nodes that the controller driver creates.

Building

To build the composite_sample driver and related components, run the following command:

tools/bazel build //src/composite_sample/controller:pkg
tools/bazel build //src/composite_sample/driver:pkg

Running

Use the following commands to load the driver component on a target device:

  1. Add a test node for the controller:

    tools/ffx driver test-node add controller-node examples.driver.test.property=controller
    
  2. Load the controller driver component:

    tools/bazel run //src/composite_sample/controller:pkg.component
    
  3. Open the device log viewer to confirm the test nodes were added:

    tools/ffx log --tags controller_driver
    
  4. Load the composite_sample driver component:

    tools/bazel run //src/composite_sample/driver:pkg.component
    
  5. Open the device log viewer:

    tools/ffx log --tags composite-sample
    

You should see the driver component print after the driver has successfully bound:

[composite-sample,driver][I]: [src/composite_sample/composite_sample.cc:10] Hello from the composite driver!