tree: 5fefdda4fc4ea14c3530095db3f55aa07ff90fb2 [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 --config=fuchsia_x64 //src/composite_sample/controller:pkg
tools/bazel build --config=fuchsia_x64 //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 --config=fuchsia_x64 //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 --config=fuchsia_x64 //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 the topological path of each parent device node after the driver has successfully bound:

[composite-sample,driver][I]: [src/composite_sample/composite_sample.cc:50] Topological path instance_name=acpi-GFBY path=/topo/one
[composite-sample,driver][I]: [src/composite_sample/composite_sample.cc:50] Topological path instance_name=acpi-GFRT path=/topo/two