0
votes

is it possible to partially update the reported properties from the device side? So far I only saw articles talking about partially updating the desired properties, like this one: https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-device-twins.

If this is possible, is this doable with the azure-iot-hub-c-sdk?

Thanks

2

2 Answers

0
votes

Yes, it is doable to update the desired properties with azure-iot-hub-c-sdk. You can refer to the sample iothub_client_sample_device_twin. If you run the sample after modified the connectionString, you will get the partial changes from the Azure portal, as following: enter image description here

0
votes

Yes, this is documented at Understand and use device twins in IoT Hub (retrieved on 2018 Jul 19).

The device app operates on the device twin using the following atomic operations:

  • Retrieve device twin. This operation returns the device twin document (including tags and desired and reported system properties) for the currently connected device.
  • Partially update reported properties. This operation enables the partial update of the reported properties of the currently connected device. This operation uses the same JSON update format that the solution back end uses for a partial update of desired properties.
  • Observe desired properties. The currently connected device can choose to be notified of updates to the desired properties when they happen. The device receives the same form of update (partial or full replacement) executed by the solution back end.