Skip to content

Commit

Permalink
fix(bacnet):fixed status of BACnetAccumulatorRecord
Browse files Browse the repository at this point in the history
  • Loading branch information
sruehl committed Jun 8, 2022
1 parent 168884f commit ea0f00d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 2 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions plc4go/protocols/bacnetip/readwrite/model/StaticHelper.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,11 @@ func ReadEnumGenericFailing(readBuffer utils.ReadBuffer, actualLength uint32, te
return 0, errors.Errorf("unmapped value %d", rawValue)
}
return BACnetFileAccessMethod(rawValue), nil
case BACnetAccumulatorRecordAccumulatorStatus:
if value := uint8(rawValue); rawValue > math.MaxUint8 || !BACnetAccumulatorRecordAccumulatorStatusKnows(value) {
return 0, errors.Errorf("unmapped value %d", rawValue)
}
return BACnetAccumulatorRecordAccumulatorStatus(rawValue), nil
default:
panic(fmt.Sprintf("support for %T not yet implemented", template))
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ public static Object readEnumGenericFailing(ReadBuffer readBuffer, Long actualLe
if (!BACnetFileAccessMethod.isDefined((short) rawValue))
throw new ParseException("Invalid value " + rawValue + " for " + BACnetFileAccessMethod.class.getSimpleName());
return BACnetFileAccessMethod.enumForValue((short) rawValue);
}else if (declaringClass == BACnetAccumulatorRecordAccumulatorStatus.class) {
if (!BACnetAccumulatorRecordAccumulatorStatus.isDefined((short) rawValue))
throw new ParseException("Invalid value " + rawValue + " for " + BACnetAccumulatorRecordAccumulatorStatus.class.getSimpleName());
return BACnetAccumulatorRecordAccumulatorStatus.enumForValue((short) rawValue);
}
throw new ParseException("Unmapped type " + declaringClass);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5440,6 +5440,6 @@
presentValue ]
[simple BACnetContextTagSignedInteger('2', 'BACnetDataType.SIGNED_INTEGER')
accumulatedValue ]
[simple BACnetAccumulatorRecordAccumulatorStatusTagged('0', 'TagClass.APPLICATION_TAGS')
[simple BACnetAccumulatorRecordAccumulatorStatusTagged('3', 'TagClass.CONTEXT_SPECIFIC_TAGS')
accumulatorStatus ]
]

0 comments on commit ea0f00d

Please sign in to comment.