tahu
tahu copied to clipboard
SparkplugEdgeNode in host package doesn't support bdSeq from 0 to 255. Break at 128.
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;
}
fixed by Merge pull request https://github.com/eclipse-tahu/tahu/pull/406