Thanks to visit codestin.com
Credit goes to github.com

Skip to content

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

@benjamin-caron

Description

@benjamin-caron

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;
			}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions