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_PROXY_H 17 #define OHOS_BLUETOOTH_STANDARD_GATT_CLIENT_CALLBACK_PROXY_H 18 19 #include "iremote_proxy.h" 20 #include "i_bluetooth_gatt_client_callback.h" 21 22 namespace OHOS { 23 namespace Bluetooth { 24 class BluetoothGattClientCallbackProxy : public IRemoteProxy<IBluetoothGattClientCallback> { 25 public: BluetoothGattClientCallbackProxy(const sptr<IRemoteObject> & impl)26 explicit BluetoothGattClientCallbackProxy(const sptr<IRemoteObject> &impl) 27 : IRemoteProxy<IBluetoothGattClientCallback>(impl) {} ~BluetoothGattClientCallbackProxy()28 ~BluetoothGattClientCallbackProxy() {} 29 30 void OnConnectionStateChanged(int32_t state, int32_t newState) override; 31 void OnCharacteristicChanged(const BluetoothGattCharacteristic &characteristic) override; 32 void OnCharacteristicRead(int32_t ret, const BluetoothGattCharacteristic &characteristic) override; 33 void OnCharacteristicWrite(int32_t ret, const BluetoothGattCharacteristic &characteristic) override; 34 void OnDescriptorRead(int32_t ret, const BluetoothGattDescriptor &descriptor) override; 35 void OnDescriptorWrite(int32_t ret, const BluetoothGattDescriptor &descriptor) override; 36 void OnMtuChanged(int32_t state, int32_t mtu) override; 37 void OnServicesDiscovered(int32_t status) override; 38 void OnConnectionParameterChanged(int32_t interval, int32_t latency, int32_t timeout, int32_t status) override; 39 void OnServicesChanged(std::vector<BluetoothGattService> &service) override; 40 void OnReadRemoteRssiValue(const bluetooth::RawAddress &addr, int rssi, int status) override; 41 42 private: 43 static inline BrokerDelegator<BluetoothGattClientCallbackProxy> delegator_; 44 }; 45 } // namespace Bluetooth 46 } // namespace OHOS 47 #endif // OHOS_BLUETOOTH_STANDARD_GATT_CLIENT_CALLBACK_PROXY_H