| // Copyright 2017 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.bluetooth; |
| |
| /// DEPRECATED. Do not use these types in new code. Prefer the "error" syntax, protocol-specific |
| /// enums and zx.status instead. |
| |
| enum ErrorCode { |
| UNKNOWN = 0; |
| FAILED = 1; |
| CANCELED = 2; |
| IN_PROGRESS = 3; |
| TIMED_OUT = 4; |
| NOT_FOUND = 5; |
| NOT_SUPPORTED = 6; |
| BLUETOOTH_NOT_AVAILABLE = 7; |
| BAD_STATE = 8; |
| INVALID_ARGUMENTS = 9; |
| ALREADY = 10; |
| PROTOCOL_ERROR = 11; |
| }; |
| |
| // Represents an error result returned from an asynchronous operation. |
| struct Error { |
| // Represents a high-level error code. If this is set to ErrorCode.PROTOCOL_ERROR, then |
| // |protocol_error_code| will represent a Bluetooth protocol error code. The specific |
| // protocol that caused the error will be context-specific, e.g. GATT interfaces will |
| // return ATT protocol error codes. |
| ErrorCode error_code; |
| |
| // Protocol error code. The value of this field is relevant only if |error_code| is set to |
| // ErrorCode.PROTOCOL_ERROR. |
| uint32 protocol_error_code; |
| |
| // Debug descriptioon of an error. This provides additional debugging information for an error |
| // and is not intended to be displayed in user interfaces. |
| string? description; |
| }; |
| |
| // Represents the result of an asynchronous operation. |
| struct Status { |
| // |error| will be null if this represents a "success" status, i.e. no error has occurred. |
| Error? error; |
| }; |