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

!15004 [翻译完成】#I6DG4K

Merge pull request !15004 from Annie_wang/PR13613
# WLAN Extension Interface
# @ohos.wifiManagerExt (WLAN Extension Interface)
This **wifiext** module provides WLAN extension interfaces for non-universal products.
> **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.
......@@ -23,12 +22,13 @@ Enables the WLAN hotspot.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value**
**Error codes**
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.disableHotspot
......@@ -40,12 +40,13 @@ Disables the WLAN hotspot.
**System capability**: SystemCapability.Communication.WiFi.AP.Extension
**Return value**
**Error codes**
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.getSupportedPowerModel
......@@ -59,10 +60,17 @@ Obtains the supported power models. This API uses a promise to return the result
**Return value**
| Type| Description|
| -------- | -------- |
| Promise<Array<[PowerModel](#powermodel)>> | Promise used to return the power models obtained.|
| Type| Description|
| -------- | -------- |
| Promise<Array<[PowerModel](#powermodel)>> | Promise used to return the power models obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## PowerModel
......@@ -89,10 +97,17 @@ Obtains the supported power models. This API uses an asynchronous callback to re
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<Array<[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.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<Array<[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.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.getPowerModel
......@@ -106,10 +121,17 @@ Obtains the power model. This API uses a promise to return the result.
**Return value**
| Type| Description|
| -------- | -------- |
| Promise<[PowerModel](#powermodel)> | Promise used to return the power model obtained.|
| Type| Description|
| -------- | -------- |
| Promise<[PowerModel](#powermodel)> | Promise used to return the power models obtained.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.getPowerModel
......@@ -123,16 +145,23 @@ Obtains the power model. This API uses an asynchronous callback to return the re
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[PowerModel](#powermodel)> | 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.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[PowerModel](#powermodel)> | 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.|
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| 2701000 | Operation failed.|
## wifiext.setPowerModel
setPowerModel(model: PowerModel) : boolean;
Sets the power model.
Sets the power model.
**Required permissions**: ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
......@@ -140,12 +169,14 @@ Sets the power model.
**Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| model | [PowerModel](#powermodel) | Yes| Power model to set.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| model | [PowerModel](#powermodel) | Yes| Power model to set.|
**Return value**
**Error codes**
For details about the error codes, see [Wi-Fi Error Codes](../errorcodes/errorcode-wifi.md).
| **Type**| **Description**|
| -------- | -------- |
| boolean | Returns **true** if the operation is successful; returns **false** otherwise.|
| -------- | -------- |
| 2701000 | Operation failed.|
......@@ -32,7 +32,7 @@
- [reminderAgentManager Error Codes](errorcode-reminderAgentManager.md)
- [workScheduler Error Codes](errorcode-workScheduler.md)
- Security
- [Ability Access Control Error Codes](errorcode-access-token.md)
- [Ability Access Control Error Codes](errorcode-access-token.md)
- [HUKS Error Codes](errorcode-huks.md)
- [Crypto Framework Error Codes](errorcode-crypto-framework.md)
- [Certificate Error Codes](errorcode-cert.md)
......@@ -50,6 +50,7 @@
- Connectivity
- [NFC Error Codes](errorcode-nfc.md)
- [RPC Error Codes](errorcode-rpc.md)
- [Wi-Fi Error Codes](errorcode-wifi.md)
- Basic Features
- [Accessibility Error Codes](errorcode-accessibility.md)
- [FaultLogger Error Codes](errorcode-faultlogger.md)
......
# Wi-Fi Error Codes
## 2401000 STA Internal Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs an operation related to the station (STA).
**Possible Causes**
1. Communication between the Wi-Fi service and the STA failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the Wi-Fi function again.
2. If the error persists, restart the device.
## 2501000 STA Internal Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a STA-related operation.
**Possible Causes**
1. Communication between the Wi-Fi service and the STA failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the Wi-Fi function again.
2. If the error persists, restart the device.
## 2501001 STA Disabled
**Error Message**
Wifi is closed.
**Description**
The Wi-Fi STA function is disabled.
**Possible Causes**
The Wi-Fi function is disabled.
**Solution**
Enable the Wi-Fi function.
## 2601000 Hotspot Module Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a hotspot-related operation.
**Possible Causes**
1. Communication between the Wi-Fi service and the hotspot failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the hotspot again.
2. If the error persists, restart the device.
## 2701000 AP Extension Module Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a hotspot-related operation.
**Possible Causes**
1. Communication between the Wi-Fi service and the hotspot failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the hotspot again.
2. If the error persists, restart the device.
## 2801000 P2P Module Error
**Error Message**
Operation failed.
**Description**
An error occurs when the Wi-Fi service performs a P2P-related operation.
**Possible Causes**
1. Communication with the Wi-Fi service failed.
2. The Wi-Fi chip communication is abnormal.
3. An unknown error has occurred.
**Solution**
1. Disable and then enable the Wi-Fi function again.
2. If the error persists, restart the device.
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册