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