What Is the Difference Between deviceDataChanged and deviceDatasChanged?
If an application subscribes to device data change notifications (deviceDataChanged) or batch device data change notifications (deviceDatasChanged), the IoT platform pushes notifications of device data changes to the application either way, but the format for encapsulating data is different.
- If deviceDataChanged is subscribed to, the platform pushes the data to the application twice, Battery service data for the first time, and Connectivity service data for the second time. For example:
{ "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 platform includes information for both services in a single batch of data sent to the application.
{ "notifyType":"deviceDatasChanged", "requestId":null, "deviceId":"70a8d7cd-5ecd-4bda-a87c-afc16bd31bda", "gatewayId":"70a8d7cd-5ecd-4bda-a87c-afc16bd31bda", "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" } ] }
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.