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