Diff of /branches/h-hermsen/mqttsparkplugb/SparkplugB/Function Blocks/FB_SparkplugBSimple/FB_SparkplugBSimple/DBIRTH/GetDeviceBirthCertificate/svnobj [r526] .. [r527]  Maximize  Restore

Switch to side-by-side view

--- a/branches/h-hermsen/mqttsparkplugb/SparkplugB/Function Blocks/FB_SparkplugBSimple/FB_SparkplugBSimple/DBIRTH/GetDeviceBirthCertificate/svnobj
+++ b/branches/h-hermsen/mqttsparkplugb/SparkplugB/Function Blocks/FB_SparkplugBSimple/FB_SparkplugBSimple/DBIRTH/GetDeviceBirthCertificate/svnobj
@@ -1,78 +1,81 @@
-Gx_l!0…jüo´º'…µ)X2System.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
rSysTimeRtc.SysTimeRtcHighResGet(pTimestamp:= _Timestamp);2CurSeqNum := GetSeqNum();´InitEncoderErr := _Encoder.InitializePayloadBeforeAddingMetrics( TimeStamp := _Timestamp, D																 seq := CurSeqNum,†																 AllMetricsWhichWillEverReport := AllMetricsList );NIF InitEncoderErr = ERROR.NO_ERROR THENX	IF AddSimpleMetricErr = ERROR.NO_ERROR THEN		v		// Add all metrics which this device will EVER report on;„		AddAllMetricsListErr :=  AddAllMetrics( TimeStamp := _Timestamp,˜                                                SendList := AllMetricsList, ¦                                                AllMetricsList := AllMetricsList );^		IF AddAllMetricsListErr = ERROR.NO_ERROR THEN^			GetDeviceBirthCertificate := ERROR.NO_ERROR;		ELSEj			GetDeviceBirthCertificate := AddAllMetricsListErr;		END_IF
-	ELSE d		GetDeviceBirthCertificate := AddSimpleMetricErr;!	END_IF"	#ELSE$Z	GetDeviceBirthCertificate := InitEncoderErr;%END_IF&Interface'L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}((*)	DBIRTH*|	The DBIRTH message requires the following payload components.+Î	"  The DBIRTH must include the a seq number in the payload and it must have a value of one greater than,Â	the previous MQTT message from the EoN node contained unless the previous MQTT message contained-n	a value of 255. In this case the seq number must be 0..È	"  The DBIRTH must include a timestamp denoting the DateTime the message was sent from the EoN node./	"  The DBIRTH must include every metric the device will ever report on. 0R	At a minimum these metrics must include:1&		o The metric name2.		o The metric datatype3*		o The current value4OPTIONAL:	5Ì	The DBIRTH message can also include optional  Device Control  payload components. These are used by a6Ô	backend application to control aspects of a device. The following are examples of Device Control metrics.7N	"  Metric name:  Device Control/Reboot 8l		o Used by backend application(s) to reboot a device.9P	"  Metric name:  Device Control/Rebirth :’		o Used by backend application(s) to request a new DBIRTH from a device.;T	"  Metric name:  Device Control/Scan rate <ˆ		o Used by backed application(s) to modify a poll rate on a device.=Ü	The DBIRTH message can also include optional  Properties  of a device. The following are examples of Property>	metrics.?T	"  Metric name:  Properties/Hardware Make @x		o Used to transmit the hardware manufacturer of the deviceAV	"  Metric name:  Properties/Hardware Model Bj		o Used to transmit the hardware model of the deviceC>	" 	Metric name:  Properties/FW Dr		o Used to transmit the firmware version of the device		E*)FPMETHOD GetDeviceBirthCertificate : ERRORGVAR_IN_OUTH0	AllMetricsList : List; IEND_VARJVAR	    K>    DBirth : FB_SparkplugInt64;L,    CurSeqNum : ULINT;M0	InitEncoderErr : ERROR;N8	AddSimpleMetricErr : ERROR;O<	AddAllMetricsListErr : ERROR;ÐÐÐEÐÐ	
-­ZÚÐ-
ÐÐ	
-­[ÚÐ-ÐÐ	
-­\ÚÐ-ÐÐ	
-­]ÚÐ-ÐÐ	
-­^ÚÐ-ÐÐ	
-­_ÚÐ-ÐÐ	
-­`ÚÐ-ÐÐ	
-­aÚÐ-ÐÐ	
-­bÚÐ-ÐÐ	
-­cÚÐ-ÐÐ	
-­dÚÐ-ÐÐ	
-­eÚÐ-ÐÐ	
-­fÚÐ-ÐÐ	
-­gÚÐ-ÐÐ	
-­hÚÐ-ÐÐ	
-­iÚÐ-ÐÐ	
-­jÚÐ-ÐÐ	
-­kÚÐ-ÐÐ	
-­lÚÐ-ÐÐ	
-­mÚÐ-ÐÐ	
-­nÚÐ-ÐÐ	
-­oÚÐ-ÐÐ	
-­pÚÐ-ÐÐ	
-­qÚÐ-ÐÐ	
-­rÚÐ- ÐÐ	
-­sÚÐ-!ÐÐ	
-­tÚÐ-"ÐÐ	
-­uÚÐ-#ÐÐ	
-­vÚÐ-$ÐÐ	
-­}ÚÐ-%Ð&'ÐE-ÐÐ	
-­íÚÐ-(ÐÐ	
-­AÚÐ-)ÐÐ	
-­ðÚÐ-"ÐÐ	
-­ÚÐ-*ÐÐ	
-­ ÚÐ-+ÐÐ	
-­BÚÐ-,ÐÐ	
-­#ÚÐ--ÐÐ	
-­$ÚÐ-.ÐÐ	
-­&ÚÐ-/ÐÐ	
+Gx_l!!!0…jüoˆ’™°ûq;߉6System.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
rSysTimeRtc.SysTimeRtcHighResGet(pTimestamp:= _Timestamp);äWriteDeviceLog( TO_DWORD(CmpLog.LogClass.LOG_ERROR), '_seqNum: %s', TO_STRING(_NextSeqNum) ); // Last known Seqnum2CurSeqNum := GetSeqNum();êWriteDeviceLog( TO_DWORD(CmpLog.LogClass.LOG_ERROR), '_seqNum: %s', TO_STRING(_NextSeqNum) ); // _seqNum := _seqNum+1´InitEncoderErr := _Encoder.InitializePayloadBeforeAddingMetrics( TimeStamp := _Timestamp, D																 seq := CurSeqNum,†																 AllMetricsWhichWillEverReport := AllMetricsList );NIF InitEncoderErr = ERROR.NO_ERROR THENX	IF AddSimpleMetricErr = ERROR.NO_ERROR THEN		v		// Add all metrics which this device will EVER report on;„		AddAllMetricsListErr :=  AddAllMetrics( TimeStamp := _Timestamp,˜                                                SendList := AllMetricsList, ¦                                                AllMetricsList := AllMetricsList );^		IF AddAllMetricsListErr = ERROR.NO_ERROR THEN^			GetDeviceBirthCertificate := ERROR.NO_ERROR;		ELSEj			GetDeviceBirthCertificate := AddAllMetricsListErr; 		END_IF!
+	ELSE"d		GetDeviceBirthCertificate := AddSimpleMetricErr;#	END_IF$	%ELSE&Z	GetDeviceBirthCertificate := InitEncoderErr;'END_IF(Interface)L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}*(*+	DBIRTH,|	The DBIRTH message requires the following payload components.-Î	"  The DBIRTH must include the a seq number in the payload and it must have a value of one greater than.Â	the previous MQTT message from the EoN node contained unless the previous MQTT message contained/n	a value of 255. In this case the seq number must be 0.0È	"  The DBIRTH must include a timestamp denoting the DateTime the message was sent from the EoN node.1	"  The DBIRTH must include every metric the device will ever report on. 2R	At a minimum these metrics must include:3&		o The metric name4.		o The metric datatype5*		o The current value6OPTIONAL:	7Ì	The DBIRTH message can also include optional  Device Control  payload components. These are used by a8Ô	backend application to control aspects of a device. The following are examples of Device Control metrics.9N	"  Metric name:  Device Control/Reboot :l		o Used by backend application(s) to reboot a device.;P	"  Metric name:  Device Control/Rebirth <’		o Used by backend application(s) to request a new DBIRTH from a device.=T	"  Metric name:  Device Control/Scan rate >ˆ		o Used by backed application(s) to modify a poll rate on a device.?Ü	The DBIRTH message can also include optional  Properties  of a device. The following are examples of Property@	metrics.AT	"  Metric name:  Properties/Hardware Make Bx		o Used to transmit the hardware manufacturer of the deviceCV	"  Metric name:  Properties/Hardware Model Dj		o Used to transmit the hardware model of the deviceE>	" 	Metric name:  Properties/FW Fr		o Used to transmit the firmware version of the device		G*)HPMETHOD GetDeviceBirthCertificate : ERRORIVAR_IN_OUTJ0	AllMetricsList : List; KEND_VARLVAR	    M>    DBirth : FB_SparkplugInt64;N,    CurSeqNum : ULINT;O0	InitEncoderErr : ERROR;P8	AddSimpleMetricErr : ERROR;Q<	AddAllMetricsListErr : ERROR;ÐÐÐE!ÐÐ	
+­zÚÐ-
ÐÐ	
+­{ÚÐ-ÐÐ	
+­|ÚÐ-ÐÐ	
+­}ÚÐ-ÐÐ	
+­~ÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­€ÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­‚ÚÐ-ÐÐ	
+­ƒÚÐ-ÐÐ	
+­„ÚÐ-ÐÐ	
+­…ÚÐ-ÐÐ	
+­†ÚÐ-ÐÐ	
+­‡ÚÐ-ÐÐ	
+­ˆÚÐ-ÐÐ	
+­‰ÚÐ-ÐÐ	
+­ŠÚÐ-ÐÐ	
+­‹ÚÐ-ÐÐ	
+­ŒÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­ŽÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­ÚÐ-ÐÐ	
+­‘ÚÐ-ÐÐ	
+­’ÚÐ- ÐÐ	
+­“ÚÐ-ÐÐ	
+­”ÚÐ-!ÐÐ	
+­•ÚÐ-"ÐÐ	
+­–ÚÐ-#ÐÐ	
+­—ÚÐ-$ÐÐ	
+­˜ÚÐ-%ÐÐ	
+­™ÚÐ-&ÐÐ	
+­}ÚÐ-'Ð()ÐE-ÐÐ	
+­íÚÐ-*ÐÐ	
+­AÚÐ-+ÐÐ	
+­ðÚÐ-$ÐÐ	
+­ÚÐ-,ÐÐ	
+­ ÚÐ--ÐÐ	
+­BÚÐ-.ÐÐ	
+­#ÚÐ-/ÐÐ	
+­$ÚÐ-0ÐÐ	
+­&ÚÐ-1ÐÐ	
 ­DÚÐ-ÐÐ	
-­FÚÐ-0ÐÐ	
-­GÚÐ-1ÐÐ	
-­HÚÐ-2ÐÐ	
-­+ÚÐ-3ÐÐ	
+­FÚÐ-2ÐÐ	
+­GÚÐ-3ÐÐ	
+­HÚÐ-4ÐÐ	
+­+ÚÐ-5ÐÐ	
 ­KÚÐ-ÐÐ	
-­EÚÐ-4ÐÐ	
-­,ÚÐ-5ÐÐ	
-­-ÚÐ-6ÐÐ	
-­.ÚÐ-7ÐÐ	
-­0ÚÐ-8ÐÐ	
-­1ÚÐ-9ÐÐ	
-­3ÚÐ-:ÐÐ	
-­4ÚÐ-;ÐÐ	
-­6ÚÐ-<ÐÐ	
-­7ÚÐ-"ÐÐ	
-­IÚÐ-=ÐÐ	
-­8ÚÐ->ÐÐ	
-­9ÚÐ-?ÐÐ	
-­;ÚÐ-@ÐÐ	
-­<ÚÐ-AÐÐ	
-­>ÚÐ-BÐÐ	
-­?ÚÐ-CÐÐ	
-­òÚÐ-DÐÐ	
-­óÚÐ-EÐÐ	
-­ôÚÐ-FÐÐ	
-­õÚÐ-GÐÐ	
-­öÚÐ-HÐÐ	
-­÷ÚÐ-IÐÐ	
-­üÚÐ-JÐÐ	
-­YÚÐ-KÐÐ	
-­WÚÐ-LÐÐ	
-­ýÚÐ-MÐÐ	
-­þÚÐ-NÐÐ	
-­ÿÚÐ-OÐÐ	
-­–ÚÐ-I
\ No newline at end of file
+­EÚÐ-6ÐÐ	
+­,ÚÐ-7ÐÐ	
+­-ÚÐ-8ÐÐ	
+­.ÚÐ-9ÐÐ	
+­0ÚÐ-:ÐÐ	
+­1ÚÐ-;ÐÐ	
+­3ÚÐ-<ÐÐ	
+­4ÚÐ-=ÐÐ	
+­6ÚÐ->ÐÐ	
+­7ÚÐ-$ÐÐ	
+­IÚÐ-?ÐÐ	
+­8ÚÐ-@ÐÐ	
+­9ÚÐ-AÐÐ	
+­;ÚÐ-BÐÐ	
+­<ÚÐ-CÐÐ	
+­>ÚÐ-DÐÐ	
+­?ÚÐ-EÐÐ	
+­òÚÐ-FÐÐ	
+­óÚÐ-GÐÐ	
+­ôÚÐ-HÐÐ	
+­õÚÐ-IÐÐ	
+­öÚÐ-JÐÐ	
+­÷ÚÐ-KÐÐ	
+­üÚÐ-LÐÐ	
+­YÚÐ-MÐÐ	
+­WÚÐ-NÐÐ	
+­ýÚÐ-OÐÐ	
+­þÚÐ-PÐÐ	
+­ÿÚÐ-QÐÐ	
+­–ÚÐ-K
\ No newline at end of file