Provide a way for a metric to be read only.
This will be a Function Block Property of FB_Metric with an enum called Access, of Type AccessMode:
- ReadWrite (default)
- ReadOnly
If a xCMD is received, and that metric is ReadOnly, the value is not written. The Edge will however send a new xDATA asserting the old value, so hosts will not be able to assume the write was successful.
SparkplugB spec does not define a way to communicate that a metric is read only, so our library has left this up to the user application. For example, you might add a Boolean Sparkplug property 'ReadOnly'.
Note, FB_Edge and FB_Device do not have a similar property. In future, it will be possible to set the AccesMode also to 'inherited'. This would make it easy to set all metrics of a device to read only.
Diff: