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