1 /* 2 * Copyright 2021 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.le.AdvertiseSettings; 20 import android.bluetooth.le.ScanResult; 21 import android.os.ParcelUuid; 22 23 /** 24 * Fake interface replacement for IBluetoothGattCallback 25 * TODO(b/200231384): include >=N interface. 26 */ 27 public interface IBluetoothGattCallback { 28 29 /* SINCE SDK 21 */ onClientRegistered(int status, int clientIf)30 void onClientRegistered(int status, int clientIf); 31 32 /* SINCE SDK 21 */ onClientConnectionState(int status, int clientIf, boolean connected, String address)33 void onClientConnectionState(int status, int clientIf, boolean connected, String address); 34 35 /* ONLY SDK 19 */ onScanResult(String address, int rssi, byte[] advData)36 void onScanResult(String address, int rssi, byte[] advData); 37 38 /* SINCE SDK 21 */ onScanResult(ScanResult scanResult)39 void onScanResult(ScanResult scanResult); 40 41 /* SINCE SDK 21 */ onGetService(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid)42 void onGetService(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid); 43 44 /* SINCE SDK 21 */ onGetIncludedService(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int inclSrvcType, int inclSrvcInstId, ParcelUuid inclSrvcUuid)45 void onGetIncludedService(String address, int srvcType, int srvcInstId, 46 ParcelUuid srvcUuid, int inclSrvcType, 47 int inclSrvcInstId, ParcelUuid inclSrvcUuid); 48 49 /* SINCE SDK 21 */ onGetCharacteristic(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int charProps)50 void onGetCharacteristic(String address, int srvcType, 51 int srvcInstId, ParcelUuid srvcUuid, 52 int charInstId, ParcelUuid charUuid, 53 int charProps); 54 55 /* SINCE SDK 21 */ onGetDescriptor(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int descrInstId, ParcelUuid descrUuid)56 void onGetDescriptor(String address, int srvcType, 57 int srvcInstId, ParcelUuid srvcUuid, 58 int charInstId, ParcelUuid charUuid, 59 int descrInstId, ParcelUuid descrUuid); 60 61 /* SINCE SDK 21 */ onSearchComplete(String address, int status)62 void onSearchComplete(String address, int status); 63 64 /* SINCE SDK 21 */ onCharacteristicRead(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, byte[] value)65 void onCharacteristicRead(String address, int status, int srvcType, 66 int srvcInstId, ParcelUuid srvcUuid, 67 int charInstId, ParcelUuid charUuid, 68 byte[] value); 69 70 /* SINCE SDK 21 */ onCharacteristicWrite(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid)71 void onCharacteristicWrite(String address, int status, int srvcType, 72 int srvcInstId, ParcelUuid srvcUuid, 73 int charInstId, ParcelUuid charUuid); 74 75 /* SINCE SDK 21 */ onExecuteWrite(String address, int status)76 void onExecuteWrite(String address, int status); 77 78 /* SINCE SDK 21 */ onDescriptorRead(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int descrInstId, ParcelUuid descrUuid, byte[] value)79 void onDescriptorRead(String address, int status, int srvcType, 80 int srvcInstId, ParcelUuid srvcUuid, 81 int charInstId, ParcelUuid charUuid, 82 int descrInstId, ParcelUuid descrUuid, 83 byte[] value); 84 85 /* SINCE SDK 21 */ onDescriptorWrite(String address, int status, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, int descrInstId, ParcelUuid descrUuid)86 void onDescriptorWrite(String address, int status, int srvcType, 87 int srvcInstId, ParcelUuid srvcUuid, 88 int charInstId, ParcelUuid charUuid, 89 int descrInstId, ParcelUuid descrUuid); 90 91 /* SINCE SDK 21 */ onNotify(String address, int srvcType, int srvcInstId, ParcelUuid srvcUuid, int charInstId, ParcelUuid charUuid, byte[] value)92 void onNotify(String address, int srvcType, 93 int srvcInstId, ParcelUuid srvcUuid, 94 int charInstId, ParcelUuid charUuid, 95 byte[] value); 96 97 /* SINCE SDK 21 */ onReadRemoteRssi(String address, int rssi, int status)98 void onReadRemoteRssi(String address, int rssi, int status); 99 100 /* SDK 21 */ onMultiAdvertiseCallback(int status, boolean isStart, AdvertiseSettings advertiseSettings)101 void onMultiAdvertiseCallback(int status, boolean isStart, 102 AdvertiseSettings advertiseSettings); 103 104 /* SDK 21 */ onConfigureMTU(String address, int mtu, int status)105 void onConfigureMTU(String address, int mtu, int status); 106 } 107