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 HARMONY_OS_LITE_WIFI_LINKED_INFO_H 37 #define HARMONY_OS_LITE_WIFI_LINKED_INFO_H 38 #include "wifi_device_config.h" 39 40 /** 41 * @brief Enumerates Wi-Fi connection states. 42 * 43 * @since 7 44 */ 45 typedef enum { 46 /** Disconnected */ 47 WIFI_DISCONNECTED, 48 /** Connected */ 49 WIFI_CONNECTED 50 } WifiConnState; 51 52 /** 53 * @brief Represents the Wi-Fi connection information. 54 * 55 * This refers to the information about the hotspot connected to this station. The information is obtained using 56 * {@link GetLinkedInfo}. 57 * 58 * @since 7 59 */ 60 typedef struct { 61 /** Service set ID (SSID). For its length, see {@link WIFI_MAX_SSID_LEN}. */ 62 char ssid[WIFI_MAX_SSID_LEN]; 63 /** Basic service set ID (BSSID). For its length, see {@link WIFI_MAC_LEN}. */ 64 unsigned char bssid[WIFI_MAC_LEN]; 65 /** Received signal strength indicator (RSSI) */ 66 int rssi; 67 /** Wi-Fi band information of hotspot */ 68 int band; 69 /** Wi-Fi frequency information of hotspot */ 70 int frequency; 71 /** Wi-Fi connection state, which is defined in {@link WifiConnState} */ 72 WifiConnState connState; 73 /** Reason for Wi-Fi disconnection */ 74 unsigned short disconnectedReason; 75 /** IP address of the connected hotspot */ 76 unsigned int ipAddress; 77 } WifiLinkedInfo; 78 #endif // HARMONY_OS_LITE_WIFI_LINKED_INFO_H 79 /** @} */ 80