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