Home | History | Annotate | Download | only in bluetooth
      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 
     17 package android.bluetooth;
     18 
     19 import android.bluetooth.IBluetoothCallback;
     20 import android.bluetooth.IBluetoothStateChangeCallback;
     21 import android.bluetooth.BluetoothDevice;
     22 import android.os.ParcelUuid;
     23 import android.os.ParcelFileDescriptor;
     24 
     25 /**
     26  * System private API for talking with the Bluetooth service.
     27  *
     28  * {@hide}
     29  */
     30 interface IBluetooth
     31 {
     32     boolean isEnabled();
     33     int getState();
     34     boolean enable();
     35     boolean enableNoAutoConnect();
     36     boolean disable();
     37 
     38     String getAddress();
     39     ParcelUuid[] getUuids();
     40     boolean setName(in String name);
     41     String getName();
     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 
     53     int getAdapterConnectionState();
     54     int getProfileConnectionState(int profile);
     55 
     56     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);
     61 
     62     String getRemoteName(in BluetoothDevice device);
     63     int getRemoteType(in BluetoothDevice device);
     64     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);
     68     boolean fetchRemoteUuids(in BluetoothDevice device);
     69 
     70     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);
     74 
     75     void sendConnectionStateChange(in BluetoothDevice device, int profile, int state, int prevState);
     76 
     77     void registerCallback(in IBluetoothCallback callback);
     78     void unregisterCallback(in IBluetoothCallback callback);
     79 
     80     // 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);
     83 }
     84