/* * Copyright (C) 2012 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. */ package com.android.bluetooth.btservice; /* * @hide */ final public class AbstractionLayer { // Do not modify without upating the HAL files. // TODO: Some of the constants are repeated from BluetoothAdapter.java. // Get rid of them and maintain just one. static final int BT_STATE_OFF = 0x00; static final int BT_STATE_ON = 0x01; static final int BT_SCAN_MODE_NONE = 0x00; static final int BT_SCAN_MODE_CONNECTABLE = 0x01; static final int BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE = 0x02; static final int BLE_ADV_MODE_NONE = 0x00; static final int BLE_ADV_IND_GENERAL_CONNECTABLE = 0x01; static final int BLE_ADV_IND_LIMITED_CONNECTABLE = 0x02; static final int BLE_ADV_DIR_CONNECTABLE = 0x03; static final int BT_PROPERTY_BDNAME = 0x01; static final int BT_PROPERTY_BDADDR = 0x02; static final int BT_PROPERTY_UUIDS = 0x03; static final int BT_PROPERTY_CLASS_OF_DEVICE = 0x04; static final int BT_PROPERTY_TYPE_OF_DEVICE = 0x05; static final int BT_PROPERTY_SERVICE_RECORD = 0x06; static final int BT_PROPERTY_ADAPTER_SCAN_MODE = 0x07; static final int BT_PROPERTY_ADAPTER_BONDED_DEVICES = 0x08; static final int BT_PROPERTY_ADAPTER_DISCOVERABLE_TIMEOUT = 0x09; static final int BT_PROPERTY_REMOTE_FRIENDLY_NAME = 0x0A; static final int BT_PROPERTY_REMOTE_RSSI = 0x0B; static final int BT_PROPERTY_REMOTE_TRUST_VALUE = 0x0C; static final int BT_PROPERTY_ADAPTER_BLE_ADV_MODE = 0x0E; static final int BT_DEVICE_TYPE_BREDR = 0x01; static final int BT_DEVICE_TYPE_BLE = 0x02; static final int BT_DEVICE_TYPE_DUAL = 0x03; static final int BLE_ADDR_PUBLIC = 0x00; static final int BLE_ADDR_RANDOM = 0x01; static final int BT_BOND_STATE_NONE = 0x00; static final int BT_BOND_STATE_BONDED = 0x01; static final int BT_SSP_VARIANT_PASSKEY_CONFIRMATION = 0x00; static final int BT_SSP_VARIANT_PASSKEY_ENTRY = 0x01; static final int BT_SSP_VARIANT_CONSENT = 0x02; static final int BT_SSP_VARIANT_PASSKEY_NOTIFICATION = 0x03; static final int BT_DISCOVERY_STOPPED = 0x00; static final int BT_DISCOVERY_STARTED = 0x01; static final int BT_ACL_STATE_CONNECTED = 0x00; static final int BT_ACL_STATE_DISCONNECTED = 0x01; static final int BT_UUID_SIZE = 16; // bytes //define the bit flags for various LE adv data to be visible static final int BTM_BLE_AD_BIT_DEV_NAME= (0x0001 << 0); static final int BTM_BLE_AD_BIT_FLAGS= (0x0001 << 1); static final int BTM_BLE_AD_BIT_MANU = (0x0001 << 2); static final int BTM_BLE_AD_BIT_TX_PWR= (0x0001 << 3); static final int BTM_BLE_AD_BIT_INT_RANGE= (0x0001 << 5); static final int BTM_BLE_AD_BIT_SERVICE = (0x0001 << 6); static final int BTM_BLE_AD_BIT_SERVICE_SOL= (0x0001 << 7); static final int BTM_BLE_AD_BIT_SERVICE_DATA= (0x0001 << 8); static final int BTM_BLE_AD_BIT_SIGN_DATA= (0x0001 << 9); static final int BTM_BLE_AD_BIT_SERVICE_128SOL= (0x0001 << 10); static final int BTM_BLE_AD_BIT_APPEARANCE= (0x0001 << 11); static final int BTM_BLE_AD_BIT_PUBLIC_ADDR = (0x0001 << 12); static final int BTM_BLE_AD_BIT_RANDOM_ADDR= (0x0001 << 13); static final int BTM_BLE_AD_BIT_PROPRIETARY = (0x0001 << 15); public static final int BT_STATUS_SUCCESS = 0; public static final int BT_STATUS_FAIL = 1; public static final int BT_STATUS_NOT_READY = 2; public static final int BT_STATUS_NOMEM = 3; public static final int BT_STATUS_BUSY = 4; public static final int BT_STATUS_DONE = 5; public static final int BT_STATUS_UNSUPPORTED = 6; public static final int BT_STATUS_PARM_INVALID = 7; public static final int BT_STATUS_UNHANDLED = 8; public static final int BT_STATUS_AUTH_FAILURE = 9; public static final int BT_STATUS_RMT_DEV_DOWN = 10; public static final int BT_STATUS_AUTH_REJECTED =11; public static final int BT_STATUS_AUTH_TIMEOUT = 12; }