Skip to content

Commit 84b3684

Browse files
Merge pull request #2 from QuecPython/main
600U/200U gpio update
2 parents 7218ede + cf2c3cc commit 84b3684

File tree

4 files changed

+44
-2
lines changed

4 files changed

+44
-2
lines changed

en-us/api/QuecPythonThirdlib.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,44 @@ import log
827827
Testlog = log.getLogger("TestLog")
828828
```
829829

830+
##### Set log output location
831+
832+
> **log.set_output(out)**
833+
834+
Set the log output location. Currently, only uART and usys. Stdout are supported
835+
836+
- parameter
837+
838+
| parameter | Type | Description |
839+
| --------- | -------- | -------------------- |
840+
| out | iterator | uart or usys. stdout |
841+
842+
- Return Value
843+
- None
844+
- Example
845+
846+
```python
847+
import log
848+
log.basicConfig(level=log.INFO)
849+
Testlog = log.getLogger("TestLog")
850+
851+
# Set the output to the debug port
852+
from machine import UART
853+
uart = UART(UART.UART0, 115200, 8, 0, 1, 0)
854+
855+
log.set_output(uart)
856+
857+
Testlog.info("this is a Test log") # Output with the corresponding UART port
858+
859+
# Switch from uART port to interactive port output
860+
import usys
861+
log.set_output(usys.stdout)
862+
863+
Testlog.info("this is a Test log") # Output to the interface
864+
```
865+
866+
#####
867+
830868
##### Output Log Debug
831869

832870
> **log.debug(tag, msg)**
@@ -1214,6 +1252,8 @@ Block waiting for server message response.
12141252
12151253
Get MQTT connection status.
12161254

1255+
Note: The BG95 platform does not support this API.
1256+
12171257
PS: After users use the disconnect() method, and then -1 is returned if MQTTClient.get_mqttsta() is called because the created object resources have been released at this time.
12181258

12191259
* Parameter

en-us/api/pythonStdlib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1567,7 +1567,7 @@ b'\x07\x00\x00\x00\t\x00\x00\x00'
15671567

15681568
##### Pack the values *v1*, *v2*, … according to the format string *fmt* into a *buffer* starting at *offset*
15691569

1570-
> **ustruct.pack_info(fmt, buffer, offset, v1, v2, ...)**
1570+
> **ustruct.pack_into(fmt, buffer, offset, v1, v2, ...)**
15711571
15721572
Pack the values *v1*, *v2*, … according to the format string *fmt* into a *buffer* starting at *offset*. *offset* may be negative to count from the end of *buffer*.
15731573

zh-cn/api/QuecPythonThirdlib.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,6 +1262,8 @@ c.error_register_cb(err_cb)
12621262
12631263
获取mqtt连接状态
12641264

1265+
注意:BG95平台不支持该API。
1266+
12651267
PS:如果用户调用了 disconnect() 方法之后,再调用 MQTTClient.get_mqttsta() 会返回-1,因为此时创建的对象资源等都已经被释放。
12661268

12671269
* 参数

zh-cn/api/pythonStdlib.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1583,7 +1583,7 @@ b'\x07\x00\x00\x00\t\x00\x00\x00'
15831583

15841584
##### 根据格式字符串fmt将值v1、v2、 …打包到从`offset`开始的缓冲区中
15851585

1586-
> **ustruct.pack_info(fmt, buffer, offset, v1, v2, ...)**
1586+
> **ustruct.pack_into(fmt, buffer, offset, v1, v2, ...)**
15871587
15881588
根据格式字符串fmt将值v1、v2、 …打包到从`offset`开始的缓冲区中。从缓冲区的末尾算起,`offset`可能为负。
15891589

0 commit comments

Comments
 (0)