Diff of /branches/develop/mqttsparkplug/mqttsparkplug/Sparkplug™ MQTT edge and host/Function Blocks/FB_CheckSeq/FB_CheckSeq/BDSeqNum/svnobj [000000] .. [r904]  Maximize  Restore

Switch to side-by-side view

--- a
+++ b/branches/develop/mqttsparkplug/mqttsparkplug/Sparkplug™ MQTT edge and host/Function Blocks/FB_CheckSeq/FB_CheckSeq/BDSeqNum/svnobj
@@ -0,0 +1,70 @@
+Gx_lö!0…jüo}wǪÕQQIÚ¥System.StringL{f8a58466-d7f6-439f-bbb8-d4600e41d099}ImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocumentL{f3878285-8e4f-490b-bb1b-9acbb7eb04db}TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}	Id
+longTagText
OK := FALSE;ˆ// Check received bdSeq Metric for Name = "bdSeq" according to spec >IF pMetric^.Name = "bdSeq" THEN    // Datatypej    IF pMetric^.DataType = MetricDataType.UInt64 THEN         // ValueP        _CurBDSeqVal := pMetric^.UInt64;8        CASE _CurBDSeqVal OF            0:€                IF _PrevBDSeqVal = 0 OR _PrevBDSeqVal = 255 THEN®                    // We are either birthing fresh or we have passed the 255 threshold>                    OK := TRUE;d                    _PrevBDSeqVal := _CurBDSeqVal;,                END_IF&            1..255:t                IF _PrevBDSeqVal = (_CurBDSeqVal - 1) THEN         END_CASE    END_IF END_IF!4DoReBirth := (OK = FALSE);"Interface#L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}$(*%:    a bdseq is like bookends.&Ð    The host application should only set the tag s associated to the node stale (and set the node to offline) if the bdseq number matches the last NBIRTH bdSeq number. 'æ    The reason is that NDEATHs are stored in the MQTT Will message at QoS1 and the order in which it could arrive at the host is not guaranteed in combination with a new session. (l    If fact, it will often arrive after a new NBIRTH. )6    Consider the following:*    +l    Edge Node connects - sets Will NDEATH with bdSeq=0,V    Edge Node publishes NBIRTH with bdSeq=0-ô    Edge Node disconnects ungracefully (no NDEATH is published by the Edge Node - but later it will be by the MQTT Server).J    Edge Node connects (sets bdSeq=1)/V    Edge Node publishes NBIRTH with bdSeq=10´    Host application receives NDEATH with bdseq=0 - This NDEATH MUST be ignored as it is no longer valid (as denoted by the old/stale bdSeq number of '0')1–    It is the bdSeq number that correlates a single session s  book-ends . 2¦    The NDEATH with an old/stale bdSeq number MUST be ignored by host applications.3ž    https://eclipse-sparkplug-wg.slack.com/archives/CSVE8K97B/p16151433190391004*)5METHOD BDSeqNum6VAR_INPUT7‚    pMetric : POINTER TO FB_Metric; // Pointer to BDSeqNum Metric8END_VAR9VAR_OUTPUT:(    OK : BOOL; // OK;\    DoReBirth : BOOL; // A rebirth is demanded<(* =`    A generic bdSeq metric looks something like;>
+    {?2        "name": "bdSeq","@H         timestamp": 1486144502122,"A:         dataType": "Uint64",B$        "value": 0C
+    }ÐÐÐEÐÐ	
+­{ÚÐ-
ÐÐ	
+­|ÚÐ-ÐÐ	
+­}ÚÐ-ÐÐ	
+­~ÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­€ÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­‚ÚÐ-ÐÐ	
+­ƒÚÐ-ÐÐ	
+­„ÚÐ-ÐÐ	
+­…ÚÐ-ÐÐ	
+­†ÚÐ-ÐÐ	
+­‡ÚÐ-ÐÐ	
+­ˆÚÐ-ÐÐ	
+­‰ÚÐ-ÐÐ	
+­ŠÚÐ-ÐÐ	
+­‹ÚÐ-ÐÐ	
+­ŒÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­ŽÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­‘ÚÐ-ÐÐ	
+­’ÚÐ-ÐÐ	
+­“ÚÐ-ÐÐ	
+­”ÚÐ- ÐÐ	
+­•ÚÐ-ÐÐ	
+­ÚÐ-!Ð"#ÐE&ÐÐ	
+­§ÚÐ-$ÐÐ	
+­—ÚÐ-%ÐÐ	
+­±ÚÐ-&ÐÐ	
+­ªÚÐ-'ÐÐ	
+­«ÚÐ-(ÐÐ	
+­­ÚÐ-ÐÐ	
+­¬ÚÐ-)ÐÐ	
+­®ÚÐ-*ÐÐ	
+­žÚÐ-+ÐÐ	
+­ŸÚÐ-,ÐÐ	
+­ ÚÐ--ÐÐ	
+­¡ÚÐ-.ÐÐ	
+­¢ÚÐ-/ÐÐ	
+­£ÚÐ-0ÐÐ	
+­¤ÚÐ-*ÐÐ	
+­¯ÚÐ-1ÐÐ	
+­°ÚÐ-2ÐÐ	
+­¥ÚÐ-*ÐÐ	
+­¦ÚÐ-3ÐÐ	
+­–ÚÐ-4ÐÐ	
+­jÚÐ-5ÐÐ	
+­kÚÐ-6ÐÐ	
+­lÚÐ-7ÐÐ	
+­mÚÐ-8ÐÐ	
+­nÚÐ-9ÐÐ	
+­oÚÐ-:ÐÐ	
+­pÚÐ-;ÐÐ	
+­qÚÐ-8ÐÐ	
+­rÚÐ-ÐÐ	
+­sÚÐ-<ÐÐ	
+­tÚÐ-=ÐÐ	
+­uÚÐ->ÐÐ	
+­vÚÐ-?ÐÐ	
+­wÚÐ-@ÐÐ	
+­xÚÐ-AÐÐ	
+­yÚÐ-BÐÐ	
+­zÚÐ-CÐÐ	
+­ÚÐ-4
\ No newline at end of file