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