1094332d3Sopenharmony_ci/* 2094332d3Sopenharmony_ci * Copyright (c) 2021 Huawei Device Co., Ltd. 3094332d3Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 4094332d3Sopenharmony_ci * you may not use this file except in compliance with the License. 5094332d3Sopenharmony_ci * You may obtain a copy of the License at 6094332d3Sopenharmony_ci * 7094332d3Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 8094332d3Sopenharmony_ci * 9094332d3Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 10094332d3Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 11094332d3Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12094332d3Sopenharmony_ci * See the License for the specific language governing permissions and 13094332d3Sopenharmony_ci * limitations under the License. 14094332d3Sopenharmony_ci */ 15094332d3Sopenharmony_ci 16094332d3Sopenharmony_ci/** 17094332d3Sopenharmony_ci * @addtogroup WLAN 18094332d3Sopenharmony_ci * @{ 19094332d3Sopenharmony_ci * 20094332d3Sopenharmony_ci * @brief Provides cross-OS migration, component adaptation, and modular assembly and compilation. 21094332d3Sopenharmony_ci * 22094332d3Sopenharmony_ci * Based on the unified APIs provided by the WLAN module, developers of the Hardware Driver Interface 23094332d3Sopenharmony_ci * (HDI) are capable of creating, disabling, scanning for, and connecting to WLAN hotspots, managing WLAN chips, 24094332d3Sopenharmony_ci * network devices, and power, and applying for, releasing, and moving network data buffers. 25094332d3Sopenharmony_ci * 26094332d3Sopenharmony_ci * @since 1.0 27094332d3Sopenharmony_ci * @version 1.0 28094332d3Sopenharmony_ci */ 29094332d3Sopenharmony_ci 30094332d3Sopenharmony_ci/** 31094332d3Sopenharmony_ci * @file wifi_hal_ap_feature.h 32094332d3Sopenharmony_ci * 33094332d3Sopenharmony_ci * @brief Declares WLAN access point (AP) features. 34094332d3Sopenharmony_ci * 35094332d3Sopenharmony_ci * @since 1.0 36094332d3Sopenharmony_ci * @version 1.0 37094332d3Sopenharmony_ci */ 38094332d3Sopenharmony_ci 39094332d3Sopenharmony_ci#ifndef WIFI_HAL_AP_FEATURE_H 40094332d3Sopenharmony_ci#define WIFI_HAL_AP_FEATURE_H 41094332d3Sopenharmony_ci 42094332d3Sopenharmony_ci#include "wifi_hal_base_feature.h" 43094332d3Sopenharmony_ci 44094332d3Sopenharmony_ci#ifdef __cplusplus 45094332d3Sopenharmony_ci#if __cplusplus 46094332d3Sopenharmony_ciextern "C" { 47094332d3Sopenharmony_ci#endif 48094332d3Sopenharmony_ci#endif 49094332d3Sopenharmony_ci 50094332d3Sopenharmony_ci/** 51094332d3Sopenharmony_ci * @brief Describes an STA connected to an AP. 52094332d3Sopenharmony_ci * 53094332d3Sopenharmony_ci * @since 1.0 54094332d3Sopenharmony_ci * @version 1.0 55094332d3Sopenharmony_ci */ 56094332d3Sopenharmony_cistruct StaInfo { 57094332d3Sopenharmony_ci unsigned char mac[WIFI_MAC_ADDR_LENGTH]; /**< MAC address of the STA */ 58094332d3Sopenharmony_ci}; 59094332d3Sopenharmony_ci 60094332d3Sopenharmony_ci/** 61094332d3Sopenharmony_ci * @brief Inherits the basic features of {@link IWiFiBaseFeature} and additionally provides the features of 62094332d3Sopenharmony_ci * obtaining information about all the STAs connected to an AP and setting the country/region code. 63094332d3Sopenharmony_ci * 64094332d3Sopenharmony_ci * @since 1.0 65094332d3Sopenharmony_ci * @version 1.0 66094332d3Sopenharmony_ci */ 67094332d3Sopenharmony_cistruct IWiFiAp { 68094332d3Sopenharmony_ci struct IWiFiBaseFeature baseFeature; /**< Basic features of {@link IWiFiBaseFeature} */ 69094332d3Sopenharmony_ci 70094332d3Sopenharmony_ci /** 71094332d3Sopenharmony_ci * @brief Obtains information (MAC addresses only in the current version) about all the connected STAs. 72094332d3Sopenharmony_ci * 73094332d3Sopenharmony_ci * @param apFeature Indicates the pointer to the AP feature, as described in {@link IWiFiAp}. 74094332d3Sopenharmony_ci * @param staInfo Indicates the pointer to the information about the STAs connected to the AP. 75094332d3Sopenharmony_ci * @param count Indicates the number of elements in the staInfo structure array. 76094332d3Sopenharmony_ci * @param num Indicates the pointer to the number of connected STAs. 77094332d3Sopenharmony_ci * 78094332d3Sopenharmony_ci * @return Returns <b>0</b> if the information is obtained; returns a negative value otherwise. 79094332d3Sopenharmony_ci * 80094332d3Sopenharmony_ci * @since 1.0 81094332d3Sopenharmony_ci * @version 1.0 82094332d3Sopenharmony_ci */ 83094332d3Sopenharmony_ci int32_t (*getAssociatedStas)(const struct IWiFiAp *apFeature, struct StaInfo *staInfo, 84094332d3Sopenharmony_ci uint32_t count, uint32_t *num); 85094332d3Sopenharmony_ci 86094332d3Sopenharmony_ci /** 87094332d3Sopenharmony_ci * @brief Sets the country/region code. 88094332d3Sopenharmony_ci * 89094332d3Sopenharmony_ci * @param apFeature Indicates the pointer to the AP feature, as described in {@link IWiFiAp}. 90094332d3Sopenharmony_ci * @param code Indicates the pointer to the country/region code to set. 91094332d3Sopenharmony_ci * @param len Indicates the length of the country/region code. 92094332d3Sopenharmony_ci * 93094332d3Sopenharmony_ci * @return Returns <b>0</b> if the country/region code is set; returns a negative value otherwise. 94094332d3Sopenharmony_ci * 95094332d3Sopenharmony_ci * @since 1.0 96094332d3Sopenharmony_ci * @version 1.0 97094332d3Sopenharmony_ci */ 98094332d3Sopenharmony_ci int32_t (*setCountryCode)(const struct IWiFiAp *apFeature, const char *code, uint32_t len); 99094332d3Sopenharmony_ci 100094332d3Sopenharmony_ci /** 101094332d3Sopenharmony_ci * @brief Obtain ap current bandwidth. 102094332d3Sopenharmony_ci * 103094332d3Sopenharmony_ci * @param ifName Indicates the NIC name. 104094332d3Sopenharmony_ci * @param bandwidth ap current bandwidth, 1(20M), 2(40M), 4(80M), 8(160M). 105094332d3Sopenharmony_ci * 106094332d3Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful. 107094332d3Sopenharmony_ci * @return Returns a negative value if the operation fails. 108094332d3Sopenharmony_ci * 109094332d3Sopenharmony_ci * @since 4.1 110094332d3Sopenharmony_ci * @version 1.2 111094332d3Sopenharmony_ci */ 112094332d3Sopenharmony_ci int32_t (*getApBandwidth)(const char *ifName, uint8_t *bandwidth); 113094332d3Sopenharmony_ci}; 114094332d3Sopenharmony_ci 115094332d3Sopenharmony_ci/** 116094332d3Sopenharmony_ci * @brief Initializes a specified AP feature. This function is called during AP {@link FeatureType} creation. 117094332d3Sopenharmony_ci * 118094332d3Sopenharmony_ci * @param fe Indicates the double pointer to the AP feature. 119094332d3Sopenharmony_ci * 120094332d3Sopenharmony_ci * @return Returns <b>0</b> if the operation is successful; returns a negative value representing {@link HDF_STATUS} 121094332d3Sopenharmony_ci * if the operation fails. 122094332d3Sopenharmony_ci * 123094332d3Sopenharmony_ci * @since 1.0 124094332d3Sopenharmony_ci * @version 1.0 125094332d3Sopenharmony_ci */ 126094332d3Sopenharmony_ciint32_t InitApFeature(struct IWiFiAp **fe); 127094332d3Sopenharmony_ci 128094332d3Sopenharmony_ci#ifdef __cplusplus 129094332d3Sopenharmony_ci#if __cplusplus 130094332d3Sopenharmony_ci} 131094332d3Sopenharmony_ci#endif 132094332d3Sopenharmony_ci#endif 133094332d3Sopenharmony_ci 134094332d3Sopenharmony_ci#endif 135094332d3Sopenharmony_ci/** @} */ 136