
上QQ阅读APP看书,第一时间看更新
How it works...
In this sample, we retrieved the current information of the device twin and updated the desired properties, which were accessible on the device side. In the code, we set the coordinates of the device with latitude and longitude values, the device owner name, and so on. This same value will be accessible on the device side.
In a similar manner, we can set some properties on the device side which will be a part of the reported properties. While using the device twin, we must always consider:
- Tags can be set, read, and accessed only by the backend
- The reported properties are set by a device and can be read by the backend
- The desired properties are set by the backend and can be read by the backend
- We can use the read-only version and the last updated properties elements to detect updates when necessary
Each device twin size is limited to 8 KB per device in the IoT Hub.