blob: 80806f97d48bc52a7ccb9730988cda1af3b8abb6 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
Nick Pelly16fb88a2009-10-07 07:44:03 +020019import android.bluetooth.IBluetoothCallback;
Jaikumar Ganeshef2cb7c2011-07-21 18:13:38 -070020import android.bluetooth.IBluetoothStateChangeCallback;
Jaikumar Ganesh545e6702010-06-04 10:23:03 -070021import android.bluetooth.BluetoothDevice;
Nick Pellyaef439e2009-09-28 12:33:17 -070022import android.os.ParcelUuid;
Jaikumar Ganesh2ea1e852011-04-01 16:33:09 -070023import android.os.ParcelFileDescriptor;
Jaikumar Ganeshdd0463a2009-09-16 12:30:02 -070024
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080025/**
26 * System private API for talking with the Bluetooth service.
27 *
28 * {@hide}
29 */
Nick Pellybd022f42009-08-14 18:33:38 -070030interface IBluetooth
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080031{
32 boolean isEnabled();
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080033 int getState();
The Android Open Source Project10592532009-03-18 17:39:46 -070034 boolean enable();
Matthew Xie96313142012-06-29 16:57:31 -070035 boolean enableNoAutoConnect();
Freda8c6df02012-07-11 10:25:23 -070036 boolean disable();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080037
38 String getAddress();
Jaikumar Ganesh58b93c32010-11-23 20:03:10 -080039 ParcelUuid[] getUuids();
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080040 boolean setName(in String name);
41 String getName();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080042
43 int getScanMode();
Nick Pelly12835472009-09-25 15:00:29 -070044 boolean setScanMode(int mode, int duration);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080045
46 int getDiscoverableTimeout();
47 boolean setDiscoverableTimeout(int timeout);
48
Jaikumar Ganeshd5ac1ae2009-05-05 22:26:12 -070049 boolean startDiscovery();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080050 boolean cancelDiscovery();
51 boolean isDiscovering();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080052
Jaikumar Ganeshc53cab22010-10-26 16:02:26 -070053 int getAdapterConnectionState();
Jaikumar Ganeshcb1d3542011-08-19 10:26:32 -070054 int getProfileConnectionState(int profile);
Jaikumar Ganeshc53cab22010-10-26 16:02:26 -070055
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080056 BluetoothDevice[] getBondedDevices();
57 boolean createBond(in BluetoothDevice device);
58 boolean cancelBondProcess(in BluetoothDevice device);
59 boolean removeBond(in BluetoothDevice device);
60 int getBondState(in BluetoothDevice device);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080061
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080062 String getRemoteName(in BluetoothDevice device);
Matthew Xie33ec9842013-04-03 00:29:27 -070063 int getRemoteType(in BluetoothDevice device);
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080064 String getRemoteAlias(in BluetoothDevice device);
65 boolean setRemoteAlias(in BluetoothDevice device, in String name);
66 int getRemoteClass(in BluetoothDevice device);
67 ParcelUuid[] getRemoteUuids(in BluetoothDevice device);
fredc4c9caca2012-04-06 02:08:46 -070068 boolean fetchRemoteUuids(in BluetoothDevice device);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080069
Jaikumar Ganeshe4caddb2012-01-25 16:16:48 -080070 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);
Jaikumar Ganesh2ea1e852011-04-01 16:33:09 -070074
Jaikumar Ganeshcb1d3542011-08-19 10:26:32 -070075 void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState);
zzy3b147b72012-04-03 19:48:32 -070076
fredcbf072a72012-05-09 16:52:50 -070077 void registerCallback(in IBluetoothCallback callback);
78 void unregisterCallback(in IBluetoothCallback callback);
79
zzy3b147b72012-04-03 19:48:32 -070080 // For Socket
81 ParcelFileDescriptor connectSocket(in BluetoothDevice device, int type, in ParcelUuid uuid, int port, int flag);
82 ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080083}