1 /* 2 * Copyright (C) 2023 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 OHOS_WIFI_HDI_UTIL_H 17 #define OHOS_WIFI_HDI_UTIL_H 18 19 #include "wifi_hdi_struct.h" 20 #include "wifi_common_def.h" 21 #include "wifi_hdi_common.h" 22 #include "i_wifi_struct.h" 23 24 #ifdef __cplusplus 25 extern "C" { 26 #endif 27 28 int Get80211ElemsFromIE(const uint8_t *start, size_t len, struct HdiElems *elems, 29 int show); 30 31 int GetScanResultText(const struct WifiScanResultExt *scanResults, 32 struct HdiElems *elems, char* buff, int buffLen); 33 34 int DelScanInfoLine(ScanInfo *pcmd, char *srcBuf, int length); 35 36 /** 37 * @Description Convert [a,b,c,d,e,f] mac address to string type [xx:xx:xx:xx:xx:xx] 38 * 39 * @param srcMac - srcMac address 40 * @param srcMacSize - srcMacSize size, must be equal to 6, or error 41 * @param DesMacStr - output mac string, type: [xx:xx:xx:xx:xx:xx] 42 * @param strLen - mac string length, must be bigger than 17 43 * @return int - return result. 0 is Failed ,1 is Success 44 */ 45 int ConvertMacArr2String(const unsigned char *srcMac, int srcMacSize, char *destMacStr, int strLen); 46 47 /** 48 * @Description Get ie from scan result 49 * 50 * @param scanInfo - output scan info 51 * @param start - ie point 52 * @param len - ie length 53 */ 54 void GetScanResultInfoElem(ScanInfo *scanInfo, const uint8_t *start, size_t len); 55 56 int RouterSupportHiLinkByWifiInfo(const uint8_t *start, size_t len); 57 58 #ifdef __cplusplus 59 } 60 #endif 61 #endif