1/*
2 * Copyright (c) 2024 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 WIFI_EXT_IFACE_H
17#define WIFI_EXT_IFACE_H
18
19#include "v1_0/ichip_iface.h"
20#include "v1_0/chip_types.h"
21#include "wifi_vendor_hal.h"
22#include "v1_0/ichip_iface_callback.h"
23#include "iface_util.h"
24
25namespace OHOS {
26namespace HDI {
27namespace Wlan {
28namespace Chip {
29namespace V1_0 {
30
31class WifiExtIface : public IChipIface {
32public:
33    WifiExtIface(const std::string& ifName, const std::weak_ptr<WifiVendorHal> vendorHal,
34        const std::weak_ptr<IfaceUtil> ifaceUtil);
35    void Invalidate();
36    bool IsValid();
37    std::string GetName();
38    int32_t GetIfaceName(std::string& name) override;
39    int32_t GetIfaceType(IfaceType& type) override;
40    int32_t GetSupportFreqs(int band, std::vector<uint32_t>& frequencies) override;
41    int32_t GetIfaceCap(uint32_t& capabilities) override;
42    int32_t SetMacAddress(const std::string& mac) override;
43    int32_t SetCountryCode(const std::string& code) override;
44    int32_t GetPowerMode(int32_t& powerMode) override;
45    int32_t SetPowerMode(int32_t powerMode) override;
46    int32_t RegisterChipIfaceCallBack(const sptr<IChipIfaceCallback>& chipIfaceCallback) override;
47    int32_t UnRegisterChipIfaceCallBack(const sptr<IChipIfaceCallback>& chipIfaceCallback) override;
48    int32_t StartScan(const ScanParams& scanParam) override;
49    int32_t GetScanInfos(std::vector<ScanResultsInfo>& scanResultsInfo) override;
50    int32_t StartPnoScan(const PnoScanParams& pnoParams) override;
51    int32_t StopPnoScan() override;
52    int32_t GetSignalPollInfo(SignalPollResult& signalPollResult) override;
53    int32_t EnablePowerMode(int32_t mode) override;
54    int32_t SetDpiMarkRule(int32_t uid, int32_t protocol, int32_t enable) override;
55    int32_t SetTxPower(int32_t power) override;
56    int32_t SetIfaceState(bool state) override;
57    int32_t SendCmdToDriver(const std::string& ifName, int32_t cmdId, const std::vector<int8_t>& paramBuf) override;
58    int32_t SendActionFrame(const std::string& ifName, uint32_t freq, const std::vector<uint8_t>& frameData) override;
59    int32_t RegisterActionFrameReceiver(const std::string& ifName, const std::vector<uint8_t>& match) override;
60    int32_t GetCoexictenceChannelList(const std::string& ifName, std::vector<uint8_t>& paramBuf) override;
61
62private:
63    std::string ifName_;
64    std::weak_ptr<WifiVendorHal> vendorHal_;
65    std::weak_ptr<IfaceUtil> ifaceUtil_;
66    bool isValid_;
67};
68
69}
70}
71}
72}
73}
74#endif