/* * Copyright (c) 2024 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ #ifndef WIFI_P2P_IFACE_H #define WIFI_P2P_IFACE_H #include "v1_0/ichip_iface.h" #include "v1_0/chip_types.h" #include "wifi_vendor_hal.h" #include "v1_0/ichip_iface_callback.h" #include "iface_util.h" namespace OHOS { namespace HDI { namespace Wlan { namespace Chip { namespace V1_0 { class WifiP2pIface : public IChipIface { public: WifiP2pIface(const std::string& ifname, const std::weak_ptr vendorHal, const std::weak_ptr ifaceUtil); void Invalidate(); bool IsValid(); std::string GetName(); int32_t GetIfaceName(std::string& name) override; int32_t GetIfaceType(IfaceType& type) override; int32_t GetSupportFreqs(int band, std::vector& frequencies) override; int32_t GetIfaceCap(uint32_t& capabilities) override; int32_t SetMacAddress(const std::string& mac) override; int32_t SetCountryCode(const std::string& code) override; int32_t GetPowerMode(int32_t& powerMode) override; int32_t SetPowerMode(int32_t powerMode) override; int32_t RegisterChipIfaceCallBack(const sptr& chipIfaceCallback) override; int32_t UnRegisterChipIfaceCallBack(const sptr& chipIfaceCallback) override; int32_t StartScan(const ScanParams& scanParam) override; int32_t GetScanInfos(std::vector& scanResultsInfo) override; int32_t StartPnoScan(const PnoScanParams& pnoParams) override; int32_t StopPnoScan() override; int32_t GetSignalPollInfo(SignalPollResult& signalPollResult) override; int32_t EnablePowerMode(int32_t mode) override; int32_t SetDpiMarkRule(int32_t uid, int32_t protocol, int32_t enable) override; int32_t SetTxPower(int32_t power) override; int32_t SetIfaceState(bool state) override; private: std::string ifname_; std::vector instances_; std::weak_ptr vendorHal_; std::weak_ptr ifaceUtil_; bool isValid_; }; } } } } } #endif