| 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.|
| 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**
**Example**
```js
```js
...
@@ -247,9 +247,9 @@ Obtains the scan result. This API returns the result synchronously.
...
@@ -247,9 +247,9 @@ Obtains the scan result. This API returns the result synchronously.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| Array<[WifiScanInfo](#wifiscaninfo)> | Scan result obtained.|
| Array<[WifiScanInfo](#wifiscaninfo)> | Scan result obtained.|
## wifi.addDeviceConfig
## wifi.addDeviceConfig
...
@@ -266,15 +266,15 @@ Adds network configuration. This API uses a promise to return the result.
...
@@ -266,15 +266,15 @@ Adds network configuration. This API uses a promise to return the result.
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
| 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.|
| 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.addUntrustedConfig<sup>7+</sup>
## wifi.addUntrustedConfig<sup>7+</sup>
...
@@ -430,15 +430,15 @@ Adds the configuration of an untrusted network. This API uses a promise to retur
...
@@ -430,15 +430,15 @@ Adds the configuration of an untrusted network. This API uses a promise to retur
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
| 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.|
| 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.removeUntrustedConfig<sup>7+</sup>
## wifi.removeUntrustedConfig<sup>7+</sup>
...
@@ -471,15 +471,15 @@ Removes the configuration of an untrusted network. This API uses a promise to re
...
@@ -471,15 +471,15 @@ Removes the configuration of an untrusted network. This API uses a promise to re
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to remove.|
| 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.|
| 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.addCandidateConfig<sup>9+</sup>
## wifi.addCandidateConfig<sup>9+</sup>
...
@@ -512,15 +512,15 @@ Adds the configuration of a candidate network. This API uses a promise to return
...
@@ -512,15 +512,15 @@ Adds the configuration of a candidate network. This API uses a promise to return
| config | [WifiDeviceConfig](#wifideviceconfig) | Yes| WLAN configuration to add.|
| 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.|
| 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.removeCandidateConfig<sup>9+</sup>
## wifi.removeCandidateConfig<sup>9+</sup>
...
@@ -553,15 +553,15 @@ Removes the configuration of a candidate network. This API uses a promise to ret
...
@@ -553,15 +553,15 @@ Removes the configuration of a candidate network. This API uses a promise to ret
| networkId | number | Yes| ID of the network configuration to remove.|
| networkId | number | Yes| ID of the network configuration to remove.|
| callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the operation is successful, the value of **err** is **0**. If **err** is not **0**, an error has occurred.|
| callback | AsyncCallback<void> | Yes| Callback invoked to return the result. If the operation is successful, the value of **err** is **0**. If **err** is not **0**, an error has occurred.|
| 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.|
| band | number | Yes| Frequency band of the WLAN AP.|
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| number | Signal level obtained. The value range is [0, 4].|
| number | Signal level obtained. The value range is [0, 4].|
## wifi.getLinkedInfo
## wifi.getLinkedInfo
...
@@ -723,9 +723,9 @@ Obtains WLAN connection information. This API uses a promise to return the resul
...
@@ -723,9 +723,9 @@ Obtains WLAN connection information. This API uses a promise to return the resul
**Return value**
**Return value**
| Type| Description|
| 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
## wifi.getLinkedInfo
...
@@ -740,9 +740,9 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r
...
@@ -740,9 +740,9 @@ Obtains WLAN connection information. This API uses an asynchronous callback to r
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| 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.|
| 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**
**Example**
```js
```js
...
@@ -844,9 +844,9 @@ Checks whether the WLAN is connected.
...
@@ -844,9 +844,9 @@ Checks whether the WLAN is connected.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
| boolean | Returns **true** if the WLAN is connected; returns **false** otherwise.|
## wifi.getSupportedFeatures<sup>7+</sup>
## wifi.getSupportedFeatures<sup>7+</sup>
...
@@ -863,9 +863,9 @@ Obtains the features supported by this device.
...
@@ -863,9 +863,9 @@ Obtains the features supported by this device.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| number | Feature value. |
| number | Feature value. |
**Feature IDs**
**Feature IDs**
...
@@ -896,15 +896,15 @@ Checks whether the device supports the specified WLAN feature.
...
@@ -896,15 +896,15 @@ Checks whether the device supports the specified WLAN feature.
**Parameters**
**Parameters**
| **Name**| **Type**| Mandatory| **Description**|
| **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| featureId | number | Yes| Feature ID.|
| featureId | number | Yes| Feature ID.|
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
| boolean | Returns **true** if the feature is supported; returns **false** otherwise.|
## wifi.getDeviceMacAddress<sup>7+</sup>
## wifi.getDeviceMacAddress<sup>7+</sup>
...
@@ -921,9 +921,9 @@ Obtains the device MAC address.
...
@@ -921,9 +921,9 @@ Obtains the device MAC address.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| string[] | MAC address obtained.|
| string[] | MAC address obtained.|
## wifi.getIpInfo<sup>7+</sup>
## wifi.getIpInfo<sup>7+</sup>
...
@@ -938,9 +938,9 @@ Obtains IP information.
...
@@ -938,9 +938,9 @@ Obtains IP information.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| [IpInfo](#ipinfo7) | IP information obtained.|
| [IpInfo](#ipinfo7) | IP information obtained.|
## IpInfo<sup>7+</sup>
## IpInfo<sup>7+</sup>
...
@@ -972,9 +972,9 @@ Obtains the country code.
...
@@ -972,9 +972,9 @@ Obtains the country code.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| string | Country code obtained.|
| string | Country code obtained.|
## wifi.reassociate<sup>7+</sup>
## wifi.reassociate<sup>7+</sup>
...
@@ -991,9 +991,9 @@ Re-associates with the network.
...
@@ -991,9 +991,9 @@ Re-associates with the network.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.reconnect<sup>7+</sup>
## wifi.reconnect<sup>7+</sup>
...
@@ -1010,9 +1010,9 @@ Reconnects to the network.
...
@@ -1010,9 +1010,9 @@ Reconnects to the network.
**Return value**
**Return value**
| **Type**| **Description**|
| **Type**| **Description**|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
@@ -1311,9 +1311,9 @@ Obtains P2P link information. This API uses a promise to return the result.
...
@@ -1311,9 +1311,9 @@ Obtains P2P link information. This API uses a promise to return the result.
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Promise used to return the P2P link information obtained.|
| Promise<[WifiP2pLinkedInfo](#wifip2plinkedinfo8)> | Promise used to return the P2P link information obtained.|
...
@@ -1354,9 +1354,9 @@ Obtains P2P link information. This API uses an asynchronous callback to return t
...
@@ -1354,9 +1354,9 @@ Obtains P2P link information. This API uses an asynchronous callback to return t
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| 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.|
| 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.getCurrentGroup<sup>8+</sup>
## wifi.getCurrentGroup<sup>8+</sup>
...
@@ -1371,9 +1371,9 @@ Obtains the current P2P group information. This API uses a promise to return the
...
@@ -1371,9 +1371,9 @@ Obtains the current P2P group information. This API uses a promise to return the
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Promise used to return the group information obtained.|
| Promise<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> | Promise used to return the group information obtained.|
## wifi.getCurrentGroup<sup>8+</sup>
## wifi.getCurrentGroup<sup>8+</sup>
...
@@ -1388,9 +1388,9 @@ Obtains the current P2P group information. This API uses an asynchronous callbac
...
@@ -1388,9 +1388,9 @@ Obtains the current P2P group information. This API uses an asynchronous callbac
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| 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.|
| 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.getP2pPeerDevices<sup>8+</sup>
## wifi.getP2pPeerDevices<sup>8+</sup>
...
@@ -1405,9 +1405,9 @@ Obtains the peer device list in the P2P connection. This API uses a promise to r
...
@@ -1405,9 +1405,9 @@ Obtains the peer device list in the P2P connection. This API uses a promise to r
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<[WifiP2pDevice[]](#wifip2pdevice8)> | Promise used to return the peer device list.|
| Promise<[WifiP2pDevice[]](#wifip2pdevice8)> | Promise used to return the peer device list.|
## wifi.getP2pPeerDevices<sup>8+</sup>
## wifi.getP2pPeerDevices<sup>8+</sup>
...
@@ -1422,9 +1422,9 @@ Obtains the peer device list in the P2P connection. This API uses an asynchronou
...
@@ -1422,9 +1422,9 @@ Obtains the peer device list in the P2P connection. This API uses an asynchronou
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| 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.|
| 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.|
## WifiP2pDevice<sup>8+</sup>
## WifiP2pDevice<sup>8+</sup>
...
@@ -1469,9 +1469,9 @@ Obtains the local device information in the P2P connection. This API uses a prom
...
@@ -1469,9 +1469,9 @@ Obtains the local device information in the P2P connection. This API uses a prom
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise<[WifiP2pDevice](#wifip2pdevice8)> | Promise used to return the local device information obtained.|
| Promise<[WifiP2pDevice](#wifip2pdevice8)> | Promise used to return the local device information obtained.|
## wifi.getP2pLocalDevice<sup>9+</sup>
## wifi.getP2pLocalDevice<sup>9+</sup>
...
@@ -1486,9 +1486,9 @@ Obtains the local device information in the P2P connection. This API uses an asy
...
@@ -1486,9 +1486,9 @@ Obtains the local device information in the P2P connection. This API uses an asy
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| 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.|
| 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.createGroup<sup>8+</sup>
## wifi.createGroup<sup>8+</sup>
...
@@ -1503,15 +1503,15 @@ Creates a P2P group.
...
@@ -1503,15 +1503,15 @@ Creates a P2P group.
**Parameters**
**Parameters**
| **Name**| **Type**| Mandatory| **Description**|
| **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Group configuration.|
| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| Group configuration.|
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## WifiP2PConfig<sup>8+</sup>
## WifiP2PConfig<sup>8+</sup>
...
@@ -1554,9 +1554,9 @@ Removes this P2P group.
...
@@ -1554,9 +1554,9 @@ Removes this P2P group.
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.p2pConnect<sup>8+</sup>
## wifi.p2pConnect<sup>8+</sup>
...
@@ -1572,15 +1572,15 @@ Sets up a P2P connection.
...
@@ -1572,15 +1572,15 @@ Sets up a P2P connection.
**Parameters**
**Parameters**
| **Name**| **Type**| Mandatory| **Description**|
| **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| P2P group configuration.|
| config | [WifiP2PConfig](#wifip2pconfig8) | Yes| P2P group configuration.|
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
**Example**
**Example**
...
@@ -1662,9 +1662,9 @@ Cancels this P2P connection.
...
@@ -1662,9 +1662,9 @@ Cancels this P2P connection.
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.startDiscoverDevices<sup>8+</sup>
## wifi.startDiscoverDevices<sup>8+</sup>
...
@@ -1679,9 +1679,9 @@ Starts to discover devices.
...
@@ -1679,9 +1679,9 @@ Starts to discover devices.
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.stopDiscoverDevices<sup>8+</sup>
## wifi.stopDiscoverDevices<sup>8+</sup>
...
@@ -1696,9 +1696,9 @@ Stops discovering devices.
...
@@ -1696,9 +1696,9 @@ Stops discovering devices.
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.deletePersistentGroup<sup>8+</sup>
## wifi.deletePersistentGroup<sup>8+</sup>
...
@@ -1716,15 +1716,15 @@ Deletes a persistent group.
...
@@ -1716,15 +1716,15 @@ Deletes a persistent group.
**Parameters**
**Parameters**
| **Name**| **Type**| Mandatory| **Description**|
| **Name**| **Type**| Mandatory| **Description**|
| -------- | -------- | -------- | -------- |
| -------- | -------- | -------- | -------- |
| netId | number | Yes| ID of the group to delete.|
| netId | number | Yes| ID of the group to delete.|
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
## wifi.getP2pGroups<sup>9+</sup>
## wifi.getP2pGroups<sup>9+</sup>
...
@@ -1741,9 +1741,9 @@ Obtains information about all P2P groups. This API uses a promise to return the
...
@@ -1741,9 +1741,9 @@ Obtains information about all P2P groups. This API uses a promise to return the
**Return value**
**Return value**
| Type| Description|
| Type| Description|
| -------- | -------- |
| -------- | -------- |
| Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> > | Promise used to return the group information obtained.|
| Promise< Array<[WifiP2pGroupInfo](#wifip2pgroupinfo8)> > | Promise used to return the group information obtained.|
## WifiP2pGroupInfo<sup>8+</sup>
## WifiP2pGroupInfo<sup>8+</sup>
...
@@ -1779,9 +1779,9 @@ Obtains information about all P2P groups. This API uses an asynchronous callback
...
@@ -1779,9 +1779,9 @@ Obtains information about all P2P groups. This API uses an asynchronous callback
**Parameters**
**Parameters**
| Name| Type| Mandatory| Description|
| 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.|
| 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.|
| type | string | Yes| Event type. The value is **wifiStateChange**.|
| type | string | Yes| Event type. The value is **wifiStateChange**.|
| callback | Callback<number> | No| Callback used to return the WLAN state. 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 WLAN state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
**Example**
**Example**
```js
```js
...
@@ -1881,10 +1881,10 @@ Registers the WLAN connection state change events.
...
@@ -1881,10 +1881,10 @@ Registers the WLAN connection state change events.
| type | string | Yes| Event type. The value is **wifiConnectionChange**.|
| type | string | Yes| Event type. The value is **wifiConnectionChange**.|
| callback | Callback<number> | No| Callback used to return the WLAN connection state. 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 WLAN connection state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
## wifi.on('wifiScanStateChange')<sup>7+</sup>
## wifi.on('wifiScanStateChange')<sup>7+</sup>
...
@@ -1924,10 +1924,10 @@ Registers the WLAN scan state change events.
...
@@ -1924,10 +1924,10 @@ Registers the WLAN scan state change events.
| type | string | Yes| Event type. The value is **wifiRssiChange**.|
| type | string | Yes| Event type. The value is **wifiRssiChange**.|
| 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.|
| 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.|
...
@@ -2003,10 +2003,10 @@ Registers the hotspot state change events.
...
@@ -2003,10 +2003,10 @@ Registers the hotspot state change events.
| type | string | Yes| Event type. The value is **hotspotStateChange**.|
| type | string | Yes| Event type. The value is **hotspotStateChange**.|
| callback | Callback<number> | No| Callback used to return the hotspot state. 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 hotspot state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
...
@@ -2048,10 +2048,10 @@ Registers the P2P state change events.
...
@@ -2048,10 +2048,10 @@ Registers the P2P state change events.
| type | string | Yes| Event type. The value is **p2pStateChange**.|
| type | string | Yes| Event type. The value is **p2pStateChange**.|
| callback | Callback<number> | No| Callback used to return the P2P state. 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 P2P state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
...
@@ -2093,10 +2093,10 @@ Registers the P2P connection state change events.
...
@@ -2093,10 +2093,10 @@ Registers the P2P connection state change events.
| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
| type | string | Yes| Event type. The value is **p2pConnectionChange**.|
| 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.|
| 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.|
...
@@ -2129,10 +2129,10 @@ Registers the P2P device state change events.
...
@@ -2129,10 +2129,10 @@ Registers the P2P device state change events.
| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
| type | string | Yes| Event type. The value is **p2pDeviceChange**.|
| 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.|
| 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.|
...
@@ -2165,9 +2165,9 @@ Registers the P2P peer device state change events.
...
@@ -2165,9 +2165,9 @@ Registers the P2P peer device state change events.
| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
| type | string | Yes| Event type. The value is **p2pPeerDeviceChange**.|
| 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.|
| 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.|
...
@@ -2201,10 +2201,10 @@ Registers the P2P persistent group state change events.
...
@@ -2201,10 +2201,10 @@ Registers the P2P persistent group state change events.
| type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
| type | string | Yes| Event type. The value is **p2pPersistentGroupChange**.|
| callback | Callback<void> | No| Callback used to return the P2P persistent group state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
| callback | Callback<void> | No| Callback used to return the P2P persistent group state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|
...
@@ -2237,10 +2237,10 @@ Registers the P2P device discovery state change events.
...
@@ -2237,10 +2237,10 @@ Registers the P2P device discovery state change events.
| type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
| type | string | Yes| Event type. The value is **p2pDiscoveryChange**.|
| callback | Callback<number> | No| Callback used to return the P2P device discovery state. 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 P2P device discovery state. If this parameter is not specified, all callbacks associated with the specified event will be unregistered.|