#39 FB_SparkplugB_SimpleEncoder

1.0.0.0: EoN
closed
aliazzz
None
2020-10-03
2020-07-24
aliazzz
No

FB_SparkplugB_SimpleEncoder

This function block acts as a Helper to reduce work for FB_EoN.
The FB contains a protobuf blob encoder and various methods to quickly create (compose and/or encode) various messages. Since this FB is of the 'simple' variant, it can can only deal with the SimpleObjects type.

Messages which are mandatory for this FB are:

  • Node Death Certificate
  • Node Birth Certificate
  • Node Data
  • Device Death Certificate
  • Device Birth Certificate
  • Device Data

Pass a list of every All Metrics Which Will Ever Reported on during this "Lifetime". (1)

  • UpdateListOfMetricsWhichWillEverReportedOn( ListOfMetricsWhichWillEverReportedOn )
    Note 1
    This Method can be used to pass the entire list of metrics which will ever be
    reported on and send this list ONLY on node / device (re)birth. We can only send
    values which have been 'announced at birth' of the Node or Device. Since the
    Device or Node can die and be reborn, elements could be added or removed from the
    list which will be announced only at the next Birth.
    
    Warning!
    Never send values that have not been announced this Birth!
    
    Idea
    Add a way to let a Node/Device die and be reborn in order to anounce the latest
    list so we can update 'on-the-fly'
    

Pass a single instance of SimpleObject to the Encoder. (2)

  • AddSimpleMetric( Timestamp, SimpleObject )
    Note 2
    This method accepts a single SimpleObject deliberatly, to keep burnerplate code low
    and added flexibility as it is not mandatory for a SimpleObject to be part of an 
    array or a list. The SimpleObject must have been announced at this Birth.
    

Pass a prepared list of SimpleObjects to the Encoder. (3)

  • AddMetricList( Timestamp, ListOfSimpleObjects )
    Note 3
    This method accepts a List of SimpleObject, this way you can send multiple values
    in one list. This list can not contain other metrics metrics than those announced
    on birth. The list is thus at most the same list as "ListOfMetricsWhichWillEverReportedOn".
    

Apart from these Methods the FB contains various methods for interaction and diagnosis

  • Diag // Diagnosis of the internal decoder state
  • Encode( Enable ) // Start Encoding if Enable = TRUE, Stops encoding if enable = FALSE
  • Encoded // Is encoding finished?
  • EncodeBusy // Is the encoder busy?
  • EncodeError( => eError ) // An error occured
  • InitEncoderBeforeAddingMetrics( Timestamp, SeqNr) // Initialize the Encoder before adding Metrics
  • GetBDSeqNum
  • GetSeqNum

Last but not least it should provide the end user with a way to obtain the protobuf encoded (serialized) blob in order to publish it under the correct SparkPlugB Topic

  • GetEncodedBlob( BlobAdr, BlobSize )

Discussion

<< < 1 2 (Page 2 of 2)
  • aliazzz

    aliazzz - 2020-09-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -5,16 +5,16 @@
    
     Messages which are mandatory for this FB are:
    
    -* [ ] Node Death Certificate
    -* [ ] Node Birth Certificate
    -* [ ] Node Data 
    -* [ ] Device Death Certificate
    -* [ ] Device Birth Certificate
    -* [ ] Device Data
    +* [x] Node Death Certificate
    +* [x] Node Birth Certificate
    +* [x] Node Data 
    +* [x] Device Death Certificate
    +* [x] Device Birth Certificate
    +* [x] Device Data
    
     Pass a list of every All Metrics Which Will Ever Reported on during this &#34;Lifetime&#34;. (1)
    
    -* [ ] UpdateListOfMetricsWhichWillEverReportedOn( ListOfMetricsWhichWillEverReportedOn )
    +* [x] UpdateListOfMetricsWhichWillEverReportedOn( ListOfMetricsWhichWillEverReportedOn )
    
             Note 1
             This Method can be used to pass the entire list of metrics which will ever be
    @@ -33,7 +33,7 @@
    
     Pass a single instance of SimpleObject to the Encoder. (2)
    
    -* [ ] AddSimpleMetric( Timestamp, SimpleObject ) 
    +* [x] AddSimpleMetric( Timestamp, SimpleObject ) 
    
             Note 2
             This method accepts a single SimpleObject deliberatly, to keep burnerplate code low
    @@ -43,7 +43,7 @@
    
     Pass a prepared list of SimpleObjects to the Encoder. (3)
    
    -* [ ] AddMetricList( Timestamp, ListOfSimpleObjects ) 
    +* [x] AddMetricList( Timestamp, ListOfSimpleObjects ) 
    
             Note 3
             This method accepts a List of SimpleObject, this way you can send multiple values
    
    • status: accepted --> pending
     
  • aliazzz

    aliazzz - 2020-09-24
    • Description has changed:

    Diff:

    --- old
    +++ new
    @@ -10,7 +10,7 @@
     * [x] Node Data 
     * [x] Device Death Certificate
     * [x] Device Birth Certificate
    -* [ ] Device Data
    +* [x] Device Data
    
     Pass a list of every All Metrics Which Will Ever Reported on during this &#34;Lifetime&#34;. (1)
    
     
  • aliazzz

    aliazzz - 2020-10-03

    This Ticket is sufficiently closed
    Any bugs will receive their own ticket

     
  • aliazzz

    aliazzz - 2020-10-03
    • status: pending --> closed
     
<< < 1 2 (Page 2 of 2)

Log in to post a comment.