Azure / opendigitaltwins-dtdl

Digital Twins Definition Language
Creative Commons Attribution 4.0 International
466 stars 160 forks source link

Question: How to understanding `writable`? #121

Closed catundercar closed 2 years ago

catundercar commented 2 years ago

The explain of writable is "A boolean value that indicates whether the property is writable by an external source, such as an application, or not. The default value is false (read-only).", I have a confusion about it. Does it mean that need two API for managing twins? One used by twin management web, Another one is used by external source? Are there any example or practical scenarios? Looking forward to your answer,thanks~

rido-min commented 2 years ago

Hey @Mrliu8023

The concept of writable properties is mapped to desired/reported properties in DeviceTwins, explained here https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-device-twins

There are APIs for device and service side, each of those allows to read/write where apropiate:

catundercar commented 2 years ago

Thanks, Does this mean that the property, which is unwritable, can not edit after created?

rido-min commented 2 years ago

In both cases the properties can be edited after created.

Thanks for the feedback, I understand your confusion.

catundercar commented 2 years ago

Thanks!