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 GATT_CONNECTION_OBSERVER_H 17 #define GATT_CONNECTION_OBSERVER_H 18 19 #include <cstdint> 20 #include "gatt_data.h" 21 22 namespace OHOS { 23 namespace bluetooth { 24 class GattConnectionObserver { 25 public: OnConnect(const GattDevice & device,uint16_t connectionHandle,int ret)26 virtual void OnConnect(const GattDevice &device, uint16_t connectionHandle, int ret) 27 {} OnDisconnect(const GattDevice & device,uint16_t connectionHandle,int ret)28 virtual void OnDisconnect(const GattDevice &device, uint16_t connectionHandle, int ret) 29 {} OnConnectionChanged(const GattDevice & device,uint16_t connectionHandle,int state)30 virtual void OnConnectionChanged(const GattDevice &device, uint16_t connectionHandle, int state) 31 {} OnConnectionParameterChanged(const GattDevice & device,int interval,int latency,int timeout,int status)32 virtual void OnConnectionParameterChanged( 33 const GattDevice &device, int interval, int latency, int timeout, int status) 34 {} 35 OnReconnect(const GattDevice & device,uint16_t connectionHandle,int ret)36 virtual void OnReconnect(const GattDevice &device, uint16_t connectionHandle, int ret) 37 {} 38 OnDisconnectInter(const GattDevice & device,uint16_t connectionHandle,int ret)39 virtual void OnDisconnectInter(const GattDevice &device, uint16_t connectionHandle, int ret) 40 {} 41 OnShutDown()42 virtual void OnShutDown() 43 {} ~GattConnectionObserver()44 virtual ~GattConnectionObserver() 45 {} 46 }; 47 } // namespace bluetooth 48 } // namespace OHOS 49 50 #endif // GATT_CONNECTION_OBSERVER_H 51