| // 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.developer.remotecontrol; |
| |
| using fuchsia.diagnostics as diagnostics; |
| |
| const MAX_COMPONENT_SUBDIR_LEN uint16 = 10; |
| const MAX_SERVICE_NAME_LEN uint16 = 150; |
| const MAX_MONIKER_SEGMENT_LENGTH uint16 = 100; |
| |
| type ConnectError = strict enum : uint32 { |
| // Selector did not match any services. |
| NO_MATCHING_SERVICES = 1; |
| // Selector matched multiple services. |
| MULTIPLE_MATCHING_SERVICES = 2; |
| // There was an error when trying to find matching services. |
| SERVICE_DISCOVERY_FAILED = 3; |
| // A single service was matched, but connecting to it failed. |
| SERVICE_CONNECT_FAILED = 4; |
| // Attempting to reroute the requested service via a selector map failed. |
| SERVICE_REROUTE_FAILED = 5; |
| }; |
| |
| type SelectError = strict enum : uint32 { |
| // There was an error when trying to find matching services. |
| SERVICE_DISCOVERY_FAILED = 1; |
| }; |
| |
| type ServiceMatch = struct { |
| moniker vector<string:diagnostics.MAX_STRING_SELECTOR_LENGTH>:diagnostics.MAX_MONIKER_SEGMENTS; |
| subdir string:MAX_COMPONENT_SUBDIR_LEN; |
| service string:MAX_SERVICE_NAME_LEN; |
| }; |