• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 /**
17  * @addtogroup WLAN
18  * @{
19  *
20  * @brief Provides cross-OS migration, component adaptation, and modular assembly and compilation.
21  *
22  * Based on the unified APIs provided by the WLAN module, developers of the Hardware Driver Interface
23  * (HDI) are capable of creating, disabling, scanning for, and connecting to WLAN hotspots, managing WLAN chips,
24  * network devices, and power, and applying for, releasing, and moving network data buffers.
25  *
26  * @since 1.0
27  * @version 1.0
28  */
29 
30 /**
31  * @file wifi_hal_sta_feature.h
32  *
33  * @brief Declares WLAN station (STA) features.
34  *
35  * @since 1.0
36  * @version 1.0
37  */
38 
39 #ifndef WIFI_HAL_STA_FEATURE_H
40 #define WIFI_HAL_STA_FEATURE_H
41 
42 #include "wifi_hal_base_feature.h"
43 #include "wifi_driver_client.h"
44 
45 #ifdef __cplusplus
46 #if __cplusplus
47 extern "C" {
48 #endif
49 #endif
50 
51 /**
52  * @brief Inherits the basic features of {@link IWiFiBaseFeature} and additionally provides the feature of setting
53  * scanning for a single MAC address.
54  *
55  * @since 1.0
56  * @version 1.0
57  */
58 struct IWiFiSta {
59     struct IWiFiBaseFeature baseFeature;  /**< Basic features of {@link IWiFiBaseFeature} */
60 
61     /**
62      * @brief Sets scanning for a single MAC address.
63      *
64      * @param staFeature Indicates the pointer to the STA feature, as described in {@link IWiFiSta}.
65      * @param scanMac Indicates the pointer to the MAC address to scan for.
66      * @param len Indicates the length of the MAC address.
67      *
68      * @return Returns <b>0</b> if scanning for the MAC address is successfully set; returns a negative value otherwise.
69      *
70      * @since 1.0
71      * @version 1.0
72      */
73     int32_t (*setScanningMacAddress)(const struct IWiFiSta *staFeature, unsigned char *scanMac, uint8_t len);
74 
75     /**
76      * @brief wlan hal start scan.
77      *
78      * @param ifName The interface name.
79      * @param scan start scan with param.
80      *
81      * @return Returns <b>0</b> if start scan is successfully; returns a negative value otherwise.
82      *
83      * @since 1.0
84      * @version 1.0
85      */
86     int32_t (*startScan)(const char *ifName, WifiScan *scan);
87 };
88 
89 /**
90  * @brief Initializes a specified STA feature. This function is called during STA {@link FeatureType} creation.
91  *
92  * @param fe Indicates the double pointer to the STA feature.
93  *
94  * @return Returns <b>0</b> if the operation is successful; returns a negative value representing {@link HDF_STATUS}
95  * if the operation fails.
96  *
97  * @since 1.0
98  * @version 1.0
99  */
100 int32_t InitStaFeature(struct IWiFiSta **fe);
101 
102 #ifdef __cplusplus
103 #if __cplusplus
104 }
105 #endif
106 #endif
107 
108 #endif
109 /** @} */
110