You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
143 lines
4.2 KiB
143 lines
4.2 KiB
7 months ago
|
/*
|
||
|
* 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;
|
||
|
}
|
||
|
|
||
|
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;
|
||
|
}
|