Azure-iot-sdk-c: How to get update of only recently updated desired properties?

Created on 25 Sep 2020  ·  3Comments  ·  Source: Azure/azure-iot-sdk-c

My device twin has the following structure where properties A, B and C and so on are being added on run time (not predefined). The JSON object “States” can have up to 160 objects inside.

"desired":
"States": {
"PropertyA": {
"x": 0,
"y": "A"
},
" PropertyB": {
"x": 1,
"y": "B"
},
" PropertyC": {
"x": 2,
"y": "C"
}
}

Currently the complete device twin structure is provided at startup including desired and reported properties, and partial updates are received afterwards. In the device twin partial update I receive the complete object of desired properties.
How can I receive the newly added property only e.g “Property D” or only the most recent changes in a specific property? Is there a predefined function in Azure for this operation?
I do not want to iterate over all the objects inside the “States” object.

question

Most helpful comment

Hi @hizzawaseem
Currently, when updated PATCH requests for twin properties (desired properties) come in to the device, all of the desired properties are sent. So in your example, PropertyA through PropertyD will indeed come in. We do not currently have functionality which only shows the updated "diff".

All 3 comments

Hi @hizzawaseem
Currently, when updated PATCH requests for twin properties (desired properties) come in to the device, all of the desired properties are sent. So in your example, PropertyA through PropertyD will indeed come in. We do not currently have functionality which only shows the updated "diff".

I'm going to go ahead and close this for now but please leave a comment if you would like this reopened.

@hizzawaseem, @danewalton, thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alexmrtn picture alexmrtn  ·  7Comments

kskog picture kskog  ·  5Comments

thematrix9 picture thematrix9  ·  4Comments

kiranpradeep picture kiranpradeep  ·  7Comments

vpetrigo picture vpetrigo  ·  5Comments