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

!8869 【翻译完成】#I5LCCV

Merge pull request !8869 from Annie_wang/PR7885
# WLAN
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br/>
> **NOTE**<br>
> 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.
The APIs of this module are not supported by OpenHarmony 3.1 Release.
## Modules to Import
......@@ -17,13 +18,13 @@ enableHotspot(): boolean;
Enables the WLAN hotspot.
- Required permissions:
- **Required permissions**:
ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
- System capability:
- **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 +36,13 @@ disableHotspot(): boolean;
Disables the WLAN hotspot.
- Required permissions:
- **Required permissions**:
ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
- System capability:
- **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,15 +52,15 @@ Disables the WLAN hotspot.
getSupportedPowerModel(): Promise&lt;Array&lt;PowerModel&gt;&gt;
Obtains the supported power models. The method uses a promise to return the result.
Obtains the supported power models. The API uses a promise to return the result.
- Required permissions:
- **Required permissions**:
ohos.permission.GET_WIFI_INFO
- System capability:
- **System capability**:
SystemCapability.Communication.WiFi.AP.Extension
- Return value
- **Return value**:
| Type| Description|
| -------- | -------- |
| Promise&lt;Array&lt;[PowerModel](#PowerModel)&gt;&gt; | Promise used to return the power models obtained.|
......@@ -67,7 +68,7 @@ Obtains the supported power models. The method uses a promise to return the resu
## PowerModel
Enumerates of the power models.
Enumerates the power models.
| Name| Default Value| Description|
| -------- | -------- | -------- |
......@@ -80,33 +81,33 @@ Enumerates of the power models.
getSupportedPowerModel(callback: AsyncCallback&lt;Array&lt;PowerModel&gt;&gt;): void
Obtains the supported power models. The method uses an asynchronous callback to return the result.
Obtains the supported power models. The API uses an asynchronous callback to return the result.
- Required permissions:
- **Required permissions**:
ohos.permission.GET_WIFI_INFO
- System capability:
- **System capability**:
SystemCapability.Communication.WiFi.AP.Extension
- Parameters
- **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[PowerModel](#PowerModel)&gt; | Yes| Callback used to return the power models obtained.|
| callback | AsyncCallback&lt;[PowerModel](#PowerModel)&gt; | Yes| Callback invoked to return the power models obtained.|
## wifiext.getPowerModel
getPowerModel(): Promise&lt;PowerModel&gt;
Obtains the power model. The method uses a promise to return the result.
Obtains the power model. The API uses a promise to return the result.
- Required permissions:
- **Required permissions**:
ohos.permission.GET_WIFI_INFO
- System capability:
- **System capability**:
SystemCapability.Communication.WiFi.AP.Extension
- Return value
- **Return value**:
| Type| Description|
| -------- | -------- |
| Promise&lt;[PowerModel](#PowerModel)&gt; | Promise used to return the power model obtained.|
......@@ -116,15 +117,15 @@ Obtains the power model. The method uses a promise to return the result.
getPowerModel(callback: AsyncCallback&lt;PowerModel&gt;): void
Obtains the power model. The method uses an asynchronous callback to return the result.
Obtains the power model. The API uses an asynchronous callback to return the result.
- Required permissions:
- **Required permissions**:
ohos.permission.GET_WIFI_INFO
- System capability:
- **System capability**:
SystemCapability.Communication.WiFi.AP.Extension
- Parameters
- **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback&lt;[PowerModel](#PowerModel)&gt; | Yes| Callback invoked to return the power mode obtained.|
......@@ -136,18 +137,18 @@ setPowerModel(model: PowerModel) : boolean;
Sets the power model.
- Required permissions:
- **Required permissions**:
ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
- System capability:
- **System capability**:
SystemCapability.Communication.WiFi.AP.Extension
- Parameters
- **Parameters**
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| model | AsyncCallback&lt;[PowerModel](#PowerModel)&gt; | Yes| Power model to set.|
- Return value
- **Return value**:
| **Type**| **Description**|
| -------- | -------- |
| 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.
先完成此消息的编辑!
想要评论请 注册