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

!9808 update sample in doc

Merge pull request !9808 from Zhangfeng/master
......@@ -1857,16 +1857,15 @@ off(type: "wifiStateChange", callback?: Callback<number>): void
```js
import wifi from '@ohos.wifi';
var WIFI_POWER_STATE = "wifiStateChange";
var recvPowerNotifyFunc = result => {
console.info("Receive power state change event: " + result);
}
// Register event
wifi.on(WIFI_POWER_STATE, recvPowerNotifyFunc);
wifi.on("wifiStateChange", recvPowerNotifyFunc);
// Unregister event
wifi.off(WIFI_POWER_STATE, recvPowerNotifyFunc);
wifi.off("wifiStateChange", recvPowerNotifyFunc);
```
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册