|  | // Copyright 2020 The Fuchsia Authors. All rights reserved. | 
|  | // Use of this source code is governed by a BSD-style license that can be | 
|  | // found in the LICENSE file. | 
|  |  | 
|  | library fuchsia.driver.framework; | 
|  |  | 
|  | using fuchsia.component.runner; | 
|  | using fuchsia.data; | 
|  | using fuchsia.io; | 
|  |  | 
|  | /// Arguments for starting a driver. | 
|  | resource table DriverStartArgs { | 
|  | /// The node that the driver is being bound to. | 
|  | 1: Node node; | 
|  |  | 
|  | /// The symbols provided to the driver, for |node|. These come from the | 
|  | /// driver that added the node, and are filtered to the symbols requested | 
|  | /// in the bind program. | 
|  | 2: vector<DriverSymbol>:MAX_SYMBOL_COUNT symbols; | 
|  |  | 
|  | /// Information about the driver to start. Currently, we support the | 
|  | /// following entries: | 
|  | ///   1. "binary": a string containing the package-relative path to the | 
|  | ///      driver binary. | 
|  | ///   2. "colocate" (optional): a string containing "true" or "false" | 
|  | ///      specifying whether the driver should be colocated in the same | 
|  | ///      driver host as the driver that added |node|. If not specified, the | 
|  | ///      driver will be launched in a new driver host. | 
|  | 3: fuchsia.data.Dictionary program; | 
|  |  | 
|  | /// The incoming namespace provided to the driver. | 
|  | 4: vector<fuchsia.component.runner.ComponentNamespaceEntry>:fuchsia.component.runner.MAX_NAMESPACE_COUNT ns; | 
|  |  | 
|  | /// The outgoing directory served by the driver. | 
|  | 5: request<fuchsia.io.Directory> outgoing_dir; | 
|  | }; | 
|  |  | 
|  | /// Protocol through which a driver's lifecycle can be managed. | 
|  | /// | 
|  | /// Closing the protocol's channel is used to signal: | 
|  | ///   1. To the driver manager that the driver has stopped. | 
|  | ///   2. To the driver that it should stop. | 
|  | protocol Driver { | 
|  | }; | 
|  |  | 
|  | /// Protocol through which a driver host can be managed. | 
|  | [Discoverable] | 
|  | protocol DriverHost { | 
|  | /// Start a driver within a driver host. | 
|  | Start(DriverStartArgs start_args, request<Driver> driver); | 
|  | }; |