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 * @brief wlan hal start pno scan. 90 * 91 * @param ifName The interface name. 92 * @param pnoSettings pno scan parameters. 93 * 94 * @return Returns <b>0</b> if starting pno scan is successfully; returns a negative value otherwise. 95 * 96 * @since 4.0 97 * @version 1.1 98 */ 99 int32_t (*startPnoScan)(const char *ifName, const WifiPnoSettings *pnoSettings); 100 101 /** 102 * @brief wlan hal start pno scan. 103 * 104 * @param ifName The interface name. 105 * 106 * @return Returns <b>0</b> if stopping pno scan is successfully; returns a negative value otherwise. 107 * 108 * @since 4.0 109 * @version 1.1 110 */ 111 int32_t (*stopPnoScan)(const char *ifName); 112 113 /** 114 * @brief wlan hal get signal information. 115 * 116 * @param ifName The interface name. 117 * @param signalResult Signal information obtained. 118 * 119 * @return Returns <b>0</b> if getting signal information is successfully; returns a negative value otherwise. 120 * 121 * @since 4.0 122 * @version 1.1 123 */ 124 int32_t (*getSignalPollInfo)(const char *ifName, struct SignalResult *signalResult); 125 }; 126 127 /** 128 * @brief Initializes a specified STA feature. This function is called during STA {@link FeatureType} creation. 129 * 130 * @param fe Indicates the double pointer to the STA feature. 131 * 132 * @return Returns <b>0</b> if the operation is successful; returns a negative value representing {@link HDF_STATUS} 133 * if the operation fails. 134 * 135 * @since 1.0 136 * @version 1.0 137 */ 138 int32_t InitStaFeature(struct IWiFiSta **fe); 139 140 #ifdef __cplusplus 141 #if __cplusplus 142 } 143 #endif 144 #endif 145 146 #endif 147 /** @} */ 148