lwm2m.device.composite.write
The lwm2m.device.composite.write command is used to selectively write values to any combination of objects, object instances, resources, and or/resource instances of different or same objects in a single request.
TR50 Request
{
"1": {
"command": "lwm2m.device.composite.write",
"params": {
"thingKey": "leshan_lwm2m_client",
"records": [
{"objId": 3442, "instId": 0, "resId": 110, "data": "WXYZ"},
{"resId": 120, "data": 6789}
],
"encoding": 110
}
}
}
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
id | String | Yes* | The id of the device. |
thingId | String | The id of the thing. | |
thingKey | String | The thingKey of the Thing. | |
esn | String | The ESN of the device. | |
iccid | String | The ICCID of the device. | |
imei | String | The IMEI of the device. | |
imsi | String | The IMSI of the device. | |
meid | String | The MEID of the device. | |
msisdn | String | The MSISIDN of the device. | |
*One of the above fields must be used to identify the device. | |||
records | Array | Yes | An array of record objects specifying values to be written to the device. |
encoding | Integer | Yes | The payload encoding (110:SenML+JSON or 112: SenML+CBOR) |
Request Parameters
Name | Type | Required | Description |
---|---|---|---|
objId | Integer | Yes* | The id of the device. |
instId | Integer | Yes* | The instance ID of the value to write. |
resId | Integer |
Yes |
The resource ID of the value to write. |
resIdx | Integer | The resource index of the value in multi-value resources. | |
data | Mixed |
Yes |
The value to write. |
*If the object/instance ID is omitted from a record, the object/instance ID from the preceding record will be used.
TR50 Request
If the command is sent successfully a success message and the token is returned. Otherwise, an error and error message will be returned.
{
"1": {
"success": true,
}
}