tahu icon indicating copy to clipboard operation
tahu copied to clipboard

SparkplugEdgeNode in host package doesn't support bdSeq from 0 to 255. Break at 128.

Open benjamin-caron opened this issue 11 months ago • 1 comments

In the org.eclipse.tahu.host.manager.SparkplugEdgeNode class on NDEATH, when the setOnline(false, ...) is called, it enters the below code:

			// Check the bdSeq
			if (birthBdSeqNum != incomingBdSeq) {
				logger.debug("Mismatched bdSeq number - got {} expected {} - ignoring", incomingBdSeq,
						birthBdSeqNum);
				return;
			} else {
				this.online = online;
				this.offlineTimestamp = timestamp;
			}

We came across the problem by accident, but we can see why it works until a bdSeq of 128 is reached by reading this. So, the fix is to replace the != by using the equals call on the Long object like:

			// Check the bdSeq
			if (!birthBdSeqNum.equals(incomingBdSeq)) {
				logger.debug("Mismatched bdSeq number - got {} expected {} - ignoring", incomingBdSeq,
						birthBdSeqNum);
				return;
			} else {
				this.online = online;
				this.offlineTimestamp = timestamp;
			}

benjamin-caron avatar Feb 03 '25 20:02 benjamin-caron

fixed by Merge pull request https://github.com/eclipse-tahu/tahu/pull/406

lucoblanchard avatar Mar 04 '25 15:03 lucoblanchard