• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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_linked_info.h
30  *
31  * @brief Defines the data structure and macro of the Wi-Fi connection information.
32  *
33  * @since 7
34  */
35 
36 #ifndef WIFI_LITE_WIFI_LINKED_INFO_H
37 #define WIFI_LITE_WIFI_LINKED_INFO_H
38 #include "wifi_device_config.h"
39 #include "wifi_scan_info.h"
40 
41 /**
42  * @brief Enumerates Wi-Fi connection states.
43  *
44  * @since 7
45  */
46 typedef enum {
47     /** Disconnected */
48     WIFI_DISCONNECTED,
49     /** Connected */
50     WIFI_CONNECTED
51 } WifiConnState;
52 
53 /**
54  * @brief Represents the Wi-Fi connection information.
55  *
56  * This refers to the information about the hotspot connected to this station. The information is obtained using
57  * {@link GetLinkedInfo}.
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     /** Received signal strength indicator (RSSI) */
67     int rssi;
68     /** Wi-Fi band information of hotspot */
69     int band;
70     /** Wi-Fi frequency information of hotspot */
71     int frequency;
72     /** Wi-Fi connection state, which is defined in {@link WifiConnState} */
73     WifiConnState connState;
74     /** Reason for Wi-Fi disconnection */
75     unsigned short disconnectedReason;
76     /** IP address of the connected hotspot */
77     unsigned int ipAddress;
78     unsigned int wifiStandard;
79     int maxSupportedRxLinkSpeed;
80     int maxSupportedTxLinkSpeed;
81     /* Downstream network speed */
82     int rxLinkSpeed;
83     /* Upstream network speed */
84     int txLinkSpeed;
85     WifiChannelWidth channelWidth; /* curr ap channel width */
86 } WifiLinkedInfo;
87 #endif // WIFI_LITE_WIFI_LINKED_INFO_H
88 /** @} */
89