1/* 2 * Copyright 2018 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17syntax = "proto2"; 18package android.bluetooth; 19 20option java_outer_classname = "BluetoothProtoEnums"; 21option java_multiple_files = true; 22 23// Bluetooth connection states. 24enum ConnectionStateEnum { 25 CONNECTION_STATE_DISCONNECTED = 0; 26 CONNECTION_STATE_CONNECTING = 1; 27 CONNECTION_STATE_CONNECTED = 2; 28 CONNECTION_STATE_DISCONNECTING = 3; 29} 30 31// Bluetooth Adapter Enable and Disable Reasons 32enum EnableDisableReasonEnum { 33 ENABLE_DISABLE_REASON_UNSPECIFIED = 0; 34 ENABLE_DISABLE_REASON_APPLICATION_REQUEST = 1; 35 ENABLE_DISABLE_REASON_AIRPLANE_MODE = 2; 36 ENABLE_DISABLE_REASON_DISALLOWED = 3; 37 ENABLE_DISABLE_REASON_RESTARTED = 4; 38 ENABLE_DISABLE_REASON_START_ERROR = 5; 39 ENABLE_DISABLE_REASON_SYSTEM_BOOT = 6; 40 ENABLE_DISABLE_REASON_CRASH = 7; 41 ENABLE_DISABLE_REASON_USER_SWITCH = 8; 42 ENABLE_DISABLE_REASON_RESTORE_USER_SETTING = 9; 43} 44 45enum DirectionEnum { 46 DIRECTION_UNKNOWN = 0; 47 DIRECTION_OUTGOING = 1; 48 DIRECTION_INCOMING = 2; 49} 50 51// First item is the default value, other values follow Bluetooth spec definition 52enum LinkTypeEnum { 53 // Link type is at most 1 byte (0xFF), thus 0xFFF must not be a valid value 54 LINK_TYPE_UNKNOWN = 0xFFF; 55 LINK_TYPE_SCO = 0x00; 56 LINK_TYPE_ACL = 0x01; 57 LINK_TYPE_ESCO = 0x02; 58} 59 60enum DeviceInfoSrcEnum { 61 DEVICE_INFO_SRC_UNKNOWN = 0; 62 // Within Android Bluetooth stack 63 DEVICE_INFO_INTERNAL = 1; 64 // Outside Android Bluetooth stack 65 DEVICE_INFO_EXTERNAL = 2; 66} 67 68enum DeviceTypeEnum { 69 DEVICE_TYPE_UNKNOWN = 0; 70 DEVICE_TYPE_CLASSIC = 1; 71 DEVICE_TYPE_LE = 2; 72 DEVICE_TYPE_DUAL = 3; 73} 74 75// Defined in frameworks/base/core/java/android/bluetooth/BluetoothDevice.java 76enum TransportTypeEnum { 77 TRANSPORT_TYPE_AUTO = 0; 78 TRANSPORT_TYPE_BREDR = 1; 79 TRANSPORT_TYPE_LE = 2; 80} 81 82// Bond state enum 83// Defined in frameworks/base/core/java/android/bluetooth/BluetoothDevice.java 84enum BondStateEnum { 85 BOND_STATE_UNKNOWN = 0; 86 BOND_STATE_NONE = 10; 87 BOND_STATE_BONDING = 11; 88 BOND_STATE_BONDED = 12; 89} 90 91// Sub states within the bonding general state 92enum BondSubStateEnum { 93 BOND_SUB_STATE_UNKNOWN = 0; 94 BOND_SUB_STATE_LOCAL_OOB_DATA_PROVIDED = 1; 95 BOND_SUB_STATE_LOCAL_PIN_REQUESTED = 2; 96 BOND_SUB_STATE_LOCAL_PIN_REPLIED = 3; 97 BOND_SUB_STATE_LOCAL_SSP_REQUESTED = 4; 98 BOND_SUB_STATE_LOCAL_SSP_REPLIED = 5; 99} 100 101enum UnbondReasonEnum { 102 UNBOND_REASON_UNKNOWN = 0; 103 UNBOND_REASON_AUTH_FAILED = 1; 104 UNBOND_REASON_AUTH_REJECTED = 2; 105 UNBOND_REASON_AUTH_CANCELED = 3; 106 UNBOND_REASON_REMOTE_DEVICE_DOWN = 4; 107 UNBOND_REASON_DISCOVERY_IN_PROGRESS = 5; 108 UNBOND_REASON_AUTH_TIMEOUT = 6; 109 UNBOND_REASON_REPEATED_ATTEMPTS = 7; 110 UNBOND_REASON_REMOTE_AUTH_CANCELED = 8; 111 UNBOND_REASON_REMOVED = 9; 112} 113 114enum SocketTypeEnum { 115 SOCKET_TYPE_UNKNOWN = 0; 116 SOCKET_TYPE_RFCOMM = 1; 117 SOCKET_TYPE_SCO = 2; 118 SOCKET_TYPE_L2CAP_BREDR = 3; 119 SOCKET_TYPE_L2CAP_LE = 4; 120} 121 122enum SocketConnectionstateEnum { 123 SOCKET_CONNECTION_STATE_UNKNOWN = 0; 124 // Socket acts as a server waiting for connection 125 SOCKET_CONNECTION_STATE_LISTENING = 1; 126 // Socket acts as a client trying to connect 127 SOCKET_CONNECTION_STATE_CONNECTING = 2; 128 // Socket is connected 129 SOCKET_CONNECTION_STATE_CONNECTED = 3; 130 // Socket tries to disconnect from remote 131 SOCKET_CONNECTION_STATE_DISCONNECTING = 4; 132 // This socket is closed 133 SOCKET_CONNECTION_STATE_DISCONNECTED = 5; 134} 135 136enum SocketRoleEnum { 137 SOCKET_ROLE_UNKNOWN = 0; 138 SOCKET_ROLE_LISTEN = 1; 139 SOCKET_ROLE_CONNECTION = 2; 140} 141