diff --git a/docs/API_reference/en/cloudlib/Lwm2m.md b/docs/API_reference/en/cloudlib/Lwm2m.md
index 64635b60e56d93fa88fd588cb886969474d6f66d..8ddc3f2a37113232ed3a42781baea90371103d19 100644
--- a/docs/API_reference/en/cloudlib/Lwm2m.md
+++ b/docs/API_reference/en/cloudlib/Lwm2m.md
@@ -1,250 +1,230 @@
-# LWM2M - Lightweight Internet of Things
+# LWM2M - Lightweight M2M (Machine to Machine)
-## Create object
+## Create Object
-> lw=lwm2m()
+### `lwm2m`
-- Parameters
- No
+```python
+lw=lwm2m()
+```
-- Return value
- Lwm2m object
+**Parameter Description:**
-- Example
-
- ```python
- >>> import lwm2m
- >>> lw=lwm2m()
- >>>
- ```
+No parameters.
-## Initialize object
-> lw.init()
-- Parameters
- No
+**Return Value Description:**
-- Return value
- Success: 0
- Failed: -1
+Returns the lwm2m object.
-- Example
+## Initialize Object
+
+### `init`
```python
->>> lw.init()
-0
->>>
+lwm2m.init()
```
-## Configure objects
-
-> lw.config(config_type,config_list)
-
-- Parameters
- config_type: Configuration type
- config_list : List type, configuration parameter list.
-
-- Return value
- Success: 0
- Failed: -1
- Not supported: -2
-
-Introduction to fields in the config_list parameter list
-
-| Field Name | Field Type | Field Description |
-| --------------- | ---------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| serverID | integer | 0 Bootstrap server
1 DM server
|
-| SSID | integer | 100 Bootstrap server
1000 Diagnostics server
|
-| server_addr | string | Server Address, in the format of "address: port", supports a maximum length of 256 |
-| bootstrap | integer | 0. No need to use bootstrap (only if server ID is not 0)
1. Use bootstrap (only if server ID is 0) |
-| security_mode | integer | encryption method:
0 Pre share key mode
3 No security mode |
-| psk_id | string | useful when secure_mode is 0 |
-| psk_key | string | useful when secure_mode is 0 |
-| life_time | integer | lifetime, value range 1~86400, default value 86400, unit: seconds |
-| pmin | integer | pmin default period, value range 1~86400, default value 86400, unit: seconds |
-| pmax | integer | pmax default period, value range 1~86400, default value 86400, unit: seconds |
-| disable_timeout | integer | The time interval from disconnecting from the LwM2M server to the next connection. The range is 1-86400, with a default value of 86400 and a unit of seconds. After testing the port, it can be immediately connected. Invalid (sent to the server, not restricted by the server) |
-| storing | integer | Whether to save server information
0. Do not save
1. Save |
-| binding_mode | string | Server Connection Method
"U" - UDP Method
"UQ" - UDP with Queue Mode
"S" - SMS Method
"SQ" - SMS with Queue Mode
"US" - UDP and SMS Methods
"UQS" - UDP and SMS with Queue Mode |
-| mode | integer | terminal device name format
3 format: urn: imei: xxxxx
lwm2mserver configuration epname format |
-| download | Integer | Download Mode
0 Manual Download
1 Automatic Download |
-| update | integer | update mode
0 Manual update
1 Automatic update |
-| URC_onoff | Integer | Enable URC reporting for LWm2m
0 Disable URC reporting
1 Enable URC reporting |
-
-Introduction to config_type parameter configuration type
-
-| Configuration type name | Corresponding config_list parameter | Remarks |
-| ----------------------- | -------------------------------------------------------------------- | --------------------------------------------------------------- |
-| Epnamemode | [mode] | |
-| Reset | [] | Empty list |
-| Security | [serverID, SSID,server_addr,bootstrap,security_mode,psk_id,psk_key] | |
-| Server | [serverID, life_time,pmin,pmax,disable_timeout,storing,binding_mode] | |
-| Urc | [URC_onoff] | If you want to capture URC, you must configure it to be enabled |
-| Fota | [download, update] | If you want to crawl URLs, configure them to not be automatic |
-
-- Example
+**Parameter Description:**
+
+No parameters.
+
+
+
+**Return Value Description:**
+
+Returns an integer value of 0 for success, and an integer value of -1 for failure.
+
+## Configure Object
+
+### `config`
```python
->>> config=[0,100," coaps://InteropBootstrap.dm.iot.att.com:5694 ",1,0,"urn:imei:864430010001095","313233343536"]
->>> lw.config(lw.Security,config)
-0
->>>
+lwm2m.config(config_type,config_list)
```
-## Register
+**Parameter Description:**
-> lw.register()
+* `config_type` - Configuration type, an enumerated value under the lwm2m object, see Table 1 below.
+* `config_list` - List of configuration parameters, list data type, list element values are explained in Table 2 below.
+
+
-- Parameters
- nothing
+**Return Value Description:**
+
+Returns an integer value of 0 for success, an integer value of -1 for failure, and an integer value of -2 for unsupported operations.
+
+
Table 1
+
+| Configuration Type | Corresponding config_list Parameter | Remarks |
+| ------------------ | ------------------------------------------------------------------- | ------------------------------ |
+| Epnamemode | [mode] | |
+| Reset | [] | Empty list |
+| Security | [serverID,SSID,server_addr,bootstrap,security_mode,psk_id,psk_key] | |
+| Server | [serverID,life_time,pmin,pmax,disable_timeout,storing,binding_mode] | |
+| Urc | [URC_onoff] | Must be enabled to capture URC |
+| Fota | [download,update] | Capture URC in manual mode. |
+
+Table 2
+
+| Field Name | Data Type | Field Description |
+| --------------- | --------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| serverID | Integer | 0 Bootstrap server
1 DM server
|
+| SSID | Integer | 100 Bootstrap server
1000 Diagnostics server
|
+| server_addr | String | Server address in the format "address", maximum length 256. |
+| bootstrap | Integer | 0 Do not use bootstrap (only when serverID is not 0)
1 Use bootstrap (only when serverID is 0) |
+| security_mode | Integer | Encryption method:
0 Pre-shared key mode
3 No security mode |
+| psk_id | String | Used when security_mode is 0 |
+| psk_key | String | Used when security_mode is 0 |
+| life_time | Integer | Lifetime, range 1-86400, default is 86400, in seconds. |
+| pmin | Integer | Default pmin period, range 1-86400, default is 86400, in seconds. |
+| pmax | Integer | Default pmax period, range 1-86400, default is 86400, in seconds. |
+| disable_timeout | Integer | Time interval before the next connection after disconnection from LwM2M server. Range 1-86400, default is 86400, in seconds. |
+| storing | Integer | Whether to save server information:
0 Do not save
1 Save |
+| binding_mode | String | Binding mode with the server:
"U" - UDP mode
"UQ" - UDP with queue mode
"S" - SMS mode
"SQ" - SMS with queue mode
"US" - UDP and SMS mode
"UQS" - UDP and SMS with queue mode |
+| mode | Integer | Terminal device name format:
3 Format: urn:imei
lwm2mserver configured epname format |
+| download | Integer | Download mode:
0 Manual download
1 Automatic download |
+| update | Integer | Update mode:
0 Manual update
1 Automatic update |
+| URC_onoff | Integer | Enable/Disable URC reporting for LwM2M:
0 Disable URC reporting
1 Enable URC reporting |
-- Return value
- Return 0 for successful execution and -1 for failed execution. The registration result needs to be queried by calling the query interface.
+## Register
-- Example
+### `register`
```python
->>> lw.register()
-0
+lwm2m.register()
```
-## Unregister
+**Parameter Description:**
+
+No parameters.
-> lw.unregister()
-- Parameters
- nothing
-- Return value
- Return 0 for successful execution and -1 for failed execution. The cancellation result needs to be queried by calling the query interface.
+**Return Value Description:**
-- Example
+Returns 0 for success, -1 for failure. The registration result requires calling the query interface to check.
+
+## Unregister
+
+### `unregister`
```python
->>> lw.unregister()
-0
+lwm2m.unregister()
```
-## Check registration status
+**Parameter Description:**
+
+No parameters.
+
+
-> lw.stat()
+**Return Value Description:**
-- Parameters
- nothing
+Returns 0 for success, -1 for failure. The unregister result requires calling the query interface to check.
-- Return value
- 0 Unregistered
1 Registering
2 Registered
3 Cancelling
- 4 login failures
+## Query Registration Status
-- Example
+### `stat`
```python
->>> lw.stat()
-0
->>> lw.register()
-0
->>> lw.stat()
-one
->>> lw.unregister()
-0
->>> lw.stat()
-three
->>>
+lwm2m.stat()
```
-## Send heartbeat
+**Parameter Description:**
-> lw.update(SSID)
+No parameters.
-- Parameters
- SSID : The configured SSID, or the SSID issued by BS.
-- Return value
- Command success returns 0, command failure returns -1. The success or failure of the update is determined based on the "+QLWURC:" update "event.
-- Example
+**Return Value Description:**
+
+Returns an integer value of 0 for 'Not Registered' status, 1 for 'Registering' status, 2 for 'Registered' status, 3 for 'Deregistering' status, and 4 for 'Login Failed' status.
+
+## Send Heartbeat
+
+### `update`
```python
->>> lw.update(1)
-0
+lwm2m.update(SSID)
```
-## Register callback function
+**Parameter Description:**
-> lw.register_call(usrfun)
-
-- Parameters
- Usrfun: function
- Prototype of usrfun: usrfun (list)
- Usrfun parameter: type list
- List description:
+* `SSID` - Configured SSID or the SSID issued during BS login in the bootstrap stage, integer value.
+
-| Parameter Description | Parameter Type | Remarks |
-| --------------------- | -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
-| List [0] | int | Event type (can be ignored without processing) |
-| List [1] | int | Event encoding (can be ignored without processing) |
-| List [2] | string | The URC string data captured (please refer to [Event Description](#Event description) for specific event descriptions), and use this parameter to determine the connection event of Lwm2m |
-- Return value
- Success returns 0, failure returns -1
- Note that if you want to delete a registered callback function, pass the parameter None
+**Return Value Description:**
+
+Returns 0 for success, -1 for failure. The result of the update is notified through the callback function.
-- Example
+## Register Callback Function
+
+### `register_call`
```python
->>> import lwm2m
->>> lw=lwm2m()
->>> def lwm2m_call(args):
-... print('args{}'.format(args))
-...
-...
-...
->>>
->>> lw.register_call(lwm2m_call)
-0
->>>
->>> lw.register_call(None)
-0
->>>
->>>
+lwm2m.register_call(usrfun)
```
-## Support platform
-
-| Support Platform | Remarks |
-| --------------------------------------- | ---------------------------------------------------------------- |
-| EC600UEU_AC | Public version is not supported, customized models are supported |
-| BG95M8 | |
-| BG95M3 | |
-| EC200AAU_HA | |
-| EG915NEA_AC | Public version is not supported, customized models are supported |
-| EG912NEN_AA | |
-
-## Event description
-
-The event types may vary slightly across different platforms; for example, some platforms may not have APN, but this does not affect functionality or usability.
-
-| Event type | Description | Remarks |
-| ------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
-| +QLWURC: "pdp active",result,APN | PDP activation result. Before sending a registration request to LwM2M, the PDP server should be activated | Result: string type
"successful"
"failed"
APN: string type
APN value |
-| +QLWURC: "initial",result,SSID | The initialization result of the connection between the client and LwM2M server | Result: string type
"successful"
"failed"
SSID: shape type
0- all servers
other values - other special servers |
-| +QLWURC: "dtls",result,SSID | DTLS handshake result when using encryption method | Same as above |
-| +QLWURC: "bootstraping" | When Bootstrap is working, this URC will be reported | |
-| +QLWURC: "bootstrap",result,SSID | Bootstrap's working result | Same as above |
-| +QLWURC: "registering" | This URC will be reported when the client registers on the LwM2M server | Same as above |
-| +QLWURC: "ready",result,SSID | The registration result after sending a registration request to the LwM2M server | Same as above |
-| +QLWURC: "update",result,SSID | The update result after sending an update request to the LwM2M server | Same as above |
-| +QLWURC: "deregister",SSID,code
+QLWURC: "deregister",code | The logout result after sending a logout request to the LwM2M server | SSID: Shaping type
0- All servers
Other values - Other special servers
Code: Shaping
0- Success
1- Failure
3- Unknown error |
-| +QLWURC: "fota/pkgurl",url | The URL address issued by LWM2M. | |
-| +QLWURC: "apn_changed",APN | APN value issued by LWM2M. | |
-| +QLWURC: "user_name_changed",user | User issued by LWM2M. | |
-| +QLWURC: "secret_changed",password | Password issued by LWM2M | |
-| +QLWURC: "authentication_type_changed", | Authentication issued by LWM2M. | |
-| +QLWURC: "lifetime_changed",lifetime | The lifetime issued by LWM2M | |
-| +QLWURC: "current_time_changed",data_time | The data_time issued by LWM2M is added with UTC_OFFSET. | |
-
-###### Example usage
+**Parameter Description:**
+
+* `usrfun` - The callback function to be set, which is called when the server responds.
+
+**回调函数参数**
+
+* `list` - The callback function notification data, list type, described in detail below:
+
+| Element | Data Type | Description |
+| ------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
+| list[0] | Integer | Event type (can be ignored) |
+| list[1] | Integer | Event code (can be ignored) |
+| list[2] | Integer | Captured URC string data (specific event description can be found in [Event-Description](#Event-Description), used to determine the connection event of Lwm2m. |
+
+
+
+**Return Value Description:**
+
+Returns 0 for success, -1 for failure. To remove an already registered callback function, pass in None.
+
+## Supported Platforms
+
+| Supported Platform | Remarks |
+| ------------------ | ------------------------------------------------------------- |
+| EC600UEU_AC | Standard version not supported, customized versions supported |
+| BG95M8 | |
+| BG95M3 | |
+| EC200AAU_HA | |
+| EG915NEA_AC | Standard version not supported, customized versions supported |
+| EG912NEN_AA | |
+
+## Event-Description
+
+The event types may vary slightly across platforms, for example, some platforms do not have APN, which does not affect functionality or usage.
+
+| Event Type | Description | Remarks |
+| -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
+| +QLWURC: "pdp active",result,APN | Result of PDP activation. Before sending the registration request to LwM2M, the PDP server should be activated. | result: string type
"successfully"
"failed"
APN: string type
APN value |
+| +QLWURC: "initial",result,SSID | Initialization result when the client connects to the LwM2M server. | result: string type
"successfully"
"failed"
SSID: integer type
0 - All servers
Other values - Specific servers |
+| +QLWURC: "dtls",result,SSID | DTLS handshake result when using encryption. | Same as above |
+| +QLWURC: "bootstraping" | Reports this URC when the bootstrap process is active. | |
+| +QLWURC: "bootstrap",result,SSID | Result of the Bootstrap process. | Same as above |
+| +QLWURC: "registering" | Reports this URC when the client is registering with the LwM2M server. | Same as above |
+| +QLWURC: "ready",result,SSID | Result of registration request sent to the LwM2M server. | Same as above |
+| +QLWURC: "update",result,SSID | Result of update request sent to the LwM2M server. | Same as above |
+| +QLWURC: "deregister",SSID,code
+QLWURC: "deregister",code | Result of the deregistration request sent to the LwM2M server. | SSID: integer type
0 - All servers
Other values - Specific servers
Code: integer
0 - Success
1 - Failure
3 - Unknown Error |
+| +QLWURC: "fota/pkgurl",url | URL address issued by LWM2M. | |
+| +QLWURC: "apn_changed",APN | APN value issued by LWM2M. | |
+| +QLWURC: "user_name_changed",user | User name issued by LWM2M. | |
+| +QLWURC: "secret_changed",password | Password issued by LWM2M. | |
+| +QLWURC: "authentication_type_changed", | Authentication type issued by LWM2M. | |
+| +QLWURC: "lifetime_changed",lifetime | Lifetime issued by LWM2M. | |
+| +QLWURC: "current_time_changed",data_time | Data time issued by LWM2M with UTC_OFFSET. | |
+
+
+
+###### Example Usage.
```python
import utime
@@ -267,7 +247,7 @@ class lwm2m_client():
self.connect_server_type = 0 # 0 - server, 1 - bsserver
self.imei = modem.getDevImei()
self.security_mode = 3 # 3 - no Pre-share key mode, 0 Pre-share key mode
- self.epname_mode = 3 # 3 - urn:imei:+imei
+ self.epname_mode = 3 # 3 - urn:imei:+imei .
self.support_security_mode=[0,2,3]
self.psk="urn:imei:{}".format(self.imei)
diff --git a/docs/API_reference/zh/cloudlib/Lwm2m.md b/docs/API_reference/zh/cloudlib/Lwm2m.md
index ac8e8fa00cc21cbdc9697694eab4b8f7e0a46acb..ac99afe6d242c5563b75f424f72327a370d12904 100644
--- a/docs/API_reference/zh/cloudlib/Lwm2m.md
+++ b/docs/API_reference/zh/cloudlib/Lwm2m.md
@@ -2,60 +2,77 @@
## 创建对象
-> lw=lwm2m()
+### `lwm2m`
-* 参数
- 无
-- 返回值
- lwm2m对象
+```python
+lw=lwm2m()
+```
+
+**参数描述:**
+
+无参数。
+
+
+
+**返回值描述:**
-- 示例
+返回lwm2m对象。
+
+## 初始化对象
+
+### `init`
```python
->>> import lwm2m
->>> lw=lwm2m()
->>>
+lwm2m.init()
```
-## 初始化对象
+**参数描述:**
+
+无参数。
+
-> lw.init()
-- 参数
- 无
+**返回值描述:**
-- 返回值
- 成功: 0
- 失败: -1
+成功返回整型数值0,失败返回整型数值-1。
-- 示例
+## 配置对象
+
+### `config`
```python
->>> lw.init()
-0
->>>
+lwm2m.config(config_type,config_list)
```
-## 配置对象
+**参数描述:**
-> lw.config(config_type,config_list)
+* `config_type` - 配置类型 ,枚举型,lwm2m对象下的枚举数值,详见表1。
+* `config_list` - 配置参数列表 ,列表数据类型,列表元素值详见表2。
+
+
-- 参数
- config_type:配置类型
- config_list : 列表类型,配置参数列表。
+**返回值描述:**
-- 返回值
- 成功: 0
- 失败: -1
- 不支持:-2
+成功返回整型数值0,失败返回整型数值-1,不支持返回整型数值-2。
-用于config_list参数列表中的字段介绍
+表1
+
+| 配置类型名 | 对应的config_list参数 | 备注 |
+| ---------- | ------------------------------------------------------------------- | ----------------- |
+| Epnamemode | [mode] | |
+| Reset | [] | 空list |
+| Security | [serverID,SSID,server_addr,bootstrap,security_mode,psk_id,psk_key] | |
+| Server | [serverID,life_time,pmin,pmax,disable_timeout,storing,binding_mode] | |
+| Urc | [URC_onoff] | 如果要抓取URC,必须配置开启 |
+| Fota | [download,update] | 如果要抓取URC,配置成均不自动。 |
+
+表2
| 字段名 | 字段类型 | 字段说明 |
| --------------- | ---- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
| serverID | 整型 | 0 Bootstrap server
1 DM server
|
| SSID | 整型 | 100 Bootstrap server
1000 Diagnostics server
|
-| server_addr | 字符串 | 服务器地址,格式为:"address:port",最长支持256。 |
+| server_addr | 字符串 | 服务器地址,格式为:"address:port",最长支持256。 |
| bootstrap | 整型 | 0 不用bootstrap(仅当serverID不为0)
1 使用bootstrap (仅当serverID为0) |
| security_mode | 整型 | 加密方法:
0 Pre-share key mode
3 No security mode |
| psk_id | 字符串 | security_mode为0时有用 |
@@ -71,150 +88,105 @@
| update | 整型 | 更新模式
0 手动更新
1 自动更新 |
| URC_onoff | 整型 | 是否开启LWm2m的urc上报
0 禁用URC上报
1 启用URC上报 |
-config_type参数配置类型介绍
-
-| 配置类型名 | 对应的config_list参数 | 备注 |
-| ---------- | ------------------------------------------------------------------- | ----------------- |
-| Epnamemode | [mode] | |
-| Reset | [] | 空list |
-| Security | [serverID,SSID,server_addr,bootstrap,security_mode,psk_id,psk_key] | |
-| Server | [serverID,life_time,pmin,pmax,disable_timeout,storing,binding_mode] | |
-| Urc | [URC_onoff] | 如果要抓取URC,必须配置开启 |
-| Fota | [download,update] | 如果要抓取URL,配置成均不自动。 |
+## 注册
-- 示例
+### `register`
```python
->>> config=[0,100,"coaps://InteropBootstrap.dm.iot.att.com:5694",1,0,"urn:imei:864430010001095","313233343536"]
->>> lw.config(lw.Security,config)
-0
->>>
+lwm2m.register()
```
-## 注册
+**参数描述:**
+
+无参数
-> lw.register()
-- 参数
- 无
-- 返回值
- 执行成功返回0,执行失败返回-1。注册结果需要调用查询接口进行查询。
+**返回值描述:**
+
+执行成功返回0,执行失败返回-1。注册结果需要调用查询接口进行查询。
+
+## 注销
-- 示例
+### `unregister`
```python
->>> lw.register()
-0
+lwm2m.unregister()
```
+**参数描述:**
+
+无参数。
-## 注销
-> lw.unregister()
+**返回值描述:**
-- 参数
- 无
+执行成功返回0,执行失败返回-1。注销结果需要调用查询接口进行查询。
-- 返回值
- 执行成功返回0,执行失败返回-1。注销结果需要调用查询接口进行查询。
+## 查询注册状态
-- 示例
+### `stat`
```python
->>> lw.unregister()
-0
+lwm2m.stat()
```
+**参数描述:**
+
+无参数。
-## 查询注册状态
-> lw.stat()
+**返回值描述:**
-- 参数
- 无
+未注册状态返回整型值0,注册中状态返回整型值1,已注册状态返回整型值2,注销中状态返回整型值3,登录失败状态返回整型值4。
-- 返回值
- 0 未注册
1 注册中
2 已注册
3 注销中
- 4 登录失败
+## 发送心跳
-- 示例
+### `update`
```python
->>> lw.stat()
-0
->>> lw.register()
-0
->>> lw.stat()
-1
->>> lw.unregister()
-0
->>> lw.stat()
-3
->>>
+lwm2m.update(SSID)
```
-## 发送心跳
+**参数描述:**
+
+* `SSID` - 配置的SSID或者是BS登录阶段BS下发的SSID,整型值。
+
+
-> lw.update(SSID)
+**返回值描述:**
-- 参数
- SSID : 配置的SSID,或者BS下发的SSID。
+成功返回整型值0,失败返回整型值-1。update结果通过回调函数通知。
-- 返回值
- 指令成功返回0,指令失败返回-1.更新成功或失败结果根据“+QLWURC: "update"事件进行判断。
+## 注册回调函数
-- 示例
+### `register_call`
```python
->>> lw.update(1)
-0
+lwm2m.register_call(usrfun)
```
+**参数描述:**
+* `usrfun` - 设置消息回调函数,function类型,当服务端响应时触发该方法。
-## 注册回调函数
+**回调函数参数**
-> lw.register_call(usrfun)
+* `list` - 回调函数通知消息数据,list类型,详细介绍如下:
-- 参数
- usrfun:函数
- usrfun原型:usrfun(list)
- usrfun参数:类型list
- list说明:
+| 元素 | 数据类型 | 备注 |
+| ------- | ---- | ------------------------------------------------------- |
+| list[0] | 整型 | 事件类型(可以不处理忽略) |
+| list[1] | 整型 | 事件编码(可以不处理忽略) |
+| list[2] | 整型 | 抓取到的URC字符串数据(具体事件说明请参考[事件说明](#事件说明),以此参数判断Lwm2m的连接事件为准 |
-| 参数明 | 参数类型 | 备注说明 |
-| ------- | ------ | ------------------------------------------------------- |
-| list[0] | int | 事件类型(可以不处理忽略) |
-| list[1] | int | 事件编码(可以不处理忽略) |
-| list[2] | string | 抓取到的URC字符串数据(具体事件说明请参考[事件说明](#事件说明)),以此参数判断Lwm2m的连接事件为准 |
-- 返回值
- 成功返回0,失败返回-1.
- 注意如果要删除已经注册的回调函数,传入参数None.
-- 示例
+**返回值描述:**
-```python
->>> import lwm2m
->>> lw=lwm2m()
->>> def lwm2m_call(args):
-... print('args{}'.format(args))
-...
-...
-...
->>>
->>> lw.register_call(lwm2m_call)
-0
->>>
->>> lw.register_call(None)
-0
->>>
-
->>>
-```
+成功返回0,失败返回-1。注意如果要删除已经注册的回调函数,传入参数None.
## 支持平台
@@ -234,14 +206,14 @@ config_type参数配置类型介绍
| 事件类型 | 说明 | 备注 |
| -------------------------------------------------------------- | --------------------------------------- | ------------------------------------------------------------------------------------------------ |
| +QLWURC: "pdp active",result,APN | PDP的激活结果。在向 LwM2M 发送注册请求之前,应激活 PDP 服务器。 | result:string类型
"successfully"
"failed"
APN:string类型
APN值 |
-| +QLWURC: "initial",result,SSID | 客户端与LwM2M服务器连接的初始化结果。 | result:string类型
"successfully"
"failed"
SSID:整形类型
0-所有的服务器
其他值-其他的特殊服务器 |
+| +QLWURC: "initial",result,SSID | 客户端与LwM2M服务器连接的初始化结果。 | result:string类型
"successfully"
"failed"
SSID:整型类型
0-所有的服务器
其他值-其他的特殊服务器 |
| +QLWURC: "dtls",result,SSID | 使用加密方法时的 DTLS 握手结果。 | 同上 |
| +QLWURC: "bootstraping" | 当 Bootstrap 工作时,将报告此 URC。 | |
| +QLWURC: "bootstrap",result,SSID | Bootstrap 的工作结果。 | 同上 |
| +QLWURC: "registering" | 当客户端在 LwM2M 服务器上注册时将报告此 URC。 | 同上 |
| +QLWURC: "ready",result,SSID | 向LwM2M服务器发送注册请求后的注册结果。 | 同上 |
| +QLWURC: "update",result,SSID | 向LwM2M服务器发送更新请求后的更新结果。 | 同上 |
-| +QLWURC: "deregister",SSID,code
+QLWURC: "deregister",code | 向LwM2M服务器发送注销请求后的注销结果。 | SSID:整形类型
0-所有的服务器
其他值-其他的特殊服务器
Code:整形
0-成功
1-失败
3-未知错误 |
+| +QLWURC: "deregister",SSID,code
+QLWURC: "deregister",code | 向LwM2M服务器发送注销请求后的注销结果。 | SSID:整型类型
0-所有的服务器
其他值-其他的特殊服务器
Code:整型
0-成功
1-失败
3-未知错误 |
| +QLWURC: "fota/pkgurl",url | LWM2M下发的url地址。 | |
| +QLWURC: "apn_changed",APN | LWM2M下发的APN值。 | |
| +QLWURC: "user_name_changed",user | LWM2M下发的user。 | |