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