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

!11898 【仅md一致性及格式问题】WiFi接口文档一致性检查

Merge pull request !11898 from xiaosi/master
# WLAN扩展接口
该模块主要提供WLAN扩展接口,供非通用类型产品使用。
> ![icon-note.gif](public_sys-resources/icon-note.gif) **说明:**
> 本模块首批接口从API version 8开始支持。后续版本的新增接口,采用上角标单独标记接口的起始版本。
该文档中的接口只供非通用类型产品使用,如路由器等,对于常规类型产品,不应该使用这些接口。
## 导入模块
```js
import wifiext from '@ohos.wifiext';
```
## wifiext.enableHotspot
enableHotspot(): boolean;
使能WLAN热点。
**需要权限:** ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
**返回值:**
| **类型** | **说明** |
| -------- | -------- |
| boolean | 操作结果, true: 成功, false: 失败。 |
## wifiext.disableHotspot
disableHotspot(): boolean;
去使能WLAN热点。
**需要权限:** ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
**返回值:**
| **类型** | **说明** |
| -------- | -------- |
| boolean | 操作结果, true: 成功, false: 失败。 |
## wifiext.getSupportedPowerModel
getSupportedPowerModel(): Promise<Array<PowerModel>>
获取支持的功率模式,使用Promise异步回调。
**需要权限:** ohos.permission.GET_WIFI_INFO
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise<Array<[PowerModel](#powermodel)>> | Promise对象。表示功率模式。 |
## PowerModel
表示功率模式的枚举。
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
| 名称 | 值 | 说明 |
| -------- | -------- | -------- |
| SLEEPING | 0 | 睡眠模式。 |
| GENERAL | 1 | 常规模式。 |
| THROUGH_WALL | 2 | 穿墙模式。 |
## wifiext.getSupportedPowerModel
getSupportedPowerModel(callback: AsyncCallback<Array<PowerModel>>): void
获取支持的功率模式,使用callback异步回调。
**需要权限:** ohos.permission.GET_WIFI_INFO
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<Array<[PowerModel](#powermodel)>> | 是 | 回调函数。当操作成功时,err为0,data表示支持的功率模式。如果error为非0,表示处理出现错误。 |
## wifiext.getPowerModel
getPowerModel(): Promise<PowerModel>
获取功率模式,使用Promise异步回调。
**需要权限:** ohos.permission.GET_WIFI_INFO
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
**返回值:**
| 类型 | 说明 |
| -------- | -------- |
| Promise<[PowerModel](#powermodel)> | Promise对象。表示功率模式。 |
## wifiext.getPowerModel
getPowerModel(callback: AsyncCallback<PowerModel>): void
获取功率模式,使用callback异步回调。
**需要权限:** ohos.permission.GET_WIFI_INFO
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[PowerModel](#powermodel)> | 是 | 回调函数。当操作成功时,err为0,data表示功率模式。如果error为非0,表示处理出现错误。 |
## wifiext.setPowerModel
setPowerModel(model: PowerModel) : boolean;
设置功率模式。
**需要权限:** ohos.permission.MANAGE_WIFI_HOTSPOT_EXT
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
**参数:**
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| model | [PowerModel](#powermodel) | 是 | 功率模式。 |
**返回值:**
| **类型** | **说明** |
| -------- | -------- |
| boolean | 操作结果, true: 成功, false: 失败。 |
......@@ -69,7 +69,7 @@ getSupportedPowerModel(): Promise<Array<PowerModel>>
**系统能力:** SystemCapability.Communication.WiFi.AP.Extension
| 名称 | 默认值 | 说明 |
| 名称 | 值 | 说明 |
| -------- | -------- | -------- |
| SLEEPING | 0 | 睡眠模式。 |
| GENERAL | 1 | 常规模式。 |
......@@ -90,7 +90,7 @@ getSupportedPowerModel(callback: AsyncCallback<Array<PowerModel>>):
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| callback | AsyncCallback<[PowerModel](#powermodel)> | 是 | 回调函数。当操作成功时,err为0,data表示支持的功率模式。如果error为非0,表示处理出现错误。 |
| callback | AsyncCallback<Array<[PowerModel](#powermodel)>> | 是 | 回调函数。当操作成功时,err为0,data表示支持的功率模式。如果error为非0,表示处理出现错误。 |
## wifiext.getPowerModel
......@@ -141,7 +141,7 @@ setPowerModel(model: PowerModel) : boolean;
| 参数名 | 类型 | 必填 | 说明 |
| -------- | -------- | -------- | -------- |
| model | AsyncCallback<[PowerModel](#powermodel)> | 是 | 功率模式。 |
| model | [PowerModel](#powermodel) | 是 | 功率模式。 |
**返回值:**
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册