提交 7cc25fae 编写于 作者: Z z00588131

update sample in doc

Signed-off-by: Nz00588131 <hw.zhangfeng@huawei.com>
上级 359120e7
......@@ -1857,16 +1857,15 @@ off(type: "wifiStateChange", callback?: Callback&lt;number&gt;): 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.
先完成此消息的编辑!
想要评论请 注册