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    ENABLE_DISABLE_REASON_FACTORY_RESET = 10;
44}
45
46enum DirectionEnum {
47    DIRECTION_UNKNOWN = 0;
48    DIRECTION_OUTGOING = 1;
49    DIRECTION_INCOMING = 2;
50}
51
52// First item is the default value, other values follow Bluetooth spec definition
53enum LinkTypeEnum {
54    // Link type is at most 1 byte (0xFF), thus 0xFFF must not be a valid value
55    LINK_TYPE_UNKNOWN = 0xFFF;
56    LINK_TYPE_SCO = 0x00;
57    LINK_TYPE_ACL = 0x01;
58    LINK_TYPE_ESCO = 0x02;
59}
60
61enum DeviceInfoSrcEnum {
62    DEVICE_INFO_SRC_UNKNOWN = 0;
63    // Within Android Bluetooth stack
64    DEVICE_INFO_INTERNAL = 1;
65    // Outside Android Bluetooth stack
66    DEVICE_INFO_EXTERNAL = 2;
67}
68
69enum DeviceTypeEnum {
70    DEVICE_TYPE_UNKNOWN = 0;
71    DEVICE_TYPE_CLASSIC = 1;
72    DEVICE_TYPE_LE = 2;
73    DEVICE_TYPE_DUAL = 3;
74}
75
76// Defined in frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
77enum TransportTypeEnum {
78    TRANSPORT_TYPE_AUTO = 0;
79    TRANSPORT_TYPE_BREDR = 1;
80    TRANSPORT_TYPE_LE = 2;
81}
82
83// Bond state enum
84// Defined in frameworks/base/core/java/android/bluetooth/BluetoothDevice.java
85enum BondStateEnum {
86    BOND_STATE_UNKNOWN = 0;
87    BOND_STATE_NONE = 10;
88    BOND_STATE_BONDING = 11;
89    BOND_STATE_BONDED = 12;
90}
91
92// Sub states within the bonding general state
93enum BondSubStateEnum {
94    BOND_SUB_STATE_UNKNOWN = 0;
95    BOND_SUB_STATE_LOCAL_OOB_DATA_PROVIDED = 1;
96    BOND_SUB_STATE_LOCAL_PIN_REQUESTED = 2;
97    BOND_SUB_STATE_LOCAL_PIN_REPLIED = 3;
98    BOND_SUB_STATE_LOCAL_SSP_REQUESTED = 4;
99    BOND_SUB_STATE_LOCAL_SSP_REPLIED = 5;
100}
101
102enum UnbondReasonEnum {
103    UNBOND_REASON_UNKNOWN = 0;
104    UNBOND_REASON_AUTH_FAILED = 1;
105    UNBOND_REASON_AUTH_REJECTED = 2;
106    UNBOND_REASON_AUTH_CANCELED = 3;
107    UNBOND_REASON_REMOTE_DEVICE_DOWN = 4;
108    UNBOND_REASON_DISCOVERY_IN_PROGRESS = 5;
109    UNBOND_REASON_AUTH_TIMEOUT = 6;
110    UNBOND_REASON_REPEATED_ATTEMPTS = 7;
111    UNBOND_REASON_REMOTE_AUTH_CANCELED = 8;
112    UNBOND_REASON_REMOVED = 9;
113}
114
115enum SocketTypeEnum {
116    SOCKET_TYPE_UNKNOWN = 0;
117    SOCKET_TYPE_RFCOMM = 1;
118    SOCKET_TYPE_SCO = 2;
119    SOCKET_TYPE_L2CAP_BREDR = 3;
120    SOCKET_TYPE_L2CAP_LE = 4;
121}
122
123enum SocketConnectionstateEnum {
124    SOCKET_CONNECTION_STATE_UNKNOWN = 0;
125    // Socket acts as a server waiting for connection
126    SOCKET_CONNECTION_STATE_LISTENING = 1;
127    // Socket acts as a client trying to connect
128    SOCKET_CONNECTION_STATE_CONNECTING = 2;
129    // Socket is connected
130    SOCKET_CONNECTION_STATE_CONNECTED = 3;
131    // Socket tries to disconnect from remote
132    SOCKET_CONNECTION_STATE_DISCONNECTING = 4;
133    // This socket is closed
134    SOCKET_CONNECTION_STATE_DISCONNECTED = 5;
135}
136
137enum SocketRoleEnum {
138    SOCKET_ROLE_UNKNOWN = 0;
139    SOCKET_ROLE_LISTEN = 1;
140    SOCKET_ROLE_CONNECTION = 2;
141}
142