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_FEATURE_FLAGS_H
17 #define WIFI_FEATURE_FLAGS_H
18 
19 #include "v1_0/ichip_controller.h"
20 #include "v1_0/chip_types.h"
21 #include <string>
22 #include "wifi_vendor_hal.h"
23 
24 #define SUBCHIP_PROP "ohos.boot.odm.conn.schiptype"
25 #define PROP_SUBCHIPTYPE_LEN 10
26 #define SUPPORT_COEXCHIP ""
27 #define PROP_MAX_LEN 128
28 
29 namespace OHOS {
30 namespace HDI {
31 namespace Wlan {
32 namespace Chip {
33 namespace V1_0 {
34 
35 namespace chip_mode_ids {
36 constexpr int32_t K_INVALID = UINT32_MAX;
37 constexpr int32_t K_V1_STA = 0;
38 constexpr int32_t K_V1_AP = 1;
39 constexpr int32_t K_V3 = 3;
40 }
41 
42 class WifiChipModes {
43 public:
44     explicit WifiChipModes(const std::weak_ptr<WifiVendorHal> vendorHal);
45     virtual ~WifiChipModes() = default;
46     virtual std::vector<UsableMode> GetChipModes(
47         bool isPrimary);
48 
49 private:
50     std::vector<UsableMode> GetChipModesForPrimary();
51     std::vector<UsableMode> GetChipModesForTriple();
52     UsableMode MakeComModes(int staNum, int apNum, int p2pNum, int modeId);
53     std::weak_ptr<WifiVendorHal> vendorHal_;
54 };
55 }
56 }
57 }
58 }
59 }
60 
61 #endif