1 /* 2 * Copyright (C) 2022 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 /** 17 * @addtogroup Bluetooth 18 * @{ 19 * 20 * @brief Defines pan service interface, including observer and api functions. 21 * 22 */ 23 24 /** 25 * @file interface_profile_pan.h 26 * 27 * @brief pan interface. 28 * 29 */ 30 31 #ifndef INTERFACE_PROFILE_PAN_H 32 #define INTERFACE_PROFILE_PAN_H 33 34 #include "interface_profile.h" 35 36 namespace OHOS { 37 namespace bluetooth { 38 /** 39 * @brief pan observer for framework api 40 * 41 */ 42 class IPanObserver { 43 public: 44 /** 45 * @brief Destroy the IPanObserver object 46 * 47 */ 48 virtual ~IPanObserver() = default; 49 /** 50 * @brief ConnectionState Changed 51 * 52 * @param deviceAddress bluetooth address 53 * @param state changed status 54 */ OnConnectionStateChanged(const RawAddress & deviceAddress,int state)55 virtual void OnConnectionStateChanged(const RawAddress &deviceAddress, int state) {} 56 }; 57 58 class IProfilePan : public IProfile { 59 public: 60 /** 61 * @brief register observer 62 * 63 * @param observer function pointer 64 */ 65 virtual void RegisterObserver(IPanObserver &observer) = 0; 66 /** 67 * @brief deregister observer 68 * 69 * @param observer function pointer 70 */ 71 virtual void DeregisterObserver(IPanObserver &observer) = 0; 72 /** 73 * @brief Get remote AG device list which are in the specified states. 74 * 75 * @param states List of remote device states. 76 * @return Returns the list of devices. 77 */ 78 virtual std::vector<RawAddress> GetDevicesByStates(std::vector<int> states) = 0; 79 80 /** 81 * @brief Get the connection state of the specified remote device. 82 * 83 * @param device Remote device object. 84 * @return Returns the connection state of the remote device. 85 */ 86 virtual int GetDeviceState(const RawAddress &device) = 0; 87 88 virtual bool SetTethering(const bool enable) = 0; 89 virtual bool IsTetheringOn() = 0; 90 }; 91 } // namespace bluetooth 92 } // namespace OHOS 93 #endif // INTERFACE_PROFILE_PAN_H