| // Copyright 2019 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.developer.remotecontrol; |
| |
| using fuchsia.diagnostics as diagnostics; |
| using fuchsia.io as io; |
| using zx; |
| |
| const uint16 MAX_NUM_MATCHES = 250; |
| const uint16 MAX_CONNECT_MATCHES = 5; |
| |
| enum RebootType { |
| // Standard reboot. |
| REBOOT = 1; |
| // Reboots into recovery mode. |
| RECOVERY = 2; |
| // Reboots into the bootloader. |
| BOOTLOADER = 3; |
| }; |
| |
| [Discoverable] |
| protocol RemoteControl { |
| // Connects to the Hub root directory. The server side will be connected to |
| // a fuchsia.io.Directory handle, which can then be connected to on the |
| // client side via a Directory proxy. |
| // |
| // This is, currently, a read-only view into the hub. |
| OpenHub(request<io.Directory> server) -> () error zx.status; |
| |
| IdentifyHost() -> (IdentifyHostResponse response) error IdentifyHostError; |
| |
| // Connects a channel to a service, given a selector and a channel iff the selector |
| // matches exactly one service on the system. |
| // If successful, returns information about the service connected to. |
| Connect( |
| diagnostics.Selector selector, |
| zx.handle:CHANNEL service_chan) -> (ServiceMatch match) |
| error ConnectError; |
| |
| Select(diagnostics.Selector selector) |
| -> (vector<ServiceMatch>:MAX_NUM_MATCHES matches) |
| error SelectError; |
| }; |