tree: 5aaf2aa670f5d7fdbe75342a5dd36f198d1aa138 [path history] [tgz]
  1. meta/
  2. BUILD.gn
  3. component-info.json
  4. README.md
  5. skeleton_driver.bind
  6. skeleton_driver.cc
  7. skeleton_driver.h
examples/drivers/skeleton/README.md

Skeleton Driver

Reviewed on: 2024-02-06

Skeleton driver is an minimal driver written in DFv2.

Building

To include the driver to your build, append --with //examples/drivers:drivers to your fx set command. For example:

$ fx set core.x64 --with //examples/drivers:drivers
$ fx build

Running

Register the driver by running this command

$ ffx driver register fuchsia-pkg://fuchsia.com/skeleton_driver#meta/skeleton_driver.cm

Verify that fuchsia-pkg://fuchsia.com/skeleton_driver#meta/skeleton_driver.cm shows up in the list after running this command

ffx driver list

Add a test node that binds to the driver:

$ ffx driver test-node add my_node gizmo.example.TEST_NODE_ID=skeleton_driver

Run the following command to verify that the driver is bound to the node:

$ ffx driver list-devices -v my_node

You should see something like this:

Name     : my_node
Moniker  : dev.my_node
Driver   : fuchsia-pkg://fuchsia.com/skeleton_driver#meta/skeleton_driver.cm
2 Properties
[ 1/  2] : Key "gizmo.example.TEST_NODE_ID"   Value "skeleton_driver"
[ 2/  2] : Key "fuchsia.platform.DRIVER_FRAMEWORK_VERSION" Value 0x000002
0 Offers

Source layout

The core implementation is in skeleton_driver.cc.