IBluetooth.aidl revision 5a1e4cf83f5be1b5d79e2643fa791aa269b6a4bc
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.os.ParcelUuid;
22
23/**
24 * System private API for talking with the Bluetooth service.
25 *
26 * {@hide}
27 */
28interface IBluetooth
29{
30    boolean isEnabled();
31    int getBluetoothState();
32    boolean enable();
33    boolean disable(boolean persistSetting);
34
35    String getAddress();
36    String getName();
37    boolean setName(in String name);
38
39    int getScanMode();
40    boolean setScanMode(int mode, int duration);
41
42    int getDiscoverableTimeout();
43    boolean setDiscoverableTimeout(int timeout);
44
45    boolean startDiscovery();
46    boolean cancelDiscovery();
47    boolean isDiscovering();
48    byte[] readOutOfBandData();
49
50    boolean createBond(in String address);
51    boolean createBondOutOfBand(in String address, in byte[] hash, in byte[] randomizer);
52    boolean cancelBondProcess(in String address);
53    boolean removeBond(in String address);
54    String[] listBonds();
55    int getBondState(in String address);
56    boolean setDeviceOutOfBandData(in String address, in byte[] hash, in byte[] randomizer);
57
58    String getRemoteName(in String address);
59    int getRemoteClass(in String address);
60    ParcelUuid[] getRemoteUuids(in String address);
61    boolean fetchRemoteUuids(in String address, in ParcelUuid uuid, in IBluetoothCallback callback);
62    int getRemoteServiceChannel(in String address, in ParcelUuid uuid);
63
64    boolean setPin(in String address, in byte[] pin);
65    boolean setPasskey(in String address, int passkey);
66    boolean setPairingConfirmation(in String address, boolean confirm);
67    boolean setRemoteOutOfBandData(in String addres);
68    boolean cancelPairingUserInput(in String address);
69
70    boolean setTrust(in String address, in boolean value);
71    boolean getTrustState(in String address);
72    boolean isBluetoothDock(in String address);
73
74    int addRfcommServiceRecord(in String serviceName, in ParcelUuid uuid, int channel, IBinder b);
75    void removeServiceRecord(int handle);
76
77    boolean connectHeadset(String address);
78    boolean disconnectHeadset(String address);
79    boolean notifyIncomingConnection(String address);
80
81    // HID profile APIs
82    boolean connectInputDevice(in BluetoothDevice device);
83    boolean disconnectInputDevice(in BluetoothDevice device);
84    List<BluetoothDevice> getConnectedInputDevices();
85    int getInputDeviceState(in BluetoothDevice device);
86    boolean setInputDevicePriority(in BluetoothDevice device, int priority);
87    int getInputDevicePriority(in BluetoothDevice device);
88
89    boolean isTetheringOn();
90    void setBluetoothTethering(boolean value);
91    int getPanDeviceState(in BluetoothDevice device);
92    List<BluetoothDevice> getConnectedPanDevices();
93    boolean connectPanDevice(in BluetoothDevice device);
94    boolean disconnectPanDevice(in BluetoothDevice device);
95}
96