OSDN Git Service

GATT: Expose opportunistic client API to Java
[android-x86/frameworks-base.git] / core / java / android / bluetooth / IBluetoothGatt.aidl
1 /*
2  * Copyright (C) 2013 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.app.PendingIntent;
20 import android.bluetooth.BluetoothDevice;
21 import android.bluetooth.BluetoothGattService;
22 import android.bluetooth.le.AdvertiseSettings;
23 import android.bluetooth.le.AdvertiseData;
24 import android.bluetooth.le.AdvertisingSetParameters;
25 import android.bluetooth.le.PeriodicAdvertisingParameters;
26 import android.bluetooth.le.ScanFilter;
27 import android.bluetooth.le.ScanResult;
28 import android.bluetooth.le.ScanSettings;
29 import android.bluetooth.le.ResultStorageDescriptor;
30 import android.os.ParcelUuid;
31 import android.os.WorkSource;
32
33 import android.bluetooth.IBluetoothGattCallback;
34 import android.bluetooth.IBluetoothGattServerCallback;
35 import android.bluetooth.le.IAdvertisingSetCallback;
36 import android.bluetooth.le.IPeriodicAdvertisingCallback;
37 import android.bluetooth.le.IScannerCallback;
38
39 /**
40  * API for interacting with BLE / GATT
41  * @hide
42  */
43 interface IBluetoothGatt {
44     List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
45
46     void registerScanner(in IScannerCallback callback, in WorkSource workSource);
47     void unregisterScanner(in int scannerId);
48     void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters,
49                    in List scanStorages, in String callingPackage);
50     void startScanForIntent(in PendingIntent intent, in ScanSettings settings, in List<ScanFilter> filters,
51                             in String callingPackage);
52     void stopScanForIntent(in PendingIntent intent, in String callingPackage);
53     void stopScan(in int scannerId);
54     void flushPendingBatchResults(in int scannerId);
55
56     void startAdvertisingSet(in AdvertisingSetParameters parameters, in AdvertiseData advertiseData,
57                                 in AdvertiseData scanResponse, in PeriodicAdvertisingParameters periodicParameters,
58                                 in AdvertiseData periodicData, in int duration, in int maxExtAdvEvents,
59                                 in IAdvertisingSetCallback callback);
60     void stopAdvertisingSet(in IAdvertisingSetCallback callback);
61
62     void getOwnAddress(in int advertiserId);
63     void enableAdvertisingSet(in int advertiserId, in boolean enable, in int duration, in int maxExtAdvEvents);
64     void setAdvertisingData(in int advertiserId, in AdvertiseData data);
65     void setScanResponseData(in int advertiserId, in AdvertiseData data);
66     void setAdvertisingParameters(in int advertiserId, in AdvertisingSetParameters parameters);
67     void setPeriodicAdvertisingParameters(in int advertiserId, in PeriodicAdvertisingParameters parameters);
68     void setPeriodicAdvertisingData(in int advertiserId, in AdvertiseData data);
69     void setPeriodicAdvertisingEnable(in int advertiserId, in boolean enable);
70
71     void registerSync(in ScanResult scanResult, in int skip, in int timeout, in IPeriodicAdvertisingCallback callback);
72     void unregisterSync(in IPeriodicAdvertisingCallback callback);
73
74     void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback);
75
76     void unregisterClient(in int clientIf);
77     void clientConnect(in int clientIf, in String address, in boolean isDirect, in int transport, in boolean opportunistic, in int phy);
78     void clientDisconnect(in int clientIf, in String address);
79     void clientSetPreferredPhy(in int clientIf, in String address, in int txPhy, in int rxPhy, in int phyOptions);
80     void clientReadPhy(in int clientIf, in String address);
81     void refreshDevice(in int clientIf, in String address);
82     void discoverServices(in int clientIf, in String address);
83     void discoverServiceByUuid(in int clientIf, in String address, in ParcelUuid uuid);
84     void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq);
85     void readUsingCharacteristicUuid(in int clientIf, in String address, in ParcelUuid uuid,
86                            in int startHandle, in int endHandle, in int authReq);
87     void writeCharacteristic(in int clientIf, in String address, in int handle,
88                             in int writeType, in int authReq, in byte[] value);
89     void readDescriptor(in int clientIf, in String address, in int handle, in int authReq);
90     void writeDescriptor(in int clientIf, in String address, in int handle,
91                             in int authReq, in byte[] value);
92     void registerForNotification(in int clientIf, in String address, in int handle, in boolean enable);
93     void beginReliableWrite(in int clientIf, in String address);
94     void endReliableWrite(in int clientIf, in String address, in boolean execute);
95     void readRemoteRssi(in int clientIf, in String address);
96     void configureMTU(in int clientIf, in String address, in int mtu);
97     void connectionParameterUpdate(in int clientIf, in String address, in int connectionPriority);
98
99     void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback);
100     void unregisterServer(in int serverIf);
101     void serverConnect(in int serverIf, in String address, in boolean isDirect, in int transport);
102     void serverDisconnect(in int serverIf, in String address);
103     void serverSetPreferredPhy(in int clientIf, in String address, in int txPhy, in int rxPhy, in int phyOptions);
104     void serverReadPhy(in int clientIf, in String address);
105     void addService(in int serverIf, in BluetoothGattService service);
106     void removeService(in int serverIf, in int handle);
107     void clearServices(in int serverIf);
108     void sendResponse(in int serverIf, in String address, in int requestId,
109                             in int status, in int offset, in byte[] value);
110     void sendNotification(in int serverIf, in String address, in int handle,
111                             in boolean confirm, in byte[] value);
112     void disconnectAll();
113     void unregAll();
114     int numHwTrackFiltersAvailable();
115 }