IBluetoothGatt.aidl revision ac7fcfa36160f1ce8b1ba8e0a3a90338a99a02a4
19908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta/*
29908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * Copyright (C) 2013 The Android Open Source Project
39908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta *
49908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * Licensed under the Apache License, Version 2.0 (the "License");
59908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * you may not use this file except in compliance with the License.
69908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * You may obtain a copy of the License at
79908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta *
89908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta *      http://www.apache.org/licenses/LICENSE-2.0
99908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta *
109908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * Unless required by applicable law or agreed to in writing, software
119908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * distributed under the License is distributed on an "AS IS" BASIS,
129908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
139908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * See the License for the specific language governing permissions and
149908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * limitations under the License.
159908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta */
169908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta
179908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Battapackage android.bluetooth;
189908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta
199908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Battaimport android.bluetooth.BluetoothDevice;
20d75f512aa2a2b55607af3f217c6ad7c81291135cJakub Pawlowskiimport android.bluetooth.BluetoothGattService;
216d81118032b92caa0f5cfebe11af02a98f819d5eWei Wangimport android.bluetooth.le.AdvertiseSettings;
22af74e66e29a518157cb78fcef4b4fc532b7f60b0Wei Wangimport android.bluetooth.le.AdvertiseData;
236d81118032b92caa0f5cfebe11af02a98f819d5eWei Wangimport android.bluetooth.le.ScanFilter;
24ac7fcfa36160f1ce8b1ba8e0a3a90338a99a02a4Jakub Pawlowskiimport android.bluetooth.le.ScanResult;
256d81118032b92caa0f5cfebe11af02a98f819d5eWei Wangimport android.bluetooth.le.ScanSettings;
260d0df3ce258f569c76dc7c4b5250c4e50029d6e6Wei Wangimport android.bluetooth.le.ResultStorageDescriptor;
279908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Battaimport android.os.ParcelUuid;
286771d629b5ad0b9296f0febaa2300fdaf1f90515Adam Lesinskiimport android.os.WorkSource;
299908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta
309908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Battaimport android.bluetooth.IBluetoothGattCallback;
319908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Battaimport android.bluetooth.IBluetoothGattServerCallback;
32a480f7fe28ef059b82491f52dcc69934322ee5e2Jakub Pawlowskiimport android.bluetooth.le.IAdvertiserCallback;
33ac7fcfa36160f1ce8b1ba8e0a3a90338a99a02a4Jakub Pawlowskiimport android.bluetooth.le.IPeriodicAdvertisingCallback;
341b49e6eb04f2eef4d8056e7447d8e0789c291847Jakub Pawlowskiimport android.bluetooth.le.IScannerCallback;
359908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta
369908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta/**
379908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * API for interacting with BLE / GATT
389908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta * @hide
399908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta */
409908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Battainterface IBluetoothGatt {
419908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states);
429908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta
431b49e6eb04f2eef4d8056e7447d8e0789c291847Jakub Pawlowski    void registerScanner(in IScannerCallback callback);
441b49e6eb04f2eef4d8056e7447d8e0789c291847Jakub Pawlowski    void unregisterScanner(in int scannerId);
451b49e6eb04f2eef4d8056e7447d8e0789c291847Jakub Pawlowski    void startScan(in int scannerId, in ScanSettings settings, in List<ScanFilter> filters,
461b49e6eb04f2eef4d8056e7447d8e0789c291847Jakub Pawlowski                   in WorkSource workSource, in List scanStorages, in String callingPackage);
471b49e6eb04f2eef4d8056e7447d8e0789c291847Jakub Pawlowski    void stopScan(in int scannerId);
481b49e6eb04f2eef4d8056e7447d8e0789c291847Jakub Pawlowski    void flushPendingBatchResults(in int scannerId);
49a480f7fe28ef059b82491f52dcc69934322ee5e2Jakub Pawlowski
50a480f7fe28ef059b82491f52dcc69934322ee5e2Jakub Pawlowski    void registerAdvertiser(in IAdvertiserCallback callback);
51a480f7fe28ef059b82491f52dcc69934322ee5e2Jakub Pawlowski    void unregisterAdvertiser(in int advertiserId);
52a480f7fe28ef059b82491f52dcc69934322ee5e2Jakub Pawlowski    void startMultiAdvertising(in int advertiserId,
53af74e66e29a518157cb78fcef4b4fc532b7f60b0Wei Wang                               in AdvertiseData advertiseData,
54af74e66e29a518157cb78fcef4b4fc532b7f60b0Wei Wang                               in AdvertiseData scanResponse,
556d81118032b92caa0f5cfebe11af02a98f819d5eWei Wang                               in AdvertiseSettings settings);
56a480f7fe28ef059b82491f52dcc69934322ee5e2Jakub Pawlowski    void stopMultiAdvertising(in int advertiserId);
57a480f7fe28ef059b82491f52dcc69934322ee5e2Jakub Pawlowski
58ac7fcfa36160f1ce8b1ba8e0a3a90338a99a02a4Jakub Pawlowski    void registerSync(in ScanResult scanResult, in int skip, in int timeout, in IPeriodicAdvertisingCallback callback);
59ac7fcfa36160f1ce8b1ba8e0a3a90338a99a02a4Jakub Pawlowski    void unregisterSync(in IPeriodicAdvertisingCallback callback);
60ac7fcfa36160f1ce8b1ba8e0a3a90338a99a02a4Jakub Pawlowski
619908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback);
629908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void unregisterClient(in int clientIf);
63b88fa824ab6337684de9aa8437c4952df4f1a75eGanesh Ganapathi Batta    void clientConnect(in int clientIf, in String address, in boolean isDirect, in int transport);
649908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void clientDisconnect(in int clientIf, in String address);
659908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void refreshDevice(in int clientIf, in String address);
669908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void discoverServices(in int clientIf, in String address);
67a9e27ec0abfb760402007b2919b7d85565cb6cd4Jakub Pawlowski    void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq);
68a9e27ec0abfb760402007b2919b7d85565cb6cd4Jakub Pawlowski    void writeCharacteristic(in int clientIf, in String address, in int handle,
699908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta                            in int writeType, in int authReq, in byte[] value);
70a9e27ec0abfb760402007b2919b7d85565cb6cd4Jakub Pawlowski    void readDescriptor(in int clientIf, in String address, in int handle, in int authReq);
71a9e27ec0abfb760402007b2919b7d85565cb6cd4Jakub Pawlowski    void writeDescriptor(in int clientIf, in String address, in int handle,
728e970d6ab4850ca23163bad5773cf5cc2e7ff896Jakub Pawlowski                            in int authReq, in byte[] value);
73a9e27ec0abfb760402007b2919b7d85565cb6cd4Jakub Pawlowski    void registerForNotification(in int clientIf, in String address, in int handle, in boolean enable);
749908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void beginReliableWrite(in int clientIf, in String address);
759908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void endReliableWrite(in int clientIf, in String address, in boolean execute);
769908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void readRemoteRssi(in int clientIf, in String address);
77580b0a13028ed2187964735a5515d87900d241ceAndre Eisenbach    void configureMTU(in int clientIf, in String address, in int mtu);
786ce4db0acf9dea297d96424e526092e799f6da84Andre Eisenbach    void connectionParameterUpdate(in int clientIf, in String address, in int connectionPriority);
799908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta
809908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback);
819908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void unregisterServer(in int serverIf);
82d75f512aa2a2b55607af3f217c6ad7c81291135cJakub Pawlowski    void serverConnect(in int serverIf, in String address, in boolean isDirect, in int transport);
839908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void serverDisconnect(in int serverIf, in String address);
84d75f512aa2a2b55607af3f217c6ad7c81291135cJakub Pawlowski    void addService(in int serverIf, in BluetoothGattService service);
85d75f512aa2a2b55607af3f217c6ad7c81291135cJakub Pawlowski    void removeService(in int serverIf, in int handle);
869908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void clearServices(in int serverIf);
879908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta    void sendResponse(in int serverIf, in String address, in int requestId,
889908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta                            in int status, in int offset, in byte[] value);
89d75f512aa2a2b55607af3f217c6ad7c81291135cJakub Pawlowski    void sendNotification(in int serverIf, in String address, in int handle,
909908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta                            in boolean confirm, in byte[] value);
916ddbb5e55f72e870899731ff12af9945fa970e6eNitin Arora    void disconnectAll();
926ddbb5e55f72e870899731ff12af9945fa970e6eNitin Arora    void unregAll();
93db1dbb889588505cd340e954acbde7ebf7c086d6Prerepa Viswanadham    int numHwTrackFiltersAvailable();
949908112fd085d8b0d91e0562d32eebd1884f09a5Ganesh Ganapathi Batta}
95