lwm2m.device.composite.read

The lwm2m.device.composite.read command is used to selectively read 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.read",
    "params": {
      "thingKey": "leshan_lwm2m_client","records": [
     { "objId": 1, "instId": 0 },
     { "objId": 3, "instId": 0, "resId": 0 },
     { "resId": 1 },
     { "resId": 2 },
     { "objId": 3442 }
    ],
   "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 The combination of objects/instances/resources to be read. If the object (and instance ID) is omitted from a record, the object (& instance ID) from the preceding record will be used.
encoding Integer Yes The payload encoding (110:SenML+JSON or 112: SenML+CBOR)

TR50 Response

If the command is sent successfully a success message and the selected value to read is returned. Otherwise, an error and error message will be returned.

{
"1": {
 "success": true,
 "params": {
	"result": {
		"1": {
			"0": {
				"0": {
				     "ts": "2022-02-10T14:49:02.2477629Z",
					"value": 123
				},
				"1": {
					"ts": "2022-02-10T14:49:02.2477629Z",
					"value": 300
				},
				"6": {
					"ts": "2022-02-10T14:49:02.2477629Z",
					"value": false
				},
				"7": {
					"ts": "2022-02-10T14:49:02.2477629Z",
					"value": "U"
				},
				"22": {
					"ts": "2022-02-10T14:49:02.2477629Z",
					"value": "U"
				}
			}
		},
		"3": {
			"0": {
				"0": {
					"ts": "2022-02-10T14:49:02.2477629Z",
					"value": "Leshan Demo Device"
				},
				"1": {
				"ts": "2022-02-10T14:49:02.2477629Z",
				"value": "Model 500"
				},
				"2": {
				"ts": "2022-02-10T14:49:02.2477629Z",
				"value": "LT-500-000-0001"
			   }
		    }
	    },
	    "3442": {
		  "0": {
			"110": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": "initial value"
				},
			"120": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": 64
				},
			"125": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": 9223372036854800000
				},
			"130": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": 3.14159
				},
			"140": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": true
				},
			"150": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": "ASNFZ4mrze8="
				},
			"160": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": "2000-01-01T00:00:00Z"
				},
			"170": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": "3:0"
				},
			"1110": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": {
					"0": "initial value"
				}
			},
			"1120": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": {
					"0": 64
				}
			},
			"1125": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": {
			 	"0": 9223372036854800000
				}
			},
			"1130": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": {
			  	  "0": 3.14159
				}
			},
			"1140": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": {
			  	 "0": true
				}
			},
			"1150": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": {
				 "0": "ASNFZ4mrze8="
				}
			},
			"1160": {
			"ts": "2022-02-10T14:49:02.2477629Z",
			"value": {
				"0": "2000-01-01T00:00:00Z"
			  }
			},
			"1170": {
			   "ts": "2022-02-10T14:49:02.2477629Z",
			   "value": {
				"0": "3:0"
		  	  } 
		       }
		    }
	         }
	      }
	   }
       }   
    }	

Response Parameters

Name Type Description
result Array The object structure of the values read. The structure and data will vary by selected device and specified paths.