1 /* 2 * Copyright (C) 2016 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 android.bluetooth; 18 19 import android.bluetooth.IBluetoothCallback; 20 import android.bluetooth.IBluetoothLowEnergy; 21 import android.bluetooth.IBluetoothLeAdvertiser; 22 import android.bluetooth.IBluetoothLeScanner; 23 import android.bluetooth.IBluetoothGattClient; 24 import android.bluetooth.IBluetoothGattServer; 25 import android.bluetooth.IBluetoothA2dpSink; 26 import android.bluetooth.IBluetoothA2dpSource; 27 import android.bluetooth.IBluetoothAvrcpControl; 28 import android.bluetooth.IBluetoothAvrcpTarget; 29 30 import android.bluetooth.UUID; 31 32 interface IBluetooth { IsEnabled()33 boolean IsEnabled(); GetState()34 int GetState(); Enable()35 boolean Enable(); EnableNoAutoConnect()36 boolean EnableNoAutoConnect(); Disable()37 boolean Disable(); 38 GetAddress()39 String GetAddress(); GetUUIDs()40 UUID[] GetUUIDs(); SetName(String name)41 boolean SetName(String name); GetName()42 String GetName(); SetScanMode(int scan_mode)43 boolean SetScanMode(int scan_mode); SetScanEnable(boolean scan_enable)44 boolean SetScanEnable(boolean scan_enable); SspReply( String device_address, int variant, boolean accept, int passkey)45 boolean SspReply( 46 String device_address, 47 int variant, 48 boolean accept, 49 int passkey); CreateBond(String device_address, int transport)50 boolean CreateBond(String device_address, int transport); GetBondedDevices()51 boolean GetBondedDevices(); RemoveBond(String device_address)52 boolean RemoveBond(String device_address); GetRemoteDeviceProperties(String device_address)53 boolean GetRemoteDeviceProperties(String device_address); 54 RegisterCallback(IBluetoothCallback callback)55 void RegisterCallback(IBluetoothCallback callback); UnregisterCallback(IBluetoothCallback callback)56 void UnregisterCallback(IBluetoothCallback callback); 57 IsMultiAdvertisementSupported()58 boolean IsMultiAdvertisementSupported(); 59 GetLowEnergyInterface()60 IBluetoothLowEnergy GetLowEnergyInterface(); GetLeAdvertiserInterface()61 IBluetoothLeAdvertiser GetLeAdvertiserInterface(); GetLeScannerInterface()62 IBluetoothLeScanner GetLeScannerInterface(); GetGattClientInterface()63 IBluetoothGattClient GetGattClientInterface(); GetGattServerInterface()64 IBluetoothGattServer GetGattServerInterface(); GetA2dpSinkInterface()65 IBluetoothA2dpSink GetA2dpSinkInterface(); GetA2dpSourceInterface()66 IBluetoothA2dpSource GetA2dpSourceInterface(); GetAvrcpControlInterface()67 IBluetoothAvrcpControl GetAvrcpControlInterface(); GetAvrcpTargetInterface()68 IBluetoothAvrcpTarget GetAvrcpTargetInterface(); 69 } 70