Help Center/
IoT/
FAQs/
Secondary Development/
FAQs About Application Development/
Subscription and Push/
Difference Between deviceDatachanged and deviceDataschanged
Updated on 2022-02-24 GMT+08:00
Difference Between deviceDatachanged and deviceDataschanged
Device change data is subscribed to over the Device Data Change and Batch Device Data Change APIs, and the format for encapsulating data is different.
For example: A water meter has two service types: Battery and Connectivity. The data of the two services is reported each time.
- If deviceDatachanged is subscribed to, the IoT platform pushes the data to the application server twice, Battery service data for the first time, and Connectivity service data for the second time. Examples are as follows:
{ "notifyType": "deviceDataChanged", "deviceId": "70a8d7cd-5ecd-4bda-a87c-afc16bd31bda", "gatewayId": "70a8d7cd-5ecd-4bda-a87c-afc16bd31bda", "requestId": null, "service": { "serviceId": "battery", "serviceType": "battery", "data": {"batteryLevel": 66}, "eventTime": "20170211T034003Z" }}
{"notifyType": "deviceDataChanged","deviceId": "70a8d7cd-5ecd-4bda-a87c-afc16bd31bda", "gatewayId": "70a8d7cd-5ecd-4bda-a87c-afc16bd31bda","requestId": null, "service": { "serviceId": "Connectivity", "serviceType": "Connectivity", "data": { "signalStrength": 72, "cellId": 4022250974, "tac": 61374, "mnc": 91, "mcc": 235 }, "eventTime": "20170211T092317Z" }}
- If deviceDataschanged is subscribed to, the IoT platform encapsulates the data of the two services together and sends the data to the application server.
{ "notifyType": "deviceDatasChanged", "requestId": null, "deviceId": "70a8d7cd-5ecd-4bda-a87c-afc16bd31bda",<br> "gatewayId": "70a8d7cd-5ecd-4bda-a87c-afc16bd31bda",<br> "services": [{ "serviceId": "battery", "serviceType": "battery", "data": { "batteryLevel": 66 }, "eventTime": "20170211T034003Z" }, { "serviceId": "Connectivity", "serviceType": "Connectivity","data": {"signalStrength": 72, "cellId": 4022250974, "tac": 61374, "mnc": 91, "mcc": 235 }, "eventTime": "20170211T034003Z" } ]}
Parent topic: Subscription and Push
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot