IBluetooth.aidl revision 3b147b770269173d5d711d6c33f142dc5e723824
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 disable(boolean persist); 36 37 String getAddress(); 38 ParcelUuid[] getUuids(); 39 boolean setName(in String name); 40 String getName(); 41 42 int getScanMode(); 43 boolean setScanMode(int mode, int duration); 44 45 int getDiscoverableTimeout(); 46 boolean setDiscoverableTimeout(int timeout); 47 48 boolean startDiscovery(); 49 boolean cancelDiscovery(); 50 boolean isDiscovering(); 51 52 int getAdapterConnectionState(); 53 int getProfileConnectionState(int profile); 54 55 BluetoothDevice[] getBondedDevices(); 56 boolean createBond(in BluetoothDevice device); 57 boolean cancelBondProcess(in BluetoothDevice device); 58 boolean removeBond(in BluetoothDevice device); 59 int getBondState(in BluetoothDevice device); 60 61 String getRemoteName(in BluetoothDevice device); 62 String getRemoteAlias(in BluetoothDevice device); 63 boolean setRemoteAlias(in BluetoothDevice device, in String name); 64 int getRemoteClass(in BluetoothDevice device); 65 ParcelUuid[] getRemoteUuids(in BluetoothDevice device); 66 //TODO(BT) 67 //boolean fetchRemoteUuids(in BluetoothDevice device, in ParcelUuid uuid, 68 // in IBluetoothCallback callback); 69 70 boolean setPin(in BluetoothDevice device, boolean accept, int len, in byte[] pinCode); 71 boolean setPasskey(in BluetoothDevice device, boolean accept, int len, in byte[] 72 passkey); 73 boolean setPairingConfirmation(in BluetoothDevice device, boolean accept); 74 75 void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState); 76 77 // For Socket 78 ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag); 79 ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag); 80} 81