Skip to content

Commit 0aff92a

Browse files
Jayceon Fu(付俊臣)Jayceon Fu(付俊臣)
authored andcommitted
checkNet模块增加可直接使用等待网络就绪API的补充说明
1 parent 2eab836 commit 0aff92a

File tree

2 files changed

+29
-1
lines changed

2 files changed

+29
-1
lines changed

en-us/api/QuecPythonClasslib.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2979,6 +2979,20 @@ stagecode = 1, subcode = 0
29792979
stagecode = 1, subcode = 2
29802980
```
29812981

2982+
* Note
2983+
2984+
If the user is using firmware released after November 2021, the user can use the wait_network_connected(timeout) method as follows:
2985+
2986+
```python
2987+
import checkNet
2988+
2989+
if __name__ == '__main__':
2990+
# Add the following sentence before running the program.
2991+
stagecode, subcode = checkNet.wait_network_connected(30)
2992+
print('stagecode = {}, subcode = {}'.format(stagecode, subcode))
2993+
......
2994+
```
2995+
29822996

29832997

29842998
##### checkNet Exception Handling

zh-cn/api/QuecPythonClasslib.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2914,7 +2914,7 @@ sms.setCallback(cb)
29142914

29152915
模块功能:checkNet模块主要用于【开机自动运行】的用户脚本程序,该模块提供API用来阻塞等待网络就绪,如果超时或者其他异常退出会返回错误码,所以如果用户的程序中有涉及网络相关的操作,那么在用户程序的开始应该调用 checkNet 模块中的方法以等待网络就绪。当然,用户也可以自己实现这个模块的功能。
29162916

2917-
注意:当前仅EC600S/EC600N/EC800N/EC200U/EC600U/BC25PA平台支持该功能
2917+
注意:当前仅EC600S/EC600N/EC800N/EC200U/EC600U/BC25PA/平台支持该功能
29182918

29192919
##### 创建checkNet对象
29202920

@@ -3049,6 +3049,20 @@ stagecode = 1, subcode = 0
30493049
stagecode = 1, subcode = 2
30503050
```
30513051

3052+
* 说明
3053+
3054+
如果是202111月以后发布的版本,用户可不用实例化对象,即可直接使用wait_network_connected(timeout)方法,用法如下:
3055+
3056+
```python
3057+
import checkNet
3058+
3059+
if __name__ == '__main__':
3060+
# 在用户程序运行前增加下面这一句
3061+
stagecode, subcode = checkNet.wait_network_connected(30)
3062+
print('stagecode = {}, subcode = {}'.format(stagecode, subcode))
3063+
......
3064+
```
3065+
30523066

30533067

30543068
##### checkNet 异常返回处理

0 commit comments

Comments
 (0)