Bug in LogData class
-
According to the standard, BACnetLogData is a choice of log-status, log-data or time-change.
However, looking at com.serotonin.bacnet4j.type.constructed.LogData.java:```
public LogData(ByteQueue queue) throws BACnetException {
logStatus = read(queue, LogStatus.class, 0);
logData = readSequenceOfChoice(queue, classes, 1);
timeChange = read(queue, Real.class, 2);
}@Override public void write(ByteQueue queue) { write(queue, logStatus, 0); write(queue, logData, 1); write(queue, timeChange, 2); }
By changing
public LogData(ByteQueue queue) throws BACnetException { logStatus = read(queue, LogStatus.class, 0); logData = readSequenceOfChoice(queue, classes, 1); timeChange = read(queue, Real.class, 2); }
public LogData(ByteQueue queue) throws BACnetException { int tag = peekTagNumber(queue); if (tag == 0) { logStatus = read(queue, LogStatus.class, 0); logData = null; timeChange = null; } else if (tag == 1) { logStatus = null; logData = readSequenceOfChoice(queue, classes, 1); timeChange = null; } else if (tag == 2) { logStatus = null; logData = null; timeChange = read(queue, Real.class, 2); } else { throw new BACnetErrorException(ErrorClass.property, ErrorCode.missingRequiredParameter); } }