Skip to content

Commit

Permalink
fix(opcua): Add Null Variant (#1124)
Browse files Browse the repository at this point in the history
  • Loading branch information
hutcheb committed Oct 11, 2023
1 parent 5391e37 commit 847fead
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,9 @@ public static Variant staticParse(ReadBuffer readBuffer) throws ParseException {

// Switch Field (Depending on the discriminator values, passes the instantiation to a sub-type)
VariantBuilder builder = null;
if (EvaluationHelper.equals(VariantType, (byte) 1)) {
if (EvaluationHelper.equals(VariantType, (byte) 0)) {
builder = VariantNull.staticParseVariantBuilder(readBuffer);
} else if (EvaluationHelper.equals(VariantType, (byte) 1)) {
builder = VariantBoolean.staticParseVariantBuilder(readBuffer, arrayLengthSpecified);
} else if (EvaluationHelper.equals(VariantType, (byte) 2)) {
builder = VariantSByte.staticParseVariantBuilder(readBuffer, arrayLengthSpecified);
Expand Down
2 changes: 2 additions & 0 deletions protocols/opcua/src/main/xslt/opc-manual.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,8 @@
[simple bit arrayDimensionsSpecified]
[discriminator uint 6 VariantType]
[typeSwitch VariantType,arrayLengthSpecified
['0' VariantNull
]
['1' VariantBoolean (bit arrayLengthSpecified)
[optional int 32 arrayLength 'arrayLengthSpecified']
[array byte value count 'arrayLength == null ? 1 : arrayLength']
Expand Down

0 comments on commit 847fead

Please sign in to comment.