| // 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.url; |
| using fuchsia.test as test; |
| using fuchsia.test.manager as test_manager; |
| using zx; |
| |
| // This is copied from `fuchsia.sys.types`. |
| // Unfortunately we can't depend on it directly, |
| // because this protocol needs to build on the host. |
| const uint16 MAX_URL_LENGTH = 2083; |
| const uint16 MAX_NUM_MATCHES = 250; |
| |
| enum RebootType { |
| // Standard reboot. |
| REBOOT = 1; |
| // Reboots into recovery mode. |
| RECOVERY = 2; |
| // Reboots into the bootloader. |
| BOOTLOADER = 3; |
| }; |
| |
| [Discoverable] |
| protocol RemoteControl { |
| // Starts a component asynchronously. |
| StartComponent( |
| // Name of the component to start. |
| string:MAX_URL_LENGTH component_url, |
| // Arguments to pass to the component. |
| vector<string:MAX>:MAX args, |
| // stdout from the component. |
| // This would be called just 'stdout', except for fxb/42108. |
| zx.handle:SOCKET component_stdout, |
| // stderr from the component. |
| // This would be called just 'stderr', except for fxb/42108. |
| zx.handle:SOCKET component_stderr, |
| request<ComponentController> controller |
| ) -> () error ComponentControlError; |
| |
| IdentifyHost() -> (IdentifyHostResponse response) error IdentifyHostError; |
| |
| // Enumerate the test cases available in a test suite. |
| LaunchSuite( |
| fuchsia.url.Url test_url, |
| request<test.Suite> suite, |
| request<test_manager.SuiteController> controller) -> () |
| error test_manager.LaunchError; |
| |
| Connect( |
| diagnostics.Selector selector, |
| zx.handle:CHANNEL service_chan) -> () |
| error ConnectError; |
| |
| Select(diagnostics.Selector selector) |
| -> (vector<ServiceMatch>:MAX_NUM_MATCHES matches) |
| error SelectError; |
| }; |