Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 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.bluetooth.BluetoothDevice; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 20 | import android.bluetooth.le.AdvertiseSettings; |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 21 | import android.bluetooth.le.AdvertiseData; |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 22 | import android.bluetooth.le.ScanFilter; |
| 23 | import android.bluetooth.le.ScanSettings; |
Wei Wang | 0d0df3c | 2014-07-30 15:19:08 -0700 | [diff] [blame] | 24 | import android.bluetooth.le.ResultStorageDescriptor; |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 25 | import android.os.ParcelUuid; |
Adam Lesinski | 6771d62 | 2016-01-15 18:14:47 -0800 | [diff] [blame] | 26 | import android.os.WorkSource; |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 27 | |
| 28 | import android.bluetooth.IBluetoothGattCallback; |
| 29 | import android.bluetooth.IBluetoothGattServerCallback; |
| 30 | |
| 31 | /** |
| 32 | * API for interacting with BLE / GATT |
| 33 | * @hide |
| 34 | */ |
| 35 | interface IBluetoothGatt { |
| 36 | List<BluetoothDevice> getDevicesMatchingConnectionStates(in int[] states); |
| 37 | |
Wei Wang | c3059cc | 2014-07-23 23:34:00 -0700 | [diff] [blame] | 38 | void startScan(in int appIf, in boolean isServer, in ScanSettings settings, |
Adam Lesinski | 6771d62 | 2016-01-15 18:14:47 -0800 | [diff] [blame] | 39 | in List<ScanFilter> filters, in WorkSource workSource, in List scanStorages, |
| 40 | in String callingPackage); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 41 | void stopScan(in int appIf, in boolean isServer); |
Wei Wang | 9fb1791 | 2014-07-01 15:10:06 -0700 | [diff] [blame] | 42 | void flushPendingBatchResults(in int appIf, in boolean isServer); |
Wei Wang | ab39cb7 | 2014-05-20 17:59:36 -0700 | [diff] [blame] | 43 | void startMultiAdvertising(in int appIf, |
Wei Wang | af74e66 | 2014-07-09 14:03:42 -0700 | [diff] [blame] | 44 | in AdvertiseData advertiseData, |
| 45 | in AdvertiseData scanResponse, |
Wei Wang | 6d81118 | 2014-05-22 12:10:25 -0700 | [diff] [blame] | 46 | in AdvertiseSettings settings); |
Wei Wang | adf6aff | 2014-05-20 06:30:20 +0000 | [diff] [blame] | 47 | void stopMultiAdvertising(in int appIf); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 48 | void registerClient(in ParcelUuid appId, in IBluetoothGattCallback callback); |
| 49 | void unregisterClient(in int clientIf); |
Ganesh Ganapathi Batta | b88fa82 | 2014-04-18 10:00:40 -0700 | [diff] [blame] | 50 | void clientConnect(in int clientIf, in String address, in boolean isDirect, in int transport); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 51 | void clientDisconnect(in int clientIf, in String address); |
| 52 | void refreshDevice(in int clientIf, in String address); |
| 53 | void discoverServices(in int clientIf, in String address); |
Jakub Pawlowski | c9d13c3 | 2016-03-17 16:00:16 -0700 | [diff] [blame] | 54 | void readCharacteristic(in int clientIf, in String address, in int handle, in int authReq); |
| 55 | void writeCharacteristic(in int clientIf, in String address, in int handle, |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 56 | in int writeType, in int authReq, in byte[] value); |
Jakub Pawlowski | c9d13c3 | 2016-03-17 16:00:16 -0700 | [diff] [blame] | 57 | void readDescriptor(in int clientIf, in String address, in int handle, in int authReq); |
| 58 | void writeDescriptor(in int clientIf, in String address, in int handle, |
Andre Eisenbach | 25b9cf9 | 2013-07-08 23:58:16 -0700 | [diff] [blame] | 59 | in int writeType, in int authReq, in byte[] value); |
Jakub Pawlowski | c9d13c3 | 2016-03-17 16:00:16 -0700 | [diff] [blame] | 60 | void registerForNotification(in int clientIf, in String address, in int handle, in boolean enable); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 61 | void beginReliableWrite(in int clientIf, in String address); |
| 62 | void endReliableWrite(in int clientIf, in String address, in boolean execute); |
| 63 | void readRemoteRssi(in int clientIf, in String address); |
Andre Eisenbach | 580b0a1 | 2014-03-25 06:31:50 -0700 | [diff] [blame] | 64 | void configureMTU(in int clientIf, in String address, in int mtu); |
Andre Eisenbach | 6ce4db0 | 2014-07-16 23:02:42 -0700 | [diff] [blame] | 65 | void connectionParameterUpdate(in int clientIf, in String address, in int connectionPriority); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 66 | |
| 67 | void registerServer(in ParcelUuid appId, in IBluetoothGattServerCallback callback); |
| 68 | void unregisterServer(in int serverIf); |
Ganesh Ganapathi Batta | b88fa82 | 2014-04-18 10:00:40 -0700 | [diff] [blame] | 69 | void serverConnect(in int servertIf, in String address, in boolean isDirect, in int transport); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 70 | void serverDisconnect(in int serverIf, in String address); |
| 71 | void beginServiceDeclaration(in int serverIf, in int srvcType, |
| 72 | in int srvcInstanceId, in int minHandles, |
Wei Wang | 86b3fa6 | 2013-10-29 21:05:37 -0700 | [diff] [blame] | 73 | in ParcelUuid srvcId, boolean advertisePreferred); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 74 | void addIncludedService(in int serverIf, in int srvcType, |
| 75 | in int srvcInstanceId, in ParcelUuid srvcId); |
| 76 | void addCharacteristic(in int serverIf, in ParcelUuid charId, |
| 77 | in int properties, in int permissions); |
| 78 | void addDescriptor(in int serverIf, in ParcelUuid descId, |
| 79 | in int permissions); |
| 80 | void endServiceDeclaration(in int serverIf); |
| 81 | void removeService(in int serverIf, in int srvcType, |
| 82 | in int srvcInstanceId, in ParcelUuid srvcId); |
| 83 | void clearServices(in int serverIf); |
| 84 | void sendResponse(in int serverIf, in String address, in int requestId, |
| 85 | in int status, in int offset, in byte[] value); |
| 86 | void sendNotification(in int serverIf, in String address, in int srvcType, |
| 87 | in int srvcInstanceId, in ParcelUuid srvcId, |
| 88 | in int charInstanceId, in ParcelUuid charId, |
| 89 | in boolean confirm, in byte[] value); |
Nitin Arora | 6ddbb5e | 2015-03-02 15:03:51 -0800 | [diff] [blame] | 90 | void disconnectAll(); |
| 91 | void unregAll(); |
Prerepa Viswanadham | db1dbb8 | 2015-04-09 17:14:50 -0700 | [diff] [blame] | 92 | int numHwTrackFiltersAvailable(); |
Ganesh Ganapathi Batta | 9908112 | 2013-02-05 15:28:33 -0800 | [diff] [blame] | 93 | } |