1 /* 2 * Copyright (C) 2008, 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.IBluetoothStateChangeCallback; 21 import android.bluetooth.BluetoothDevice; 22 import android.os.ParcelUuid; 23 import android.os.ParcelFileDescriptor; 24 25 /** 26 * System private API for talking with the Bluetooth service. 27 * 28 * {@hide} 29 */ 30 interface IBluetooth 31 { isEnabled()32 boolean isEnabled(); getState()33 int getState(); enable()34 boolean enable(); enableNoAutoConnect()35 boolean enableNoAutoConnect(); disable()36 boolean disable(); 37 getAddress()38 String getAddress(); getUuids()39 ParcelUuid[] getUuids(); setName(in String name)40 boolean setName(in String name); getName()41 String getName(); 42 getScanMode()43 int getScanMode(); setScanMode(int mode, int duration)44 boolean setScanMode(int mode, int duration); 45 getDiscoverableTimeout()46 int getDiscoverableTimeout(); setDiscoverableTimeout(int timeout)47 boolean setDiscoverableTimeout(int timeout); 48 startDiscovery()49 boolean startDiscovery(); cancelDiscovery()50 boolean cancelDiscovery(); isDiscovering()51 boolean isDiscovering(); 52 getAdapterConnectionState()53 int getAdapterConnectionState(); getProfileConnectionState(int profile)54 int getProfileConnectionState(int profile); 55 getBondedDevices()56 BluetoothDevice[] getBondedDevices(); createBond(in BluetoothDevice device)57 boolean createBond(in BluetoothDevice device); cancelBondProcess(in BluetoothDevice device)58 boolean cancelBondProcess(in BluetoothDevice device); removeBond(in BluetoothDevice device)59 boolean removeBond(in BluetoothDevice device); getBondState(in BluetoothDevice device)60 int getBondState(in BluetoothDevice device); 61 getRemoteName(in BluetoothDevice device)62 String getRemoteName(in BluetoothDevice device); getRemoteType(in BluetoothDevice device)63 int getRemoteType(in BluetoothDevice device); getRemoteAlias(in BluetoothDevice device)64 String getRemoteAlias(in BluetoothDevice device); setRemoteAlias(in BluetoothDevice device, in String name)65 boolean setRemoteAlias(in BluetoothDevice device, in String name); getRemoteClass(in BluetoothDevice device)66 int getRemoteClass(in BluetoothDevice device); getRemoteUuids(in BluetoothDevice device)67 ParcelUuid[] getRemoteUuids(in BluetoothDevice device); fetchRemoteUuids(in BluetoothDevice device)68 boolean fetchRemoteUuids(in BluetoothDevice device); 69 setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode)70 boolean setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode); setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[] passkey)71 boolean setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[] 72 passkey); setPairingConfirmation(in BluetoothDevice device, boolean accept)73 boolean setPairingConfirmation(in BluetoothDevice device, boolean accept); 74 sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState)75 void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState); 76 registerCallback(in IBluetoothCallback callback)77 void registerCallback(in IBluetoothCallback callback); unregisterCallback(in IBluetoothCallback callback)78 void unregisterCallback(in IBluetoothCallback callback); 79 80 // For Socket connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag)81 ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag); createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag)82 ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag); 83 configHciSnoopLog(boolean enable)84 boolean configHciSnoopLog(boolean enable); 85 } 86