diff --git a/zh-cn/application-dev/reference/apis/js-apis-wifiManager.md b/zh-cn/application-dev/reference/apis/js-apis-wifiManager.md index 1e78aa5516640af9ebb8497b14e0ce6ea115f085..a9ee02b0bc22c76d76ef5d084cbf206d0ede364d 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wifiManager.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wifiManager.md @@ -1662,21 +1662,6 @@ isBandTypeSupported(bandType: WifiBandType): boolean } ``` -## WifiBandType 10+ - -表示wifi频段类型的枚举。 - -**系统能力:** SystemCapability.Communication.WiFi.STA - -| 名称 | 值 | 说明 | -| -------- | -------- | -------- | -| WIFI_BAND_NONE | 0 | 未定义。 | -| WIFI_BAND_2G | 1 | 2G频段。 | -| WIFI_BAND_5G | 2 | 5G频段。 | -| WIFI_BAND_6G | 3 | 6G频段。 | -| WIFI_BAND_60G | 4 | 60G频段。| - - ## wifi.get5GChannelList10+ get5GChannelList(): Array<number> @@ -1708,6 +1693,57 @@ get5GChannelList(): Array<number> console.error("failed:" + JSON.stringify(error)); } ``` +## wifi.getDisconnectedReason10+ + +getDisconnectedReason(): DisconnectedReason + +获取最近一次断连原因 + +**系统接口:** 此接口为系统接口。 + +**需要权限:** ohos.permission.GET_WIFI_INFO 和 ohos.permission.GET_WIFI_CONFIG + +**系统能力:** SystemCapability.Communication.WiFi.STA + +**错误码:** + +以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 + +| **错误码ID** | **错误信息** | + | -------- | -------- | +| 2601000 | Operation failed.| + +**返回值:** + +| **类型** | **说明** | +| -------- | -------- | +| DisconnectedReason | 最近断开的原因 | + +**示例:** +```js + import wifiManager from '@ohos.wifiManager'; + + try { + let disconnectedReason = wifiManager.getDisconnectedReason(); + console.info("disconnectedReason:" + disconnectedReason); + }catch(error){ + console.error("failed:" + JSON.stringify(error)); + } +``` + +## DisconnectedReason 10+ + +表示wifi断开原因的枚举。 + +**系统接口:** 此接口为系统接口。 + +**系统能力:** SystemCapability.Communication.WiFi.STA + +| 名称 | 值 | 说明 | +| -------- | -------- | -------- | +| DISC_REASON_DEFAULT | 0 | 默认原因。 | +| DISC_REASON_WRONG_PWD | 1 | 密码错误。 | +| DISC_REASON_CONNECTION_FULL | 2 | 路由器的连接数已达到最大数量限制。 | ## wifi.enableHotspot9+ @@ -2285,6 +2321,8 @@ getP2pLocalDevice(callback: AsyncCallback<WifiP2pDevice>): void | -------- | -------- | -------- | -------- | | callback | AsyncCallback<[WifiP2pDevice](#wifip2pdevice9)> | 是 | 回调函数。当操作成功时,err为0,data表示本端设备信息。如果error为非0,表示处理出现错误。 | +**错误码:** + | **错误码ID** | **错误信息** | | -------- | -------- | | 2801000 | Operation failed.| diff --git a/zh-cn/application-dev/reference/apis/js-apis-wifiManagerExt.md b/zh-cn/application-dev/reference/apis/js-apis-wifiManagerExt.md index 64ae484e6adcaf0104dd2aadadcc11d18c883758..3cbda2cbb89d4f1313764f4a3ba4e4c850f658cd 100644 --- a/zh-cn/application-dev/reference/apis/js-apis-wifiManagerExt.md +++ b/zh-cn/application-dev/reference/apis/js-apis-wifiManagerExt.md @@ -26,7 +26,7 @@ enableHotspot(): void; 以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 -| **类型** | **说明** | +| **错误码ID** | **错误信息** | | -------- | -------- | | 2701000 | Operation failed.| @@ -44,7 +44,7 @@ disableHotspot(): void; 以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 -| **类型** | **说明** | +| **错误码ID** | **错误信息** | | -------- | -------- | | 2701000 | Operation failed.| @@ -68,11 +68,11 @@ getSupportedPowerMode(): Promise<Array<PowerMode>> 以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 -| **类型** | **说明** | +| **错误码ID** | **错误信息** | | -------- | -------- | | 2701000 | Operation failed.| -## PowerMode +## PowerMode9+ 表示功率模式的枚举。 @@ -105,7 +105,7 @@ getSupportedPowerMode(callback: AsyncCallback<Array<PowerMode>>): vo 以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 -| **类型** | **说明** | +| **错误码ID** | **错误信息** | | -------- | -------- | | 2701000 | Operation failed.| @@ -129,7 +129,7 @@ getPowerMode(): Promise<PowerMode> 以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 -| **类型** | **说明** | +| **错误码ID** | **错误信息** | | -------- | -------- | | 2701000 | Operation failed.| @@ -153,13 +153,13 @@ getPowerMode(callback: AsyncCallback<PowerMode>): void 以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 -| **类型** | **说明** | +| **错误码ID** | **错误信息** | | -------- | -------- | | 2701000 | Operation failed.| ## wifiext.setPowerMode9+ -setPowerMode(model: PowerMode) : boolean; +setPowerMode(model: PowerMode) : void; 设置功率模式。 @@ -177,6 +177,6 @@ setPowerMode(model: PowerMode) : boolean; 以下错误码的详细介绍请参见[WIFI错误码](../errorcodes/errorcode-wifi.md)。 -| **类型** | **说明** | +| **错误码ID** | **错误信息** | | -------- | -------- | | 2701000 | Operation failed.|