1 /*
2  * Copyright (C) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef OHOS_BLUETOOTH_STANDARD_GATT_CLIENT_CALLBACK_INTERFACE_H
17 #define OHOS_BLUETOOTH_STANDARD_GATT_CLIENT_CALLBACK_INTERFACE_H
18 
19 #include "iremote_broker.h"
20 #include "../parcel/bluetooth_gatt_characteristic_parcel.h"
21 #include "../parcel/bluetooth_gatt_descriptor_parcel.h"
22 #include "../parcel/bluetooth_gatt_service_parcel.h"
23 #include "bluetooth_service_ipc_interface_code.h"
24 #include "../common/raw_address.h"
25 
26 namespace OHOS {
27 namespace Bluetooth {
28 class IBluetoothGattClientCallback : public OHOS::IRemoteBroker {
29 public:
30     DECLARE_INTERFACE_DESCRIPTOR(u"ohos.ipc.IBluetoothGattClientCallback");
31 
32     virtual void OnConnectionStateChanged(int32_t state, int32_t newState) = 0;
33     virtual void OnCharacteristicChanged(const BluetoothGattCharacteristic &characteristic) = 0;
34     virtual void OnCharacteristicRead(int32_t ret, const BluetoothGattCharacteristic &characteristic) = 0;
35     virtual void OnCharacteristicWrite(int32_t ret, const BluetoothGattCharacteristic &characteristic) = 0;
36     virtual void OnDescriptorRead(int32_t ret, const BluetoothGattDescriptor &descriptor) = 0;
37     virtual void OnDescriptorWrite(int32_t ret, const BluetoothGattDescriptor &descriptor) = 0;
38     virtual void OnMtuChanged(int32_t state, int32_t mtu) = 0;
39     virtual void OnServicesDiscovered(int32_t status) = 0;
40     virtual void OnConnectionParameterChanged(int32_t interval, int32_t latency, int32_t timeout, int32_t status) = 0;
41     virtual void OnServicesChanged(std::vector<BluetoothGattService> &service) = 0;
42     virtual void OnReadRemoteRssiValue(const bluetooth::RawAddress &addr, int rssi, int status) = 0;
43 };
44 }  // namespace Bluetooth
45 }  // namespace OHOS
46 #endif  // OHOS_BLUETOOTH_STANDARD_GATT_CLIENT_CALLBACK_INTERFACE_H