#112 Metrics: Read only

2.0.0.0: Edge
closed
None
2021-10-31
2021-01-09
i-campbell
No

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.

Discussion

  • hermsen

    hermsen - 2021-10-10
    • status: accepted --> open
     
  • hermsen

    hermsen - 2021-10-30
    • assigned_to: h-hermsen --> i-campbell
     
  • i-campbell

    i-campbell - 2021-10-31
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -1,8 +1,12 @@
    -Provide a way for a metric and subobjects (properties, datasets, etc) to be read only.
    +Provide a way for a metric to be read only.
    
    -This might be a Function Block Property with an enum:
    -- inherited (default) //if there is no parent to inherit from, then this will be ReadWrite
    -- ReadWrite
    -- readonly
    +This will be a Function Block Property of FB_Metric with an enum called Access, of Type AccessMode:
    +- ReadWrite (default)
    +- ReadOnly
    
    -Note, an FB_Edge and FB_Device should have the same function block property.  This would make it easy to set all metrics of a device to read only.
    +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.
    +
    
    • status: open --> closed
     

Log in to post a comment.