This example demonstrates how to set the identification of a Fuchsia device. The device identification will be advertised via Bluetooth.
The bt-device-id-client
component relies on the fuchsia.bluetooth.deviceid.DeviceIdentification
protocol, which is implemented by the bt-device-id
component.
Add the following to your Fuchsia set configuration to include the implementing component and example.
--with //src/connectivity/bluetooth/profiles/bt-device-id --with //src/connectivity/bluetooth/examples/bt-device-id-client
Include the bt-device-id core shard in your target product configuration. For example, for the workstation configuration, add the core shard to the core_realm_shards
list in workstation.gni.
The example bt-device-id-client
is implemented as a Components Framework v2 component. Consequently, running the component requires the ffx tool.
Before running the example, update the capability route for the DeviceIdentification
protocol by adding an offer
declaration to the ffx laboratory core shard:
offer: [ { protocol: [ "fuchsia.bluetooth.deviceid.DeviceIdentification" ], from: "#bt-device-id", to: "#ffx-laboratory", }, ]
This makes the DeviceIdentification
capability accessible by components started in the ffx
realm.
To run the example:
ffx component run fuchsia-pkg://fuchsia.com/bt-device-id-client#meta/bt-device-id-client.cm