Skip to content

Commit

Permalink
fix(knx): Fixed the typed for knx datatypes PDT_BITSET8 and PDT_BITSET16
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdutz committed Feb 6, 2024
1 parent fb33c7b commit fc89f78
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
12 changes: 6 additions & 6 deletions plc4go/protocols/knxnetip/readwrite/model/KnxProperty.go

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

Original file line number Diff line number Diff line change
Expand Up @@ -339,12 +339,12 @@ public static PlcValue staticParse(

boolean value = readSimpleField("value", readBoolean(readBuffer));
return new PlcBOOL(value);
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET8)) { // WORD
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET8)) { // BYTE
short value = readSimpleField("value", readUnsignedShort(readBuffer, 8));
return new PlcWORD(value);
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET16)) { // DWORD
return new PlcBYTE(value);
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET16)) { // WORD
int value = readSimpleField("value", readUnsignedInt(readBuffer, 16));
return new PlcDWORD(value);
return new PlcWORD(value);
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_ENUM8)) { // USINT
short value = readSimpleField("value", readUnsignedShort(readBuffer, 8));
return new PlcUSINT(value);
Expand Down Expand Up @@ -686,10 +686,10 @@ public static int getLengthInBits(

// Simple field (value)
lengthInBits += 1;
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET8)) { // WORD
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET8)) { // BYTE
// Simple field (value)
lengthInBits += 8;
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET16)) { // DWORD
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET16)) { // WORD
// Simple field (value)
lengthInBits += 16;
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_ENUM8)) { // USINT
Expand Down Expand Up @@ -861,10 +861,10 @@ public static void staticSerialize(

// Simple Field (value)
writeSimpleField("value", (boolean) _value.getBoolean(), writeBoolean(writeBuffer));
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET8)) { // WORD
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET8)) { // BYTE
// Simple Field (value)
writeSimpleField("value", (short) _value.getShort(), writeUnsignedShort(writeBuffer, 8));
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET16)) { // DWORD
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_BITSET16)) { // WORD
// Simple Field (value)
writeSimpleField("value", (int) _value.getInteger(), writeUnsignedInt(writeBuffer, 16));
} else if (EvaluationHelper.equals(propertyType, KnxPropertyDataType.PDT_ENUM8)) { // USINT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -987,10 +987,10 @@
[reserved uint 7 '0x00']
[simple bit value]
]
['PDT_BITSET8' WORD
['PDT_BITSET8' BYTE
[simple uint 8 value]
]
['PDT_BITSET16' DWORD
['PDT_BITSET16' WORD
[simple uint 16 value]
]
['PDT_ENUM8' USINT
Expand Down

0 comments on commit fc89f78

Please sign in to comment.