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 package android.bluetooth;
17 
18 import android.os.ParcelUuid;
19 import android.bluetooth.le.AdvertiseSettings;
20 import android.bluetooth.le.ScanResult;
21 
22 /**
23  * Callback definitions for interacting with BLE / GATT
24  * @hide
25  */
26 oneway interface IBluetoothGattCallback {
onClientRegistered(in int status, in int clientIf)27     void onClientRegistered(in int status, in int clientIf);
onClientConnectionState(in int status, in int clientIf, in boolean connected, in String address)28     void onClientConnectionState(in int status, in int clientIf,
29                                  in boolean connected, in String address);
onScanResult(in ScanResult scanResult)30     void onScanResult(in ScanResult scanResult);
onBatchScanResults(in List<ScanResult> batchResults)31     void onBatchScanResults(in List<ScanResult> batchResults);
onGetService(in String address, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid)32     void onGetService(in String address, in int srvcType, in int srvcInstId,
33                       in ParcelUuid srvcUuid);
onGetIncludedService(in String address, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int inclSrvcType, in int inclSrvcInstId, in ParcelUuid inclSrvcUuid)34     void onGetIncludedService(in String address, in int srvcType, in int srvcInstId,
35                               in ParcelUuid srvcUuid, in int inclSrvcType,
36                               in int inclSrvcInstId, in ParcelUuid inclSrvcUuid);
onGetCharacteristic(in String address, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int charInstId, in ParcelUuid charUuid, in int charProps)37     void onGetCharacteristic(in String address, in int srvcType,
38                              in int srvcInstId, in ParcelUuid srvcUuid,
39                              in int charInstId, in ParcelUuid charUuid,
40                              in int charProps);
onGetDescriptor(in String address, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int charInstId, in ParcelUuid charUuid, in int descrInstId, in ParcelUuid descrUuid)41     void onGetDescriptor(in String address, in int srvcType,
42                              in int srvcInstId, in ParcelUuid srvcUuid,
43                              in int charInstId, in ParcelUuid charUuid,
44                              in int descrInstId, in ParcelUuid descrUuid);
onSearchComplete(in String address, in int status)45     void onSearchComplete(in String address, in int status);
onCharacteristicRead(in String address, in int status, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int charInstId, in ParcelUuid charUuid, in byte[] value)46     void onCharacteristicRead(in String address, in int status, in int srvcType,
47                              in int srvcInstId, in ParcelUuid srvcUuid,
48                              in int charInstId, in ParcelUuid charUuid,
49                              in byte[] value);
onCharacteristicWrite(in String address, in int status, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int charInstId, in ParcelUuid charUuid)50     void onCharacteristicWrite(in String address, in int status, in int srvcType,
51                              in int srvcInstId, in ParcelUuid srvcUuid,
52                              in int charInstId, in ParcelUuid charUuid);
onExecuteWrite(in String address, in int status)53     void onExecuteWrite(in String address, in int status);
onDescriptorRead(in String address, in int status, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int charInstId, in ParcelUuid charUuid, in int descrInstId, in ParcelUuid descrUuid, in byte[] value)54     void onDescriptorRead(in String address, in int status, in int srvcType,
55                              in int srvcInstId, in ParcelUuid srvcUuid,
56                              in int charInstId, in ParcelUuid charUuid,
57                              in int descrInstId, in ParcelUuid descrUuid,
58                              in byte[] value);
onDescriptorWrite(in String address, in int status, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int charInstId, in ParcelUuid charUuid, in int descrInstId, in ParcelUuid descrUuid)59     void onDescriptorWrite(in String address, in int status, in int srvcType,
60                              in int srvcInstId, in ParcelUuid srvcUuid,
61                              in int charInstId, in ParcelUuid charUuid,
62                              in int descrInstId, in ParcelUuid descrUuid);
onNotify(in String address, in int srvcType, in int srvcInstId, in ParcelUuid srvcUuid, in int charInstId, in ParcelUuid charUuid, in byte[] value)63     void onNotify(in String address, in int srvcType,
64                              in int srvcInstId, in ParcelUuid srvcUuid,
65                              in int charInstId, in ParcelUuid charUuid,
66                              in byte[] value);
onReadRemoteRssi(in String address, in int rssi, in int status)67     void onReadRemoteRssi(in String address, in int rssi, in int status);
onMultiAdvertiseCallback(in int status, boolean isStart, in AdvertiseSettings advertiseSettings)68     void onMultiAdvertiseCallback(in int status, boolean isStart,
69                                   in AdvertiseSettings advertiseSettings);
onScanManagerErrorCallback(in int errorCode)70     void onScanManagerErrorCallback(in int errorCode);
onConfigureMTU(in String address, in int mtu, in int status)71     void onConfigureMTU(in String address, in int mtu, in int status);
onFoundOrLost(in boolean onFound, in ScanResult scanResult)72     void onFoundOrLost(in boolean onFound, in ScanResult scanResult);
73 }
74