| /* |
| * Copyright 2018 The Android Open Source Project |
| * |
| * Licensed under the Apache License, Version 2.0 (the "License"); |
| * you may not use this file except in compliance with the License. |
| * You may obtain a copy of the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| * See the License for the specific language governing permissions and |
| * limitations under the License. |
| */ |
| |
| syntax = "proto2"; |
| package android.bluetooth; |
| |
| option java_outer_classname = "BluetoothProtoEnums"; |
| option java_multiple_files = true; |
| |
| // Bluetooth connection states. |
| enum ConnectionStateEnum { |
| CONNECTION_STATE_DISCONNECTED = 0; |
| CONNECTION_STATE_CONNECTING = 1; |
| CONNECTION_STATE_CONNECTED = 2; |
| CONNECTION_STATE_DISCONNECTING = 3; |
| } |
| |
| // Bluetooth Adapter Enable and Disable Reasons |
| enum EnableDisableReasonEnum { |
| ENABLE_DISABLE_REASON_UNSPECIFIED = 0; |
| ENABLE_DISABLE_REASON_APPLICATION_REQUEST = 1; |
| ENABLE_DISABLE_REASON_AIRPLANE_MODE = 2; |
| ENABLE_DISABLE_REASON_DISALLOWED = 3; |
| ENABLE_DISABLE_REASON_RESTARTED = 4; |
| ENABLE_DISABLE_REASON_START_ERROR = 5; |
| ENABLE_DISABLE_REASON_SYSTEM_BOOT = 6; |
| ENABLE_DISABLE_REASON_CRASH = 7; |
| ENABLE_DISABLE_REASON_USER_SWITCH = 8; |
| ENABLE_DISABLE_REASON_RESTORE_USER_SETTING = 9; |
| ENABLE_DISABLE_REASON_FACTORY_RESET = 10; |
| ENABLE_DISABLE_REASON_INIT_FLAGS_CHANGED = 11; |
| } |
| |
| enum DirectionEnum { |
| DIRECTION_UNKNOWN = 0; |
| DIRECTION_OUTGOING = 1; |
| DIRECTION_INCOMING = 2; |
| } |
| |
| // First item is the default value, other values follow Bluetooth spec definition |
| enum LinkTypeEnum { |
| // Link type is at most 1 byte (0xFF), thus 0xFFF must not be a valid value |
| LINK_TYPE_UNKNOWN = 0xFFF; |
| LINK_TYPE_SCO = 0x00; |
| LINK_TYPE_ACL = 0x01; |
| LINK_TYPE_ESCO = 0x02; |
| } |
| |
| enum DeviceInfoSrcEnum { |
| DEVICE_INFO_SRC_UNKNOWN = 0; |
| // Within Android Bluetooth stack |
| DEVICE_INFO_INTERNAL = 1; |
| // Outside Android Bluetooth stack |
| DEVICE_INFO_EXTERNAL = 2; |
| } |
| |
| enum DeviceTypeEnum { |
| DEVICE_TYPE_UNKNOWN = 0; |
| DEVICE_TYPE_CLASSIC = 1; |
| DEVICE_TYPE_LE = 2; |
| DEVICE_TYPE_DUAL = 3; |
| } |
| |
| // Defined in frameworks/base/core/java/android/bluetooth/BluetoothDevice.java |
| enum TransportTypeEnum { |
| TRANSPORT_TYPE_AUTO = 0; |
| TRANSPORT_TYPE_BREDR = 1; |
| TRANSPORT_TYPE_LE = 2; |
| } |
| |
| // Bond state enum |
| // Defined in frameworks/base/core/java/android/bluetooth/BluetoothDevice.java |
| enum BondStateEnum { |
| BOND_STATE_UNKNOWN = 0; |
| BOND_STATE_NONE = 10; |
| BOND_STATE_BONDING = 11; |
| BOND_STATE_BONDED = 12; |
| } |
| |
| // Sub states within the bonding general state |
| enum BondSubStateEnum { |
| BOND_SUB_STATE_UNKNOWN = 0; |
| BOND_SUB_STATE_LOCAL_OOB_DATA_PROVIDED = 1; |
| BOND_SUB_STATE_LOCAL_PIN_REQUESTED = 2; |
| BOND_SUB_STATE_LOCAL_PIN_REPLIED = 3; |
| BOND_SUB_STATE_LOCAL_SSP_REQUESTED = 4; |
| BOND_SUB_STATE_LOCAL_SSP_REPLIED = 5; |
| BOND_SUB_STATE_LOCAL_BOND_STATE_INTENT_SENT = 6; |
| } |
| |
| enum UnbondReasonEnum { |
| UNBOND_REASON_UNKNOWN = 0; |
| UNBOND_REASON_AUTH_FAILED = 1; |
| UNBOND_REASON_AUTH_REJECTED = 2; |
| UNBOND_REASON_AUTH_CANCELED = 3; |
| UNBOND_REASON_REMOTE_DEVICE_DOWN = 4; |
| UNBOND_REASON_DISCOVERY_IN_PROGRESS = 5; |
| UNBOND_REASON_AUTH_TIMEOUT = 6; |
| UNBOND_REASON_REPEATED_ATTEMPTS = 7; |
| UNBOND_REASON_REMOTE_AUTH_CANCELED = 8; |
| UNBOND_REASON_REMOVED = 9; |
| } |
| |
| enum SocketTypeEnum { |
| SOCKET_TYPE_UNKNOWN = 0; |
| SOCKET_TYPE_RFCOMM = 1; |
| SOCKET_TYPE_SCO = 2; |
| SOCKET_TYPE_L2CAP_BREDR = 3; |
| SOCKET_TYPE_L2CAP_LE = 4; |
| } |
| |
| enum SocketConnectionstateEnum { |
| SOCKET_CONNECTION_STATE_UNKNOWN = 0; |
| // Socket acts as a server waiting for connection |
| SOCKET_CONNECTION_STATE_LISTENING = 1; |
| // Socket acts as a client trying to connect |
| SOCKET_CONNECTION_STATE_CONNECTING = 2; |
| // Socket is connected |
| SOCKET_CONNECTION_STATE_CONNECTED = 3; |
| // Socket tries to disconnect from remote |
| SOCKET_CONNECTION_STATE_DISCONNECTING = 4; |
| // This socket is closed |
| SOCKET_CONNECTION_STATE_DISCONNECTED = 5; |
| } |
| |
| enum SocketRoleEnum { |
| SOCKET_ROLE_UNKNOWN = 0; |
| SOCKET_ROLE_LISTEN = 1; |
| SOCKET_ROLE_CONNECTION = 2; |
| } |
| |
| enum CodePathCounterKeyEnum { |
| KEY_UNKNOWN = 0; |
| // Reserver smaller counters for very important bt features |
| |
| // [100,000 - 120,000) profile connection related |
| |
| // [100,000 - 100,100) L2CAP |
| L2CAP_SUCCESS = 100000; |
| L2CAP_CONNECT_CONFIRM_NEG= 100001; |
| L2CAP_NO_COMPATIBLE_CHANNEL_AT_CSM_CLOSED = 100002; |
| L2CAP_SECURITY_NEG_AT_CSM_CLOSED= 100003; |
| L2CAP_TIMEOUT_AT_CSM_CLOSED = 100004; |
| L2CAP_CREDIT_BASED_CONNECT_RSP_NEG = 100005; |
| L2CAP_CONNECT_RSP_NEG = 100006; |
| L2CAP_INFO_NO_COMPATIBLE_CHANNEL_AT_RSP = 100007; |
| L2CAP_CONFIG_REQ_FAILURE = 100008; |
| L2CAP_CONFIG_RSP_NEG = 100009; |
| L2CAP_NO_COMPATIBLE_CHANNEL_AT_W4_SEC = 100010; |
| L2CAP_SECURITY_NEG_AT_W4_SEC= 100011; |
| L2CAP_TIMEOUT_AT_CONNECT_RSP = 100012; |
| L2CAP_CONN_OTHER_ERROR_AT_CONNECT_RSP = 100013; |
| |
| // [100,100 - 100,200) SDP |
| SDP_SUCCESS = 100100; |
| SDP_FAILURE = 100101; |
| |
| // [101,000 - 102,000) HFP |
| |
| // [101,000 - 101,100) RFCOMM |
| RFCOMM_CONNECTION_SUCCESS_IND = 101000; |
| RFCOMM_CONNECTION_SUCCESS_CNF = 101001; |
| RFCOMM_PORT_START_CNF_FAILED = 101002; |
| RFCOMM_PORT_START_CLOSE = 101003; |
| RFCOMM_PORT_START_FAILED = 101004; |
| RFCOMM_PORT_NEG_FAILED = 101005; |
| RFCOMM_PORT_CLOSED = 101006; |
| RFCOMM_PORT_PEER_CONNECTION_FAILED = 101007; |
| RFCOMM_PORT_PEER_TIMEOUT = 101008; |
| |
| // [101,100 - 101,200) HFP (btif) |
| |
| // [102,000 - 103,000) A2DP |
| A2DP_CONNECTION_SUCCESS = 102000; |
| A2DP_CONNECTION_ACL_DISCONNECTED = 102001; |
| A2DP_CONNECTION_REJECT_EVT = 102002; |
| A2DP_CONNECTION_FAILURE = 102003; |
| A2DP_CONNECTION_UNKNOWN_EVENT = 102004; |
| A2DP_ALREADY_CONNECTING = 102005; |
| A2DP_OFFLOAD_START_REQ_FAILURE = 102006; |
| A2DP_CONNECTION_CLOSE = 102007; |
| A2DP_CONNECTION_DISCONNECTED = 102008; |
| A2DP_CONNECTION_TIMEOUT = 102009; |
| |
| } |
| |
| enum AddressTypeEnum { |
| ADDRESS_TYPE_PUBLIC = 0; |
| ADDRESS_TYPE_RANDOM = 1; |
| ADDRESS_TYPE_UNKNOWN = 0xFFFF; |
| } |
| |