diff --git a/en/application-dev/reference/apis/js-apis-wifi.md b/en/application-dev/reference/apis/js-apis-wifi.md
index 602a3b7e2a318119b1e8dbfa80a59fdc65a6bede..56d6651f6d811ae23bc6e831dbeb95b929e06a7c 100644
--- a/en/application-dev/reference/apis/js-apis-wifi.md
+++ b/en/application-dev/reference/apis/js-apis-wifi.md
@@ -1,4 +1,5 @@
# WLAN
+The WLAN module provides basic wireless local area network (WLAN) functions, peer-to-peer (P2P) functions, and WLAN message notification services. It allows applications to communicate with other devices over WLAN.
> **NOTE**
> The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version.
@@ -10,11 +11,45 @@
import wifi from '@ohos.wifi';
```
+## wifi.enableWifi
+
+enableWifi(): boolean
+
+Enables WLAN.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.disableWifi
+
+disableWifi(): boolean
+
+Disables WLAN.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
## wifi.isWifiActive
isWifiActive(): boolean
-Checks whether the WLAN is activated.
+Checks whether WLAN is enabled.
**Required permissions**: ohos.permission.GET_WIFI_INFO
@@ -23,7 +58,7 @@ Checks whether the WLAN is activated.
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| boolean | Returns **true** if the WLAN is activated; returns **false** otherwise.|
+| boolean | Returns **true** if WLAN is enabled; returns **false** otherwise.|
## wifi.scan
@@ -32,14 +67,14 @@ scan(): boolean
Starts a scan for WLAN.
-**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.LOCATION
+**Required permissions**: **ohos.permission.SET_WIFI_INFO** and **ohos.permission.LOCATION**
**System capability**: SystemCapability.Communication.WiFi.STA
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| boolean | Returns **true** if the scan is successful; returns **false** otherwise.|
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.getScanInfos
@@ -48,14 +83,14 @@ getScanInfos(): Promise<Array<WifiScanInfo>>
Obtains the scan result. This API uses a promise to return the result.
-**Required permissions**: at least one of ohos.permission.GET_WIFI_INFO, ohos.permission.GET_WIFI_PEERS_MAC, and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_PEERS_MAC (or ohos.permission.LOCATION)
**System capability**: SystemCapability.Communication.WiFi.STA
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| Promise< Array<[WifiScanInfo](#wifiscaninfo)> > | Promise used to return the hotspots detected.|
+| Promise< Array<[WifiScanInfo](#wifiscaninfo)> > | Promise used to return the detected hotspots.|
## wifi.getScanInfos
@@ -64,14 +99,14 @@ getScanInfos(callback: AsyncCallback<Array<WifiScanInfo>>): void
Obtains the scan result. This API uses an asynchronous callback to return the result.
-**Required permissions**: at least one of ohos.permission.GET_WIFI_INFO, ohos.permission.GET_WIFI_PEERS_MAC, and ohos.permission.LOCATION
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_PEERS_MAC (or ohos.permission.LOCATION)
**System capability**: SystemCapability.Communication.WiFi.STA
**Parameters**
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | Yes| Callback invoked to return the hotspots detected.|
+| callback | AsyncCallback< Array<[WifiScanInfo](#wifiscaninfo)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the detected hotspots. Otherwise, **err** is a non-zero value and **data** is empty.|
**Example**
```js
@@ -120,18 +155,21 @@ Obtains the scan result. This API uses an asynchronous callback to return the re
Represents WLAN hotspot information.
+**System capability**: SystemCapability.Communication.WiFi.STA
+
| **Name**| **Type**| **Readable/Writable**| **Description**|
| -------- | -------- | -------- | -------- |
| ssid | string | Read only| Hotspot service set identifier (SSID), in UTF-8 format.|
| bssid | string | Read only| Basic service set identifier (BSSID) of the hotspot.|
| capabilities | string | Read only| Hotspot capabilities.|
-| securityType | [WifiSecurityType](#WifiSecurityType) | Read only| WLAN security type.|
+| securityType | [WifiSecurityType](#wifisecuritytype) | Read only| WLAN security type.|
| rssi | number | Read only| Received signal strength indicator (RSSI) of the hotspot, in dBm.|
| band | number | Read only| Frequency band of the WLAN access point (AP).|
| frequency | number | Read only| Frequency of the WLAN AP.|
-| channelWidth | number | Read only| Bandwidth of the WLAN AP.|
-| centerFrequency0 | number | Read only| Center frequency.|
-| centerFrequency1 | number | Read only| Center frequency.|
+| channelWidth | number | Read only| Channel width of the WLAN AP.|
+| centerFrequency09+ | number | Read only| Center frequency.|
+| centerFrequency19+ | number | Read only| Center frequency.|
+| infoElems9+ | Array<[WifiInfoElem](#wifiinfoelem9)> | Read only| Information elements.|
| timestamp | number | Read only| Timestamp.|
@@ -139,55 +177,241 @@ Represents WLAN hotspot information.
Enumerates the WLAN security types.
+**System capability**: SystemCapability.Communication.WiFi.Core
+
| **Name**| **Default Value**| **Description**|
| -------- | -------- | -------- |
-| WIFI_SEC_TYPE_INVALID | 0 | Invalid security type|
-| WIFI_SEC_TYPE_OPEN | 1 | Open security type|
-| WIFI_SEC_TYPE_WEP | 2 | Wired Equivalent Privacy (WEP)|
-| WIFI_SEC_TYPE_PSK | 3 | Pre-shared key (PSK)|
-| WIFI_SEC_TYPE_SAE | 4 | Simultaneous Authentication of Equals (SAE)|
+| WIFI_SEC_TYPE_INVALID | 0 | Invalid security type.|
+| WIFI_SEC_TYPE_OPEN | 1 | Open security type.|
+| WIFI_SEC_TYPE_WEP | 2 | Wired Equivalent Privacy (WEP).|
+| WIFI_SEC_TYPE_PSK | 3 | Pre-shared key (PSK).|
+| WIFI_SEC_TYPE_SAE | 4 | Simultaneous Authentication of Equals (SAE).|
+| WIFI_SEC_TYPE_EAP9+ | 5 | Extensible Authentication protocol (EAP).|
+| WIFI_SEC_TYPE_EAP_SUITE_B9+ | 6 | Suite B 192-bit encryption.|
+| WIFI_SEC_TYPE_OWE9+ | 7 | Opportunistic Wireless Encryption (OWE).|
+| WIFI_SEC_TYPE_WAPI_CERT9+ | 8 | WLAN Authentication and Privacy Infrastructure (WAPI) in certificate-based mode (WAPI-CERT).|
+| WIFI_SEC_TYPE_WAPI_PSK9+ | 9 | WAPI-PSK.|
-## wifi.addUntrustedConfig7+
+## WifiInfoElem9+
-addUntrustedConfig(config: WifiDeviceConfig): Promise<boolean>
+Represents a WLAN information element.
-Adds untrusted WLAN configuration. This API uses a promise to return the result.
+**System capability**: SystemCapability.Communication.WiFi.STA
-**Required permissions**:
- ohos.permission.SET_WIFI_INFO
+| **Name**| **Type**| **Readable/Writable**| **Description**|
+| -------- | -------- | -------- | -------- |
+| eid | number | Read only| ID of the information element.|
+| content | Uint8Array | Read only| Content of the information element.|
-**System capability**:
- SystemCapability.Communication.WiFi.STA
+
+## WifiChannelWidth9+
+
+Enumerates the Wi-Fi channel widths.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| **Name**| **Default Value**| **Description**|
+| -------- | -------- | -------- |
+| WIDTH_20MHZ | 0 | 20 MHz.|
+| WIDTH_40MHZ | 1 | 40 MHz.|
+| WIDTH_80MHZ | 2 | 80 MHz.|
+| WIDTH_160MHZ | 3 | 160 MHz.|
+| WIDTH_80MHZ_PLUS | 4 | 80 MHz+.|
+| WIDTH_INVALID | 5 | Invalid value.|
+
+
+## wifi.getScanInfosSync9+
+
+getScanInfosSync(): Array<[WifiScanInfo](#wifiscaninfo)>
+
+Obtains the scan result. This API returns the result synchronously.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_PEERS_MAC (or ohos.permission.LOCATION)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiScanInfo](#wifiscaninfo)> | Scan result obtained.|
+
+
+## wifi.addDeviceConfig
+
+addDeviceConfig(config: WifiDeviceConfig): Promise<number>
+
+Adds network configuration. This API uses a promise to return the result.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
+
+**System capability**: SystemCapability.Communication.WiFi.STA
**Parameters**
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
-| config | [WifiDeviceConfig](#WifiDeviceConfig) | Yes| WLAN configuration to add.|
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| Promise<boolean> | Promise used to return the operation result. The value **true** indicates that the operation is successful; **false** indicates the opposite.|
+| Promise<number> | Promise used to return the WLAN configuration ID. If **-1** is returned, the operation has failed.|
## WifiDeviceConfig
Represents the WLAN configuration.
+**System capability**: SystemCapability.Communication.WiFi.STA
+
| **Name**| **Type**| **Readable/Writable**| **Description**|
| -------- | -------- | -------- | -------- |
-| ssid | string | Read only| Hotspot service set identifier (SSID), in UTF-8 format.|
+| ssid | string | Read only| SSID of the hotspot, in UTF-8 format.|
| bssid | string | Read only| BSSID of the hotspot.|
-| preSharedKey | string | Read only| Private key of the hotspot.|
+| preSharedKey | string | Read only| PSK of the hotspot.|
| isHiddenSsid | boolean | Read only| Whether to hide the network.|
-| securityType | [WifiSecurityType](#WifiSecurityType) | Read only| Security type.|
+| securityType | [WifiSecurityType](#wifisecuritytype) | Read only| Security type.|
+| creatorUid | number | Read only| User ID, which is available only to system applications.|
+| disableReason | number | Read only| Reason for disabling WLAN. This parameter is available only to system applications.|
+| netId | number | Read only| Allocated network ID, which is available only to system applications.|
+| randomMacType | number | Read only| Random MAC type, which is available only to system applications.|
+| randomMacAddr | string | Read only| Random MAC address, which is available only for system applications.|
+| ipType | [IpType](#iptype7) | Read only| IP address type, which is available only to system applications.|
+| staticIp | [IpConfig](#ipconfig7) | Read only| Static IP address configuration, which is available only to system applications.|
+| eapConfig9+ | [WifiEapConfig](#wifieapconfig9) | Read only| EAP configuration, which is available only to system applications.|
+
+
+## IpType7+
+
+Enumerate the IP address types.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| Name| Default Value| Description|
+| -------- | -------- | -------- |
+| STATIC | 0 | Static IP address.|
+| DHCP | 1 | IP address allocated by DHCP.|
+| UNKNOWN | 2 | Not specified.|
+
+
+## IpConfig7+
+
+Represents IP configuration information.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| **Name**| **Type**| **Readable/Writable**| **Description**|
+| -------- | -------- | -------- | -------- |
+| ipAddress | number | Read only| IP address.|
+| gateway | number | Read only| Gateway.|
+| dnsServers | number[] | Read only| Domain name server (DNS) information.|
+| domains | Array<string> | Read only| Domain information.|
+
+
+## WifiEapConfig9+
+
+Represents EAP configuration information.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| **Name**| **Type**| **Readable/Writable**| **Description**|
+| -------- | -------- | -------- | -------- |
+| eapMethod | [EapMethod](#eapmethod9) | Read only| EAP authentication method.|
+| phase2Method | [Phase2Method](#phase2method9) | Read only| Phase 2 authentication method.|
+| identity | string | Read only| Identity Information.|
+| anonymousIdentity | string | Read only| Anonymous identity.|
+| password | string | Read only| Password.|
+| caCertAliases | string | Read only| CA certificate alias.|
+| caPath | string | Read only| CA certificate path.|
+| clientCertAliases | string | Read only| Client certificate alias.|
+| altSubjectMatch | string | Read only| A string to match the alternate subject.|
+| domainSuffixMatch | string | Read only| A string to match the domain suffix.|
+| realm | string | Read only| Realm for the passpoint credential.|
+| plmn | string | Read only| Public land mobile network (PLMN) of the passpoint credential provider.|
+| eapSubId | number | Read only| Sub-ID of the SIM card.|
+
+
+## EapMethod9+
+
+Enumerates the EAP authentication methods.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| Name| Default Value| Description|
+| -------- | -------- | -------- |
+| EAP_NONE | 0 | Not specified.|
+| EAP_PEAP | 1 | PEAP.|
+| EAP_TLS | 2 | TLS.|
+| EAP_TTLS | 3 | TTLS.|
+| EAP_PWD | 4 | Password.|
+| EAP_SIM | 5 | SIM.|
+| EAP_AKA | 6 | AKA.|
+| EAP_AKA_PRIME | 7 | AKA Prime.|
+| EAP_UNAUTH_TLS | 8 | UNAUTH TLS.|
+
+
+## Phase2Method9+
+
+Enumerates the Phase 2 authentication methods.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| Name| Default Value| Description|
+| -------- | -------- | -------- |
+| PHASE2_NONE | 0 | Not specified.|
+| PHASE2_PAP | 1 | PAP.|
+| PHASE2_MSCHAP | 2 | MS-CHAP.|
+| PHASE2_MSCHAPV2 | 3 | MS-CHAPv2.|
+| PHASE2_GTC | 4 | GTC .|
+| PHASE2_SIM | 5 | SIM.|
+| PHASE2_AKA | 6 | AKA.|
+| PHASE2_AKA_PRIME | 7 | AKA Prime.|
+
+
+## wifi.addDeviceConfig
+
+addDeviceConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void
+
+Adds network configuration. This API uses an asynchronous callback to return the result.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
+
+
+## wifi.addUntrustedConfig7+
+
+addUntrustedConfig(config: WifiDeviceConfig): Promise<boolean>
+
+Adds the configuration of an untrusted network. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
## wifi.addUntrustedConfig7+
addUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void
-Adds untrusted WLAN configuration. This API uses an asynchronous callback to return the result.
+Adds the configuration of an untrusted network. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.SET_WIFI_INFO
@@ -196,15 +420,15 @@ Adds untrusted WLAN configuration. This API uses an asynchronous callback to ret
**Parameters**
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
-| config | [WifiDeviceConfig](#WifiDeviceConfig) | Yes| WLAN configuration to add.|
-| callback | AsyncCallback<boolean> | Yes| Callback used to return the operation result. The value **true** indicates that the operation is successful; **false** indicates the opposite.|
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
## wifi.removeUntrustedConfig7+
removeUntrustedConfig(config: WifiDeviceConfig): Promise<boolean>
-Removes untrusted WLAN configuration. This API uses a promise to return the result.
+Removes the configuration of an untrusted network. This API uses a promise to return the result.
**Required permissions**: ohos.permission.SET_WIFI_INFO
@@ -213,19 +437,19 @@ Removes untrusted WLAN configuration. This API uses a promise to return the resu
**Parameters**
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
-| config | [WifiDeviceConfig](#WifiDeviceConfig) | Yes| WLAN configuration to remove. |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| Promise<boolean> | Promise used to return the operation result. The value **true** indicates that the operation is successful; **false** indicates the opposite.|
+| Promise<boolean> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
## wifi.removeUntrustedConfig7+
removeUntrustedConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void
-Removes untrusted WLAN configuration. This API uses an asynchronous callback to return the result.
+Removes the configuration of an untrusted network. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.SET_WIFI_INFO
@@ -234,8 +458,186 @@ Removes untrusted WLAN configuration. This API uses an asynchronous callback to
**Parameters**
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
-| config | [WifiDeviceConfig](#WifiDeviceConfig) | Yes| WLAN configuration to remove. |
-| callback | AsyncCallback<boolean> | Yes| Callback used to return the operation result. The value **true** indicates that the operation is successful; **false** indicates the opposite.|
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
+| callback | AsyncCallback<boolean> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
+
+
+## wifi.addCandidateConfig9+
+
+addCandidateConfig(config: WifiDeviceConfig): Promise<number>
+
+Adds the configuration of a candidate network. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<number> | Promise used to return the network configuration ID.|
+
+
+## wifi.addCandidateConfig9+
+
+addCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback<number>): void
+
+Adds the configuration of a candidate network. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
+| callback | AsyncCallback<number> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the network configuration ID. If **data** is **-1**, the operation has failed. If **err** is not **0**, an error has occurred.|
+
+
+## wifi.removeCandidateConfig9+
+
+removeCandidateConfig(config: WifiDeviceConfig): Promise<boolean>
+
+Removes the configuration of a candidate network. This API uses a promise to return the result.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| Promise<void> | Promise used to return the result. If the operation is successful, **true** is returned; otherwise, **false** is returned.|
+
+
+## wifi.removeCandidateConfig9+
+
+removeCandidateConfig(config: WifiDeviceConfig, callback: AsyncCallback<boolean>): void
+
+Removes the configuration of a candidate network. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
+| callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is **true**. If the operation fails, **data** is **false**. If **err** is not **0**, an error has occurred.|
+
+
+## wifi.getCandidateConfigs9+
+
+getCandidateConfigs(): Array<[WifiDeviceConfig](#wifideviceconfig)>
+
+Obtains candidate network configuration.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiDeviceConfig](#wifideviceconfig)> | Candidate network configuration obtained.|
+
+
+## wifi.connectToCandidateConfig9+
+
+connectToCandidateConfig(networkId: number): boolean
+
+Connects to a candidate network.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| ID of the candidate network configuration.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.connectToNetwork
+
+connectToNetwork(networkId: number): boolean
+
+Connects to the specified network.
+This is a system API.
+
+**Required permissions**: ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| networkId | number | Yes| Network configuration ID.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.connectToDevice
+
+connectToDevice(config: WifiDeviceConfig): boolean
+
+Connects to the specified network.
+This is a system API.
+
+**Required permissions**:
+ ohos.permission.SET_WIFI_INFO, ohos.permission.SET_WIFI_CONFIG, and ohos.permissio.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**:
+ SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.disconnect
+
+disconnect(): boolean
+
+Connects to the specified network.
+This is a system API.
+
+**Required permissions**:
+ ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**:
+ SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.getSignalLevel
@@ -251,13 +653,13 @@ Obtains the WLAN signal level.
**Parameters**
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
-| rssi | number | Yes| RSSI of the hotspot, in dBm. |
+| rssi | number | Yes| RSSI of the hotspot, in dBm.|
| band | number | Yes| Frequency band of the WLAN AP.|
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| number | Signal level obtained. The value range is [0, 4].|
+| number | Signal level obtained. The value range is [0, 4].|
## wifi.getLinkedInfo
@@ -273,7 +675,7 @@ Obtains WLAN connection information. This API uses a promise to return the resul
**Return value**
| Type| Description|
| -------- | -------- |
-| Promise<[WifiLinkedInfo](#WifiLinkedInfo)> | Promise used to return the WLAN connection information obtained.|
+| Promise<[WifiLinkedInfo](#wifilinkedinfo)> | Promise used to return the WLAN connection information obtained.|
## wifi.getLinkedInfo
@@ -289,7 +691,7 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<[WifiLinkedInfo](#WifiLinkedInfo)> | Yes| Callback invoked to return the WLAN connection information obtained.|
+| callback | AsyncCallback<[WifiLinkedInfo](#wifilinkedinfo)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the WLAN connection information obtained. If **err** is not **0**, an error has occurred.|
**Example**
```js
@@ -315,25 +717,34 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r
Represents the WLAN connection information.
+**System capability**: SystemCapability.Communication.WiFi.STA
+
| Name| Type| Readable/Writable| Description|
| -------- | -------- | -------- | -------- |
-| ssid | string | Read only| Hotspot SSID, in UTF-8 format.|
+| ssid | string | Read only| SSID, in UTF-8 format.|
| bssid | string | Read only| BSSID of the hotspot.|
-| rssi | number | Read only| RSSI of the hotspot, in dBm. |
+| networkId | number | Read only| Network configuration ID, which is available only to system applications.|
+| rssi | number | Read only| RSSI of the hotspot, in dBm.|
| band | number | Read only| Frequency band of the WLAN AP.|
| linkSpeed | number | Read only| Speed of the WLAN AP.|
| frequency | number | Read only| Frequency of the WLAN AP.|
| isHidden | boolean | Read only| Whether to hide the WLAN AP.|
| isRestricted | boolean | Read only| Whether to restrict data volume at the WLAN AP.|
+| chload | number | Read only| Channel load. A larger value indicates a higher load. This parameter is only available to system applications.|
+| snr | number | Read only| Signal-to-noise ratio (SNR), which is available only to system applications.|
+| macType9+ | number | Read only| MAC address type.|
| macAddress | string | Read only| MAC address of the device.|
| ipAddress | number | Read only| IP address of the device that sets up the WLAN connection.|
-| connState | [ConnState](#ConnState) | Read only| WLAN connection state.|
+| suppState | [SuppState](#suppstate) | Read only| Supplicant state, which is available only to system applications.|
+| connState | [ConnState](#connstate) | Read only| WLAN connection state.|
## ConnState
Enumerates the WLAN connection states.
+**System capability**: SystemCapability.Communication.WiFi.STA
+
| Name| Default Value| Description|
| -------- | -------- | -------- |
| SCANNING | 0 | The device is scanning for available APs.|
@@ -346,157 +757,506 @@ Enumerates the WLAN connection states.
| UNKNOWN | 7 | Failed to set up a WLAN connection.|
-## wifi.isConnected7+
+## SuppState
+
+Enumerates the supplicant states.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| Name| Default Value| Description|
+| -------- | -------- | -------- |
+| DISCONNECTED | 0 | The supplicant is disconnected from the AP.|
+| INTERFACE_DISABLED | 1 | The network interface is disabled.|
+| INACTIVE | 2 | The supplicant is inactive.|
+| SCANNING | 3 | The supplicant is scanning for a WLAN connection.|
+| AUTHENTICATING | 4 | The supplicant is being authenticated.|
+| ASSOCIATING | 5 | The supplicant is being associated with an AP.|
+| ASSOCIATED | 6 | The supplicant is associated with an AP.|
+| FOUR_WAY_HANDSHAKE | 7 | A four-way handshake is being performed for the supplicant.|
+| GROUP_HANDSHAKE | 8 | A group handshake is being performed for the supplicant.|
+| COMPLETED | 9 | The authentication is complete.|
+| UNINITIALIZED | 10 | The supplicant failed to set up a connection.|
+| INVALID | 11 | Invalid value.|
+
+
+## wifi.isConnected7+
+
+isConnected(): boolean
+
+Checks whether the WLAN is connected.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
+
+
+## wifi.getSupportedFeatures7+
+
+getSupportedFeatures(): number
+
+Obtains the features supported by this device.
+This is a system API.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.Core
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| number | Feature value.|
+
+**Feature IDs**
+
+| Value| Description|
+| -------- | -------- |
+| 0x0001 | WLAN infrastructure mode|
+| 0x0002 | 5 GHz feature|
+| 0x0004 | Generic Advertisement Service (GAS)/Access Network Query Protocol (ANQP) feature|
+| 0x0008 | Wi-Fi Direct|
+| 0x0010 | SoftAP|
+| 0x0040 | Wi-Fi AWare|
+| 0x8000 | WLAN AP/STA concurrency|
+| 0x8000000 | WPA3 Personal (WPA-3 SAE)|
+| 0x10000000 | WPA3-Enterprise Suite B |
+| 0x20000000 | Enhanced open feature|
+
+
+## wifi.isFeatureSupported7+
+
+isFeatureSupported(featureId: number): boolean
+
+Checks whether the device supports the specified WLAN feature.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.Core
+
+**Parameters**
+
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| featureId | number | Yes| Feature ID.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
+
+
+## wifi.getDeviceMacAddress7+
+
+getDeviceMacAddress(): string[]
+
+Obtains the device MAC address.
+This is a system API.
+
+**Required permissions**: ohos.permission.GET_WIFI_LOCAL_MAC and ohos.permission.GET_WIFI_INFO (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| string[] | MAC address obtained.|
+
+
+## wifi.getIpInfo7+
+
+getIpInfo(): IpInfo
+
+Obtains IP information.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| [IpInfo](#ipinfo7) | IP information obtained.|
+
+
+## IpInfo7+
+
+Represents IP information.
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+| **Name**| **Type**| **Readable/Writable**| **Description**|
+| -------- | -------- | -------- | -------- |
+| ipAddress | number | Read only| IP address.|
+| gateway | number | Read only| Gateway.|
+| netmask | number | Read only| Subnet mask.|
+| primaryDns | number | Read only| IP address of the preferred DNS server.|
+| secondDns | number | Read only| IP address of the alternate DNS server.|
+| serverIp | number | Read only| IP address of the DHCP server.|
+| leaseDuration | number | Read only| Lease duration of the IP address.|
+
+
+## wifi.getCountryCode7+
+
+getCountryCode(): string
+
+Obtains the country code.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.Core
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| string | Country code obtained.|
+
+
+## wifi.reassociate7+
+
+reassociate(): boolean
+
+Re-associates with the network.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.reconnect7+
+
+reconnect(): boolean
+
+Reconnects to the network.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.getDeviceConfigs7+
+
+getDeviceConfigs(): Array<[WifiDeviceConfig](#wifideviceconfig)>
+
+Obtains network configuration.
+This is a system API.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.GET_WIFI_CONFIG
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| Array<[WifiDeviceConfig](#wifideviceconfig)> | Array of network configuration obtained.|
+
+
+## wifi.updateNetwork7+
+
+updateNetwork(config: WifiDeviceConfig): boolean
+
+Updates network configuration.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.SET_WIFI_CONFIG
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| New WLAN configuration.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.disableNetwork7+
+
+disableNetwork(netId: number): boolean
+
+Disables network configuration.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| netId | number | Yes| ID of the network configuration to disable.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.removeAllNetwork7+
+
+removeAllNetwork(): boolean
+
+Removes the configuration of all networks.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.removeDevice7+
+
+removeDevice(id: number): boolean
+
+Removes the configuration of a network.
+This is a system API.
+
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.STA
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| id | number | Yes| ID of the network configuration to remove.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
-isConnected(): boolean
+## wifi.enableHotspot7+
-Checks whether the WLAN is connected.
+enableHotspot(): boolean
-**Required permissions**: ohos.permission.GET_WIFI_INFO
+Enables this hotspot.
+This is a system API.
-**System capability**: SystemCapability.Communication.WiFi.STA
+**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
-## wifi.isFeatureSupported7+
+## wifi.disableHotspot7+
-isFeatureSupported(featureId: number): boolean
+disableHotspot(): boolean
-Checks whether the device supports the specified WLAN feature.
+Disables this hotspot.
+This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications)
-**System capability**: SystemCapability.Communication.WiFi.Core
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
-**Parameters**
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
-| **Name**| **Type**| Mandatory| **Description**|
-| -------- | -------- | -------- | -------- |
-| featureId | number | Yes| Feature ID.|
+
+## wifi.isHotspotDualBandSupported7+
+
+isHotspotDualBandSupported(): boolean
+
+Checks whether the hotspot supports dual band.
+This is a system API.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
**Return value**
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
-**Feature IDs**
-| Value| Description|
+## wifi.isHotspotActive7+
+
+isHotspotActive(): boolean
+
+Checks whether this hotspot is active.
+This is a system API.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
+
+**Return value**
+| **Type**| **Description**|
| -------- | -------- |
-| 0x0001 | WLAN infrastructure mode|
-| 0x0002 | 5 GHz bandwidth|
-| 0x0004 | Generic Advertisement Service (GAS)/Access Network Query Protocol (ANQP) feature|
-| 0x0008 | Wi-Fi Direct|
-| 0x0010 | SoftAP|
-| 0x0040 | Wi-Fi AWare|
-| 0x8000 | WLAN AP/STA concurrency|
-| 0x8000000 | WPA3 Personal (WPA-3 SAE)|
-| 0x10000000 | WPA3-Enterprise Suite-B |
-| 0x20000000 | Enhanced open feature|
+| boolean | Returns **true** if the hotspot is active; returns **false** otherwise.|
-## wifi.getIpInfo7+
+## wifi.setHotspotConfig7+
-getIpInfo(): IpInfo
+setHotspotConfig(config: HotspotConfig): boolean
-Obtains IP information.
+Sets hotspot configuration.
+This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.SET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
-**System capability**: SystemCapability.Communication.WiFi.STA
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| config | [HotspotConfig](#hotspotconfig7) | Yes| Hotspot configuration to set.|
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| [IpInfo](#IpInfo) | IP information obtained.|
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
-## IpInfo7+
+## HotspotConfig7+
-Represents IP information.
+Represents the hotspot configuration.
+
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
| **Name**| **Type**| **Readable/Writable**| **Description**|
| -------- | -------- | -------- | -------- |
-| ipAddress | number | Read only| IP address|
-| gateway | number | Read only| Gateway|
-| netmask | number | Read only| Subnet mask|
-| primaryDns | number | Read only| IP address of the preferred DNS server|
-| secondDns | number | Read only| IP address of the alternate DNS server|
-| serverIp | number | Read only| IP address of the DHCP server|
-| leaseDuration | number | Read only| Lease duration of the IP address|
+| ssid | string | Read only| SSID, in UTF-8 format.|
+| securityType | [WifiSecurityType](#wifisecuritytype) | Read only| Security type.|
+| band | number | Read only| Hotspot band. The value **1** stands for 2.4 GHz, the value **2** for 5 GHz, and the value **3** for dual band.|
+| preSharedKey | string | Read only| SPK of the hotspot.|
+| maxConn | number | Read only| Maximum number of connections allowed.|
-## wifi.getCountryCode7+
+## wifi.getHotspotConfig7+
-getCountryCode(): string
+getHotspotConfig(): HotspotConfig
-Obtains the country code.
+obtains hotspot configuration.
+This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
-**System capability**: SystemCapability.Communication.WiFi.Core
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
**Return value**
| **Type**| **Description**|
| -------- | -------- |
-| string | Country code obtained.|
+| [HotspotConfig](#hotspotconfig7) | Hotspot configuration obtained.|
-## wifi.getP2pLinkedInfo8+
+## wifi.getStations7+
-getP2pLinkedInfo(): Promise<WifiP2pLinkedInfo>
+getStations(): Array<[StationInfo](#stationinfo7)>
-Obtains peer-to-peer (P2P) connection information. This API uses a promise to return the result.
+Obtains information about the connected stations.
+This is a system API.
-**Required permissions**: ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.GET_WIFI_INFO, ohos.permission.LOCATION, and ohos.permission.MANAGE_WIFI_HOTSPOT (available only to system applications)
-**System capability**: SystemCapability.Communication.WiFi.P2P
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
**Return value**
-| Type| Description|
+| **Type**| **Description**|
| -------- | -------- |
-| Promise<[WifiP2pLinkedInfo](#WifiP2pLinkedInfo)> | Promise used to return the P2P connection information obtained.|
+| Array<[StationInfo](#stationinfo7)> | Connected stations obtained.|
+
+
+## StationInfo7+
+
+Represents the station information.
+
+**System capability**: SystemCapability.Communication.WiFi.AP.Core
+
+| **Name**| **Type**| **Readable/Writable**| **Description**|
+| -------- | -------- | -------- | -------- |
+| name | string | Read only| Device name.|
+| macAddress | string | Read only| MAC address.|
+| ipAddress | string | Read only| IP address.|
## wifi.getP2pLinkedInfo8+
-getP2pLinkedInfo(callback: AsyncCallback<WifiP2pLinkedInfo>): void
+getP2pLinkedInfo(): Promise<WifiP2pLinkedInfo>
-Obtains P2P connection information. This API uses an asynchronous callback to return the result.
+Obtains P2P link information. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO
**System capability**: SystemCapability.Communication.WiFi.P2P
-**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<[WifiP2pLinkedInfo](#WifiP2pLinkedInfo)> | Yes| Callback used to return the P2P connection information obtained.|
+**Return value**
+| Type| Description|
+| -------- | -------- |
+| Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Promise used to return the P2P link information obtained.|
+
## WifiP2pLinkedInfo8+
-Represents the WLAN connection information.
+Represents the P2P link information.
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
| Name| Type| Readable/Writable| Description|
| -------- | -------- | -------- | -------- |
-| connectState | [P2pConnectState](#P2pConnectState) | Read only| P2P connection state.|
-| isGroupOwner | boolean | Read only| Whether it is a group owner.|
-| groupOwnerAddr | string | Read only| MAC address of the group owner.|
+| connectState | [P2pConnectState](#p2pconnectstate8) | Read only| P2P connection state.|
+| isGroupOwner | boolean | Read only| Whether the device is the group owner.|
+| groupOwnerAddr | string | Read only| MAC address of the group.
## P2pConnectState8+
Enumerates the P2P connection states.
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
| Name| Default Value| Description|
| -------- | -------- | -------- |
-| DISCONNECTED | 0 | Disconnected|
-| CONNECTED | 1 | Connected|
+| DISCONNECTED | 0 | Disconnected.|
+| CONNECTED | 1 | Connected.|
+
+
+## wifi.getP2pLinkedInfo8+
+
+getP2pLinkedInfo(callback: AsyncCallback<WifiP2pLinkedInfo>): void
+
+Obtains P2P link information. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
+**Parameters**
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the P2P link information. If **err** is not **0**, an error has occurred.|
## wifi.getCurrentGroup8+
@@ -512,14 +1272,14 @@ Obtains the current P2P group information. This API uses a promise to return the
**Return value**
| Type| Description|
| -------- | -------- |
-| Promise<[WifiP2pGroupInfo](#WifiP2pGroupInfo)> | Promise used to return the P2P group information obtained.|
+| Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Promise used to return the group information obtained.|
## wifi.getCurrentGroup8+
getCurrentGroup(callback: AsyncCallback<WifiP2pGroupInfo>): void
-Obtains the P2P group information. This API uses an asynchronous callback to return the result.
+Obtains the current P2P group information. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
@@ -528,13 +1288,14 @@ Obtains the P2P group information. This API uses an asynchronous callback to ret
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<[WifiP2pGroupInfo](#WifiP2pGroupInfo)> | Yes| Callback used to return the P2P group information obtained.|
+| callback | AsyncCallback<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
-## wifi.getP2pGroups9+
-getP2pGroups(): Promise<Array<WifiP2pGroupInfo>
+## wifi.getP2pPeerDevices8+
+
+getP2pPeerDevices(): Promise<WifiP2pDevice[]>
-Obtains information about all P2P groups. This API uses a promise to return the result.
+Obtains the peer device list in a P2P connection. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
@@ -543,13 +1304,14 @@ Obtains information about all P2P groups. This API uses a promise to return the
**Return value**
| Type| Description|
| -------- | -------- |
-| Promise< Array<[WifiP2pGroupInfo](#WifiP2pGroupInfo)> > | Information about all created P2P groups obtained.|
+| Promise<[WifiP2pDevice[]](#wifip2pdevice8)> | Promise used to return the peer device list.|
-## wifi.getP2pGroups9+
-getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>): void
+## wifi.getP2pPeerDevices8+
-Obtains information about all P2P groups. This API uses an asynchronous callback to return the result.
+getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void
+
+Obtains the peer device list in a P2P connection. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
@@ -558,85 +1320,44 @@ Obtains information about all P2P groups. This API uses an asynchronous callback
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback< Array<[WifiP2pGroupInfo](#WifiP2pGroupInfo)>> | Yes| Callback invoked to return the P2P group information obtained.|
+| callback | AsyncCallback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the peer device list obtained. If **err** is not **0**, an error has occurred.|
-## WifiP2pGroupInfo8+
-
-Represents the P2P group information.
-
-| Name| Type| Readable/Writable| Description|
-| -------- | -------- | -------- | -------- |
-| isP2pGo | boolean | Read only| Whether it is a group.|
-| ownerInfo | [WifiP2pDevice](#WifiP2pDevice) | Read only| Device information of the group.|
-| passphrase | string | Read only| Private key of the group.|
-| interface | string | Read only| Interface name.|
-| groupName | string | Read only| Group name.|
-| networkId | number | Read only| Network ID.|
-| frequency | number | Read only| Frequency of the group.|
-| clientDevices | [WifiP2pDevice[]](#WifiP2pDevice) | Read only| List of connected devices.|
-| goIpAddress | string | Read only| IP address of the group.|
## WifiP2pDevice8+
Represents the P2P device information.
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
| Name| Type| Readable/Writable| Description|
| -------- | -------- | -------- | -------- |
| deviceName | string | Read only| Device name.|
| deviceAddress | string | Read only| MAC address of the device.|
| primaryDeviceType | string | Read only| Type of the primary device.|
-| deviceStatus | [P2pDeviceStatus](#P2pDeviceStatus) | Read only| Device status.|
+| deviceStatus | [P2pDeviceStatus](#p2pdevicestatus8) | Read only| Device status.|
| groupCapabilitys | number | Read only| Group capabilities.|
-## P2pDeviceStatus8+
-
-Enumerates the device states.
-
-| Name| Default Value| Description|
-| -------- | -------- | -------- |
-| CONNECTED | 0 | Connected|
-| INVITED | 1 | Invited|
-| FAILED | 2 | Failed|
-| AVAILABLE | 3 | Available|
-| UNAVAILABLE | 4 | Unavailable|
-
-
-## wifi.getP2pPeerDevices8+
-
-getP2pPeerDevices(): Promise<WifiP2pDevice[]>
-Obtains the list of peer devices in a P2P connection. This API uses a promise to return the result.
+## P2pDeviceStatus8+
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+Enumerates the P2P device states.
**System capability**: SystemCapability.Communication.WiFi.P2P
-**Return value**
-| Type| Description|
-| -------- | -------- |
-| Promise<[WifiP2pDevice[]](#WifiP2pDevice)> | Promise used to return the peer device list obtained.|
-
-
-## wifi.getP2pPeerDevices8+
-
-getP2pPeerDevices(callback: AsyncCallback<WifiP2pDevice[]>): void
-
-Obtains the list of peer devices in a P2P connection. This API uses an asynchronous callback to return the result.
-
-**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
-
-**System capability**: SystemCapability.Communication.WiFi.P2P
+| Name| Default Value| Description|
+| -------- | -------- | -------- |
+| CONNECTED | 0 | Connected.|
+| INVITED | 1 | Invited.|
+| FAILED | 2 | Failed.|
+| AVAILABLE | 3 | Available.|
+| UNAVAILABLE | 4 | Unavailable.|
-**Parameters**
-| Name| Type| Mandatory| Description|
-| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<[WifiP2pDevice[]](#WifiP2pDevice)> | Yes| Callback used to return the peer device list obtained.|
## wifi.getP2pLocalDevice9+
getP2pLocalDevice(): Promise<WifiP2pDevice>
-Obtains local device information. This API uses a promise to return the result.
+Obtains the local device information in a P2P connection. This API uses a promise to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
@@ -645,14 +1366,14 @@ Obtains local device information. This API uses a promise to return the result.
**Return value**
| Type| Description|
| -------- | -------- |
-| Promise<[WifiP2pDevice](#WifiP2pDevice)> | Promise used to return the local device information obtained.|
+| Promise<[WifiP2pDevice](#wifip2pdevice8)> | Promise used to return the local device information obtained.|
-## wifi.getP2pLocalDevice8+
+## wifi.getP2pLocalDevice9+
getP2pLocalDevice(callback: AsyncCallback<WifiP2pDevice>): void
-Obtains local device information. This API uses an asynchronous callback to return the result.
+Obtains the local device information in a P2P connection. This API uses an asynchronous callback to return the result.
**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.GET_WIFI_CONFIG
@@ -661,11 +1382,12 @@ Obtains local device information. This API uses an asynchronous callback to retu
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
-| callback | AsyncCallback<[WifiP2pDevice](#WifiP2pDevice)> | Yes| Callback invoked to returnthe local device information obtained.|
+| callback | AsyncCallback<[WifiP2pDevice](#wifip2pdevice8)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the local device information obtained. If **err** is not **0**, an error has occurred.|
+
## wifi.createGroup8+
-createGroup(config: WifiP2PConfig): boolean;
+createGroup(config: WifiP2PConfig): boolean
Creates a P2P group.
@@ -677,39 +1399,45 @@ Creates a P2P group.
| **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- |
-| config | [WifiP2PConfig](#WifiP2PConfig) | Yes| Group configuration.|
+| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Group configuration.|
**Return value**
| Type| Description|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
## WifiP2PConfig8+
Represents P2P configuration.
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
| Name| Type| Readable/Writable| Description|
| -------- | -------- | -------- | -------- |
| deviceAddress | string | Read only| Device address.|
-| netId | number | Read only| Network ID. The value **-1** indicates that a temporary group, and **-2** indicates that a persistent group.|
-| passphrase | string | Read only| Private key of the group.|
+| netId | number | Read only| Network ID. The value **-1** indicates a temporary group, and **-2** indicates a persistent group.|
+| passphrase | string | Read only| Passphrase of the group.|
| groupName | string | Read only| Name of the group.|
-| goBand | [GroupOwnerBand](#GroupOwnerBand) | Read only| Bandwidth of the group.|
+| goBand | [GroupOwnerBand](#groupownerband8) | Read only| Frequency band of the group.|
## GroupOwnerBand8+
-Enumerates the P2P group bandwidths.
+Enumerates the P2P group frequency bands.
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
| Name| Default Value| Description|
| -------- | -------- | -------- |
-| GO_BAND_AUTO | 0 | Auto|
-| GO_BAND_2GHZ | 1 | 2 GHz|
-| GO_BAND_5GHZ | 2 | 5 GHz|
+| GO_BAND_AUTO | 0 | Auto.|
+| GO_BAND_2GHZ | 1 | 2 GHz.|
+| GO_BAND_5GHZ | 2 | 5 GHz.|
+
## wifi.removeGroup8+
-removeGroup(): boolean;
+removeGroup(): boolean
Removes this P2P group.
@@ -725,7 +1453,7 @@ Removes this P2P group.
## wifi.p2pConnect8+
-p2pConnect(config: WifiP2PConfig): boolean;
+p2pConnect(config: WifiP2PConfig): boolean
Sets up a P2P connection.
@@ -737,7 +1465,7 @@ Sets up a P2P connection.
| **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- |
-| config | [WifiP2PConfig](#WifiP2PConfig) | Yes| Connection configuration.|
+| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Connection configuration.|
**Return value**
| Type| Description|
@@ -792,7 +1520,7 @@ Sets up a P2P connection.
}
wifi.on("p2pPeerDeviceChange", recvP2pPeerDeviceChangeFunc);
- var recvP2pPersistentGroupChangeFunc = result => {
+ var recvP2pPersistentGroupChangeFunc = () => {
console.info("p2p persistent group change receive event");
wifi.getCurrentGroup((err, data) => {
@@ -814,7 +1542,7 @@ Sets up a P2P connection.
## wifi.p2pCancelConnect8+
-p2pCancelConnect(): boolean;
+p2pCancelConnect(): boolean
Cancels this P2P connection.
@@ -830,7 +1558,7 @@ Cancels this P2P connection.
## wifi.startDiscoverDevices8+
-startDiscoverDevices(): boolean;
+startDiscoverDevices(): boolean
Starts to discover devices.
@@ -846,7 +1574,7 @@ Starts to discover devices.
## wifi.stopDiscoverDevices8+
-stopDiscoverDevices(): boolean;
+stopDiscoverDevices(): boolean
Stops discovering devices.
@@ -860,6 +1588,103 @@ Stops discovering devices.
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+## wifi.deletePersistentGroup8+
+
+deletePersistentGroup(netId: number): boolean
+
+Deletes a persistent group.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
+**Parameters**
+
+| **Name**| **Type**| Mandatory| **Description**|
+| -------- | -------- | -------- | -------- |
+| netId | number | Yes| ID of a group to delete.|
+
+**Return value**
+| Type| Description|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
+## wifi.getP2pGroups9+
+getP2pGroups(): Promise<Array<WifiP2pGroupInfo>>
+
+Obtains information about all P2P groups. This API uses a promise to return the result.
+
+This is a system API.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
+**Return value**
+| Type| Description|
+| -------- | -------- |
+| Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> > | Promise used to return the group information obtained.|
+
+
+## WifiP2pGroupInfo8+
+
+Represents the P2P group information.
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
+| Name| Type| Readable/Writable| Description|
+| -------- | -------- | -------- | -------- |
+| isP2pGo | boolean | Read only| Whether the device is the group owner.|
+| ownerInfo | [WifiP2pDevice](#wifip2pdevice8) | Read only| Device information of the group.|
+| passphrase | string | Read only| Passphrase of the group.|
+| interface | string | Read only| Interface name.|
+| groupName | string | Read only| Group name.|
+| networkId | number | Read only| Network ID.|
+| frequency | number | Read only| Frequency of the group.|
+| clientDevices | [WifiP2pDevice[]](#wifip2pdevice8) | Read only| List of connected devices.|
+| goIpAddress | string | Read only| IP address of the group.|
+
+
+## wifi.getP2pGroups9+
+
+getP2pGroups(callback: AsyncCallback<Array<WifiP2pGroupInfo>>): void
+
+Obtains information about all P2P groups. This API uses an asynchronous callback to return the result.
+
+**Required permissions**: ohos.permission.GET_WIFI_INFO and ohos.permission.LOCATION
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
+**Parameters**
+| Name| Type| Mandatory| Description|
+| -------- | -------- | -------- | -------- |
+| callback | AsyncCallback< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)>> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the group information obtained. If **err** is not **0**, an error has occurred.|
+
+
+## wifi.setDeviceName8+
+
+setDeviceName(devName: string): boolean
+
+Sets the device name.
+This is a system API.
+
+**Required permissions**:
+ ohos.permission.SET_WIFI_INFO and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
+
+**System capability**: SystemCapability.Communication.WiFi.P2P
+
+**Parameters**
+| **Name**| **Type**| **Mandatory**| **Description**|
+| -------- | -------- | -------- | -------- |
+| devName | string | Yes| Device name to set.|
+
+**Return value**
+| **Type**| **Description**|
+| -------- | -------- |
+| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
+
+
## wifi.on('wifiStateChange')7+
on(type: "wifiStateChange", callback: Callback<number>): void
@@ -1033,7 +1858,7 @@ Unregisters the RSSI change events.
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **wifiRssiChange**.|
-| callback | Callback<number> | No| Callback used to return the RSSI, in dBm. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| callback | Callback<number> | No| Callback used to return the RSSI. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('hotspotStateChange')7+
@@ -1136,7 +1961,7 @@ Registers the P2P connection state change events.
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
-| callback | Callback<[WifiP2pLinkedInfo](#WifiP2pLinkedInfo)> | Yes| Callback invoked to return the P2P connection state.|
+| callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Yes| Callback invoked to return the P2P connection state.|
## wifi.off('p2pConnectionChange')8+
@@ -1153,7 +1978,7 @@ Unregisters the P2P connection state change events.
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
-| callback | Callback<[WifiP2pLinkedInfo](#WifiP2pLinkedInfo)> | No| Callback used to return the P2P connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| callback | Callback<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | No| Callback used to return the P2P connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pDeviceChange')8+
@@ -1170,7 +1995,7 @@ Registers the P2P device state change events.
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
-| callback | Callback<[WifiP2pDevice](#WifiP2pDevice)> | Yes| Callback invoked to return the P2P device state.|
+| callback | Callback<[WifiP2pDevice](#wifip2pdevice8)> | Yes| Callback invoked to return the P2P device state.|
## wifi.off('p2pDeviceChange')8+
@@ -1187,7 +2012,7 @@ Unregisters the P2P device state change events.
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
-| callback | Callback<[WifiP2pDevice](#WifiP2pDevice)> | No| Callback used to return the P2P device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| callback | Callback<[WifiP2pDevice](#wifip2pdevice8)> | No| Callback used to return the P2P device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pPeerDeviceChange')8+
@@ -1204,7 +2029,7 @@ Registers the P2P peer device state change events.
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
-| callback | Callback<[WifiP2pDevice[]](#WifiP2pDevice)> | Yes| Callback invoked to return the P2P peer device state.|
+| callback | Callback<[WifiP2pDevice[]](#wifip2pdevice8)> | Yes| Callback invoked to return the P2P peer device state.|
## wifi.off('p2pPeerDeviceChange')8+
@@ -1221,7 +2046,7 @@ Unregisters the P2P peer device state change events.
| **Name**| **Type**| **Mandatory**| **Description**|
| -------- | -------- | -------- | -------- |
| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
-| callback | Callback<[WifiP2pDevice[]](#WifiP2pDevice)> | No| Callback used to return the P2P peer device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
+| callback | Callback<[WifiP2pDevice[]](#wifip2pdevice8)> | No| Callback used to return the peer device state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('p2pPersistentGroupChange')8+
diff --git a/en/application-dev/reference/apis/js-apis-wifiext.md b/en/application-dev/reference/apis/js-apis-wifiext.md
index 2e2e9394b2a4361fa8adad332c459d4ff33a4e4d..f54b65d4b492cf65bb367b52a021cb1f061af6bb 100644
--- a/en/application-dev/reference/apis/js-apis-wifiext.md
+++ b/en/application-dev/reference/apis/js-apis-wifiext.md
@@ -1,6 +1,7 @@
# WLAN
+This **wifiext** module provides WLAN extension interfaces for non-universal products.
->  **NOTE**
+>  **NOTE**
> The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
The APIs described in this document are used only for non-universal products, such as routers.
@@ -17,13 +18,11 @@ enableHotspot(): boolean;
Enables the WLAN hotspot.
-- Required permissions:
- ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
+**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
-- System capability:
- SystemCapability.Communication.WiFi.AP.Extension
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
-- Return value
+**Return value**
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -35,13 +34,11 @@ disableHotspot(): boolean;
Disables the WLAN hotspot.
-- Required permissions:
- ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
+**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
-- System capability:
- SystemCapability.Communication.WiFi.AP.Extension
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
-- Return value
+**Return value**
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -51,24 +48,24 @@ Disables the WLAN hotspot.
getSupportedPowerModel(): Promise<Array<PowerModel>>
-Obtains the supported power models. The method uses a promise to return the result.
+Obtains the supported power models. This API uses a promise to return the result.
-- Required permissions:
- ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.GET_WIFI_INFO
-- System capability:
- SystemCapability.Communication.WiFi.AP.Extension
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
-- Return value
+**Return value**
| Type| Description|
| -------- | -------- |
- | Promise<Array<[PowerModel](#PowerModel)>> | Promise used to return the power models obtained.|
+ | Promise<Array<[PowerModel](#powermodel)>> | Promise used to return the power models obtained.|
## PowerModel
Enumerates of the power models.
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
+
| Name| Default Value| Description|
| -------- | -------- | -------- |
| SLEEPING | 0 | Sleeping|
@@ -80,54 +77,48 @@ Enumerates of the power models.
getSupportedPowerModel(callback: AsyncCallback<Array<PowerModel>>): void
-Obtains the supported power models. The method uses an asynchronous callback to return the result.
+Obtains the supported power models. This API uses an asynchronous callback to return the result.
-- Required permissions:
- ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.GET_WIFI_INFO
-- System capability:
- SystemCapability.Communication.WiFi.AP.Extension
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
-- Parameters
+**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[PowerModel](#PowerModel)> | Yes| Callback used to return the power models obtained.|
+ | callback | AsyncCallback<[PowerModel](#powermodel)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is 0 and **data** is the power models obtained. If **err** is not **0**, an error has occurred.|
## wifiext.getPowerModel
getPowerModel(): Promise<PowerModel>
-Obtains the power model. The method uses a promise to return the result.
+Obtains the power model. This API uses a promise to return the result.
-- Required permissions:
- ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.GET_WIFI_INFO
-- System capability:
- SystemCapability.Communication.WiFi.AP.Extension
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
-- Return value
+**Return value**
| Type| Description|
| -------- | -------- |
- | Promise<[PowerModel](#PowerModel)> | Promise used to return the power model obtained.|
+ | Promise<[PowerModel](#powermodel)> | Promise used to return the power model obtained.|
## wifiext.getPowerModel
getPowerModel(callback: AsyncCallback<PowerModel>): void
-Obtains the power model. The method uses an asynchronous callback to return the result.
+Obtains the power model. This API uses an asynchronous callback to return the result.
-- Required permissions:
- ohos.permission.GET_WIFI_INFO
+**Required permissions**: ohos.permission.GET_WIFI_INFO
-- System capability:
- SystemCapability.Communication.WiFi.AP.Extension
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
-- Parameters
+**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
- | callback | AsyncCallback<[PowerModel](#PowerModel)> | Yes| Callback invoked to return the power mode obtained.|
+ | callback | AsyncCallback<[PowerModel](#powermodel)> | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power mode obtained. If **err** is not **0**, an error has occurred.|
## wifiext.setPowerModel
@@ -136,18 +127,16 @@ setPowerModel(model: PowerModel) : boolean;
Sets the power model.
-- Required permissions:
- ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
+**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
-- System capability:
- SystemCapability.Communication.WiFi.AP.Extension
+**System capability**: SystemCapability.Communication.WiFi.AP.Extension
-- Parameters
+**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
- | model | AsyncCallback<[PowerModel](#PowerModel)> | Yes| Power model to set.|
+ | model | AsyncCallback<[PowerModel](#powermodel)> | Yes| Power model to set.|
-- Return value
+**Return value**
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|