1 /*
2  * Copyright (c) 2020 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 wifiservice
18  * @{
19  *
20  * @brief Provides functions for the Wi-Fi station and hotspot modes.
21  *
22  * You can use this module to enable and disable the Wi-Fi station or hotspot mode, connect to and disconnect from a
23  * station or hotspot, query the station or hotspot status, and listen for events. \n
24  *
25  * @since 7
26  */
27 
28 /**
29  * @file wifi_scan_info.h
30  *
31  * @brief Defines the data structure and macro of the Wi-Fi scan result information.
32  *
33  * @since 7
34  */
35 
36 #ifndef WIFI_SCAN_INFO_C_H
37 #define WIFI_SCAN_INFO_C_H
38 
39 #include <stdint.h>
40 #include "wifi_device_config.h"
41 
42 /**
43  * @brief Indicates the maximum number of hotspots that can be detected in a Wi-Fi scan.
44  */
45 #define WIFI_SCAN_HOTSPOT_LIMIT 128
46 
47 typedef enum {
48     WIDTH_20MHZ = 0,
49     WIDTH_40MHZ = 1,
50     WIDTH_80MHZ = 2,
51     WIDTH_160MHZ = 3,
52     WIDTH_80MHZ_PLUS = 4,
53     WIDTH_INVALID
54 } WifiChannelWidth;
55 
56 /**
57  * @brief Represents the Wi-Fi scan result information.
58  *
59  * @since 7
60  */
61 typedef struct {
62     /** Service set ID (SSID). For its length, see {@link WIFI_MAX_SSID_LEN}. */
63     char ssid[WIFI_MAX_SSID_LEN];
64     /** Basic service set ID (BSSID). For its length, see {@link WIFI_MAC_LEN}. */
65     unsigned char bssid[WIFI_MAC_LEN];
66     /* address type */
67     int bssidType;
68     /** Security type. For details, see {@link WifiSecurityType}. */
69     int securityType;
70     /** Received signal strength indicator (RSSI) */
71     int rssi;
72     /** Frequency band */
73     int band;
74     /** Frequency in MHz */
75     int frequency;
76     /** Wifi channel width. For details, see {@link WifiChannelWidth}. */
77     WifiChannelWidth channelWidth;
78     /** Center frequency in MHz */
79     int centerFrequency0;
80     /** Center frequency in MHz */
81     int centerFrequency1;
82     /** Time stamp */
83     int64_t timestamp;
84 } WifiScanInfo;
85 
86 #endif // WIFI_SCAN_INFO_C_H
87 /** @} */
88