| // Copyright 2026 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.testing.adb; | |
| using zx; | |
| const MAX_COMMAND_LENGTH uint32 = 2048; | |
| @discoverable | |
| open protocol Client { | |
| /// Discovers and connects to the USB endpoints. | |
| /// | |
| /// Returns `ZX_ERR_NOT_FOUND` if no compatible USB endpoints are discovered. | |
| flexible Setup() -> () error zx.Status; | |
| /// Sends a `CNXN` handshake on the USB bus and waits for response. | |
| /// | |
| /// Must be called after successful `Setup()`. | |
| /// Returns `ZX_ERR_BAD_STATE` if USB is not yet connected. | |
| flexible Connect() -> () error zx.Status; | |
| /// Executes a shell command and returns the `WRTE` payload output. | |
| flexible ExecuteCommand(struct { | |
| command string:MAX_COMMAND_LENGTH; | |
| }) -> (struct { | |
| output string:MAX; | |
| }) error zx.Status; | |
| }; |