IBluetooth.aidl revision 2ea1e85dcb57d17f5782dbafa1d25eb51c630e4b
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.BluetoothDevice; 21import android.bluetooth.BluetoothHealthAppConfiguration; 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 getBluetoothState(); 34 boolean enable(); 35 boolean disable(boolean persistSetting); 36 37 String getAddress(); 38 String getName(); 39 boolean setName(in String name); 40 ParcelUuid[] getUuids(); 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 byte[] readOutOfBandData(); 52 53 int getAdapterConnectionState(); 54 55 boolean createBond(in String address); 56 boolean createBondOutOfBand(in String address, in byte[] hash, in byte[] randomizer); 57 boolean cancelBondProcess(in String address); 58 boolean removeBond(in String address); 59 String[] listBonds(); 60 int getBondState(in String address); 61 boolean setDeviceOutOfBandData(in String address, in byte[] hash, in byte[] randomizer); 62 63 String getRemoteName(in String address); 64 int getRemoteClass(in String address); 65 ParcelUuid[] getRemoteUuids(in String address); 66 boolean fetchRemoteUuids(in String address, in ParcelUuid uuid, in IBluetoothCallback callback); 67 int getRemoteServiceChannel(in String address, in ParcelUuid uuid); 68 69 boolean setPin(in String address, in byte[] pin); 70 boolean setPasskey(in String address, int passkey); 71 boolean setPairingConfirmation(in String address, boolean confirm); 72 boolean setRemoteOutOfBandData(in String addres); 73 boolean cancelPairingUserInput(in String address); 74 75 boolean setTrust(in String address, in boolean value); 76 boolean getTrustState(in String address); 77 boolean isBluetoothDock(in String address); 78 79 int addRfcommServiceRecord(in String serviceName, in ParcelUuid uuid, int channel, IBinder b); 80 void removeServiceRecord(int handle); 81 82 boolean connectHeadset(String address); 83 boolean disconnectHeadset(String address); 84 boolean notifyIncomingConnection(String address); 85 86 // HID profile APIs 87 boolean connectInputDevice(in BluetoothDevice device); 88 boolean disconnectInputDevice(in BluetoothDevice device); 89 List<BluetoothDevice> getConnectedInputDevices(); 90 List<BluetoothDevice> getInputDevicesMatchingConnectionStates(in int[] states); 91 int getInputDeviceConnectionState(in BluetoothDevice device); 92 boolean setInputDevicePriority(in BluetoothDevice device, int priority); 93 int getInputDevicePriority(in BluetoothDevice device); 94 95 boolean isTetheringOn(); 96 void setBluetoothTethering(boolean value); 97 int getPanDeviceConnectionState(in BluetoothDevice device); 98 List<BluetoothDevice> getConnectedPanDevices(); 99 List<BluetoothDevice> getPanDevicesMatchingConnectionStates(in int[] states); 100 boolean connectPanDevice(in BluetoothDevice device); 101 boolean disconnectPanDevice(in BluetoothDevice device); 102 103 // HDP profile APIs 104 boolean registerAppConfiguration(in BluetoothHealthAppConfiguration config); 105 boolean unregisterAppConfiguration(in BluetoothHealthAppConfiguration config); 106 boolean connectChannelToSource(in BluetoothDevice device, in BluetoothHealthAppConfiguration config); 107 boolean connectChannelToSink(in BluetoothDevice device, in BluetoothHealthAppConfiguration config, 108 int channelType); 109 boolean disconnectChannel(in BluetoothDevice device, in BluetoothHealthAppConfiguration config, in ParcelFileDescriptor fd); 110 ParcelFileDescriptor getMainChannelFd(in BluetoothDevice device, in BluetoothHealthAppConfiguration config); 111 List<BluetoothDevice> getConnectedHealthDevices(); 112 List<BluetoothDevice> getHealthDevicesMatchingConnectionStates(in int[] states); 113 int getHealthDeviceConnectionState(in BluetoothDevice device); 114 115 void sendConnectionStateChange(in BluetoothDevice device, int state, int prevState); 116} 117