未验证 提交 38211bec 编写于 作者: O openharmony_ci 提交者: Gitee

!20927 [翻译完成】#I7IF1U (19410+20085+20003)

Merge pull request !20927 from Annie_wang/PR20265
...@@ -244,23 +244,6 @@ Enumerates the WLAN security types. ...@@ -244,23 +244,6 @@ Enumerates the WLAN security types.
| WIFI_SEC_TYPE_SAE | 4 | Simultaneous Authentication of Equals (SAE).| | WIFI_SEC_TYPE_SAE | 4 | Simultaneous Authentication of Equals (SAE).|
## wifi.getScanInfosSync<sup>9+</sup>
getScanInfosSync(): &nbsp;Array&lt;[WifiScanInfo](#wifiscaninfo)&gt;
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**|
| -------- | -------- |
| &nbsp;Array&lt;[WifiScanInfo](#wifiscaninfo)&gt; | Scan result obtained.|
## wifi.addDeviceConfig ## wifi.addDeviceConfig
addDeviceConfig(config: WifiDeviceConfig): Promise&lt;number&gt; addDeviceConfig(config: WifiDeviceConfig): Promise&lt;number&gt;
...@@ -585,8 +568,8 @@ Connects to the specified network. ...@@ -585,8 +568,8 @@ Connects to the specified network.
**System API**: This is a system API. **System API**: 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) **Required permissions**: ohos.permission.SET_WIFI_INFO, ohos.permission.SET_WIFI_CONFIG, and ohos.permission.MANAGE_WIFI_CONNECTION (available only to system applications)
**System capability**: **System capability**:
SystemCapability.Communication.WiFi.STA SystemCapability.Communication.WiFi.STA
...@@ -680,7 +663,7 @@ try { ...@@ -680,7 +663,7 @@ try {
let rssi = 0; let rssi = 0;
let band = 0; let band = 0;
let level = wifi.getSignalLevel(rssi,band); let level = wifi.getSignalLevel(rssi,band);
console.info("lelvel:" + JSON.stringify(lelvel)); console.info("level:" + JSON.stringify(level));
}catch(error){ }catch(error){
console.error("failed:" + JSON.stringify(error)); console.error("failed:" + JSON.stringify(error));
} }
...@@ -1278,10 +1261,10 @@ Disables this hotspot. ...@@ -1278,10 +1261,10 @@ Disables this hotspot.
**Example** **Example**
```js ```js
import wifi from '@ohos.wifiManager'; import wifi from '@ohos.wifi';
try { try {
wifiManager.disableHotspot(); wifi.disableHotspot();
}catch(error){ }catch(error){
console.error("failed:" + JSON.stringify(error)); console.error("failed:" + JSON.stringify(error));
} }
...@@ -1644,7 +1627,7 @@ Obtains the peer device list in the P2P connection. This API uses an asynchronou ...@@ -1644,7 +1627,7 @@ Obtains the peer device list in the P2P connection. This API uses an asynchronou
**Example** **Example**
```js ```js
import wifi from '@ohos.wifiManager'; import wifi from '@ohos.wifi';
wifi.getP2pPeerDevices((err, data) => { wifi.getP2pPeerDevices((err, data) => {
if (err) { if (err) {
...@@ -2043,7 +2026,7 @@ import wifi from '@ohos.wifi'; ...@@ -2043,7 +2026,7 @@ import wifi from '@ohos.wifi';
try { try {
let name = "****"; let name = "****";
wifi.setDeviceName(netId); wifi.setDeviceName(name);
}catch(error){ }catch(error){
console.error("failed:" + JSON.stringify(error)); console.error("failed:" + JSON.stringify(error));
} }
......
# @ohos.wifiManagerExt (WLAN Extension Interface) # @ohos.wifiManagerExt (WLAN Extension)
This **wifiext** module provides WLAN extension interfaces for non-universal products. This **wifiext** module provides WLAN extension interfaces for non-universal products.
> **NOTE** > **NOTE**
...@@ -27,8 +27,8 @@ Enables the WLAN hotspot. ...@@ -27,8 +27,8 @@ Enables the WLAN hotspot.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md). For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **ID**| **Error Message**|
| -------- | -------- | | -------- | -------- |
| 2701000 | Operation failed.| | 2701000 | Operation failed.|
## wifiext.disableHotspot<sup>9+</sup> ## wifiext.disableHotspot<sup>9+</sup>
...@@ -45,8 +45,8 @@ Disables the WLAN hotspot. ...@@ -45,8 +45,8 @@ Disables the WLAN hotspot.
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md). For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **ID**| **Error Message**|
| -------- | -------- | | -------- | -------- |
| 2701000 | Operation failed.| | 2701000 | Operation failed.|
## wifiext.getSupportedPowerMode<sup>9+</sup> ## wifiext.getSupportedPowerMode<sup>9+</sup>
...@@ -61,19 +61,19 @@ Obtains the supported power modes. This API uses a promise to return the result. ...@@ -61,19 +61,19 @@ Obtains the supported power modes. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;Array&lt;[PowerMode](#powermode)&gt;&gt; | Promise used to return the power modes obtained.| | Promise&lt;Array&lt;[PowerMode](#powermode)&gt;&gt; | Promise used to return the power modes obtained.|
**Error codes** **Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md). For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **ID**| **Error Message**|
| -------- | -------- | | -------- | -------- |
| 2701000 | Operation failed.| | 2701000 | Operation failed.|
## PowerMode ## PowerMode<sup>9+</sup>
Enumerates the power modes. Enumerates the power modes.
...@@ -98,16 +98,16 @@ Obtains the supported power modes. This API uses an asynchronous callback to ret ...@@ -98,16 +98,16 @@ Obtains the supported power modes. This API uses an asynchronous callback to ret
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;Array&lt;[PowerMode](#powermode)&gt;&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power modes obtained. If **err** is not **0**, an error has occurred.| | callback | AsyncCallback&lt;Array&lt;[PowerMode](#powermode)&gt;&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power modes obtained. If **err** is not **0**, an error has occurred.|
**Error codes** **Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md). For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **ID**| **Error Message**|
| -------- | -------- | | -------- | -------- |
| 2701000 | Operation failed.| | 2701000 | Operation failed.|
## wifiext.getPowerMode<sup>9+</sup> ## wifiext.getPowerMode<sup>9+</sup>
...@@ -122,16 +122,16 @@ Obtains the power mode. This API uses a promise to return the result. ...@@ -122,16 +122,16 @@ Obtains the power mode. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[PowerMode](#powermode)&gt; | Promise used to return the power modes obtained.| | Promise&lt;[PowerMode](#powermode)&gt; | Promise used to return the power modes obtained.|
**Error codes** **Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md). For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **ID**| **Error Message**|
| -------- | -------- | | -------- | -------- |
| 2701000 | Operation failed.| | 2701000 | Operation failed.|
## wifiext.getPowerMode<sup>9+</sup> ## wifiext.getPowerMode<sup>9+</sup>
...@@ -146,21 +146,21 @@ Obtains the power mode. This API uses an asynchronous callback to return the res ...@@ -146,21 +146,21 @@ Obtains the power mode. This API uses an asynchronous callback to return the res
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[PowerMode](#powermode)&gt; | 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.| | callback | AsyncCallback&lt;[PowerMode](#powermode)&gt; | 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.|
**Error codes** **Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md). For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **ID**| **Error Message**|
| -------- | -------- | | -------- | -------- |
| 2701000 | Operation failed.| | 2701000 | Operation failed.|
## wifiext.setPowerMode<sup>9+</sup> ## wifiext.setPowerMode<sup>9+</sup>
setPowerMode(model: PowerMode) : boolean; setPowerMode(mode: PowerMode) : void;
Sets the power mode. Sets the power mode.
...@@ -170,14 +170,14 @@ setPowerMode(model: PowerMode) : boolean; ...@@ -170,14 +170,14 @@ setPowerMode(model: PowerMode) : boolean;
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| model | [PowerMode](#powermode) | Yes| Power mode to set.| | model | [PowerMode](#powermode) | Yes| Power mode to set.|
**Error codes** **Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md). For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**| | **ID**| **Error Message**|
| -------- | -------- | | -------- | -------- |
| 2701000 | Operation failed.| | 2701000 | Operation failed.|
...@@ -26,9 +26,9 @@ Enables the WLAN hotspot. ...@@ -26,9 +26,9 @@ Enables the WLAN hotspot.
**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.|
## wifiext.disableHotspot ## wifiext.disableHotspot
...@@ -43,9 +43,9 @@ Disables the WLAN hotspot. ...@@ -43,9 +43,9 @@ Disables the WLAN hotspot.
**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.|
## wifiext.getSupportedPowerModel ## wifiext.getSupportedPowerModel
...@@ -60,9 +60,9 @@ Obtains the supported power models. This API uses a promise to return the result ...@@ -60,9 +60,9 @@ Obtains the supported power models. This API uses a promise to return the result
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;Array&lt;[PowerModel](#powermodel)&gt;&gt; | Promise used to return the power models obtained.| | Promise&lt;Array&lt;[PowerModel](#powermodel)&gt;&gt; | Promise used to return the power models obtained.|
## PowerModel ## PowerModel
...@@ -90,9 +90,9 @@ Obtains the supported power models. This API uses an asynchronous callback to re ...@@ -90,9 +90,9 @@ Obtains the supported power models. This API uses an asynchronous callback to re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;Array&lt;[PowerModel](#powermodel)&gt;&gt; | 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.| | callback | AsyncCallback&lt;Array&lt;[PowerModel](#powermodel)&gt;&gt; | 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 ## wifiext.getPowerModel
...@@ -107,9 +107,9 @@ Obtains the power model. This API uses a promise to return the result. ...@@ -107,9 +107,9 @@ Obtains the power model. This API uses a promise to return the result.
**Return value** **Return value**
| Type| Description| | Type| Description|
| -------- | -------- | | -------- | -------- |
| Promise&lt;[PowerModel](#powermodel)&gt; | Promise used to return the power model obtained.| | Promise&lt;[PowerModel](#powermodel)&gt; | Promise used to return the power model obtained.|
## wifiext.getPowerModel ## wifiext.getPowerModel
...@@ -124,16 +124,16 @@ Obtains the power model. This API uses an asynchronous callback to return the re ...@@ -124,16 +124,16 @@ Obtains the power model. This API uses an asynchronous callback to return the re
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[PowerModel](#powermodel)&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power model obtained. If **err** is not **0**, an error has occurred.| | callback | AsyncCallback&lt;[PowerModel](#powermodel)&gt; | Yes| Callback invoked to return the result. If the operation is successful, **err** is **0** and **data** is the power model obtained. If **err** is not **0**, an error has occurred.|
## wifiext.setPowerModel ## wifiext.setPowerModel
setPowerModel(model: PowerModel) : boolean; setPowerModel(model: PowerModel) : boolean;
Sets the power model. Sets the power model.
**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT **Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
...@@ -141,12 +141,12 @@ Sets the power model. ...@@ -141,12 +141,12 @@ Sets the power model.
**Parameters** **Parameters**
| Name| Type| Mandatory| Description| | Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- | | -------- | -------- | -------- | -------- |
| model | [PowerModel](#powermodel) | Yes| Power model to set.| | model | [PowerModel](#powermodel) | Yes| Power model to set.|
**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.|
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册