• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2012 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 
17 package com.android.bluetooth.btservice;
18 
19 public final class AbstractionLayer {
20     // Do not modify without updating the HAL files.
21 
22     // TODO: Some of the constants are repeated from BluetoothAdapter.java.
23     // Get rid of them and maintain just one.
24     static final int BT_STATE_OFF = 0x00;
25     static final int BT_STATE_ON = 0x01;
26 
27     static final int BT_SCAN_MODE_NONE = 0x00;
28     static final int BT_SCAN_MODE_CONNECTABLE = 0x01;
29     static final int BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE = 0x02;
30 
31     static final int BT_PROPERTY_BDNAME = 0x01;
32     static final int BT_PROPERTY_BDADDR = 0x02;
33     static final int BT_PROPERTY_UUIDS = 0x03;
34     static final int BT_PROPERTY_CLASS_OF_DEVICE = 0x04;
35     static final int BT_PROPERTY_TYPE_OF_DEVICE = 0x05;
36     static final int BT_PROPERTY_SERVICE_RECORD = 0x06;
37     static final int BT_PROPERTY_ADAPTER_SCAN_MODE = 0x07;
38     static final int BT_PROPERTY_ADAPTER_BONDED_DEVICES = 0x08;
39     static final int BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT = 0x09;
40 
41     static final int BT_PROPERTY_REMOTE_FRIENDLY_NAME = 0x0A;
42     static final int BT_PROPERTY_REMOTE_RSSI = 0x0B;
43 
44     static final int BT_PROPERTY_REMOTE_VERSION_INFO = 0x0C;
45     static final int BT_PROPERTY_LOCAL_LE_FEATURES = 0x0D;
46 
47     static final int BT_PROPERTY_DYNAMIC_AUDIO_BUFFER = 0x10;
48     static final int BT_PROPERTY_REMOTE_IS_COORDINATED_SET_MEMBER = 0x11;
49     static final int BT_PROPERTY_REMOTE_ASHA_CAPABILITY = 0X15;
50     static final int BT_PROPERTY_REMOTE_ASHA_TRUNCATED_HISYNCID = 0X16;
51     static final int BT_PROPERTY_REMOTE_MODEL_NUM = 0x17;
52 
53     public static final int BT_DEVICE_TYPE_BREDR = 0x01;
54     public static final int BT_DEVICE_TYPE_BLE = 0x02;
55     public static final int BT_DEVICE_TYPE_DUAL = 0x03;
56 
57     static final int BT_BOND_STATE_NONE = 0x00;
58     static final int BT_BOND_STATE_BONDING = 0x01;
59     static final int BT_BOND_STATE_BONDED = 0x02;
60 
61     static final int BT_SSP_VARIANT_PASSKEY_CONFIRMATION = 0x00;
62     static final int BT_SSP_VARIANT_PASSKEY_ENTRY = 0x01;
63     static final int BT_SSP_VARIANT_CONSENT = 0x02;
64     static final int BT_SSP_VARIANT_PASSKEY_NOTIFICATION = 0x03;
65 
66     static final int BT_DISCOVERY_STOPPED = 0x00;
67     static final int BT_DISCOVERY_STARTED = 0x01;
68 
69     static final int BT_ACL_STATE_CONNECTED = 0x00;
70     static final int BT_ACL_STATE_DISCONNECTED = 0x01;
71 
72     static final int BT_UUID_SIZE = 16; // bytes
73 
74     public static final int BT_STATUS_SUCCESS = 0;
75     public static final int BT_STATUS_FAIL = 1;
76     public static final int BT_STATUS_NOT_READY = 2;
77     public static final int BT_STATUS_NOMEM = 3;
78     public static final int BT_STATUS_BUSY = 4;
79     public static final int BT_STATUS_DONE = 5;
80     public static final int BT_STATUS_UNSUPPORTED = 6;
81     public static final int BT_STATUS_PARM_INVALID = 7;
82     public static final int BT_STATUS_UNHANDLED = 8;
83     public static final int BT_STATUS_AUTH_FAILURE = 9;
84     public static final int BT_STATUS_RMT_DEV_DOWN = 10;
85     public static final int BT_STATUS_AUTH_REJECTED = 11;
86     public static final int BT_STATUS_AUTH_TIMEOUT = 12;
87 }
88