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 */
16package android.bluetooth;
17
18import android.os.ParcelUuid;
19import android.bluetooth.le.AdvertiseSettings;
20import android.bluetooth.le.ScanResult;
21
22/**
23 * Callback definitions for interacting with BLE / GATT
24 * @hide
25 */
26oneway interface IBluetoothGattCallback {
27    void onClientRegistered(in int status, in int clientIf);
28    void onClientConnectionState(in int status, in int clientIf,
29                                 in boolean connected, in String address);
30    void onScanResult(in ScanResult scanResult);
31    void onBatchScanResults(in List<ScanResult> batchResults);
32    void onGetService(in String address, in int srvcType, in int srvcInstId,
33                      in ParcelUuid srvcUuid);
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);
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);
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);
45    void onSearchComplete(in String address, in int status);
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);
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);
53    void onExecuteWrite(in String address, in int status);
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);
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);
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);
67    void onReadRemoteRssi(in String address, in int rssi, in int status);
68    void onMultiAdvertiseCallback(in int status, boolean isStart,
69                                  in AdvertiseSettings advertiseSettings);
70    void onConfigureMTU(in String address, in int mtu, in int status);
71    void onFoundOrLost(in boolean onFound, in ScanResult scanResult);
72}
73