Loading enums from nodeset.xml files does not work for enums with negative values #937
Labels
bug
Fixed: requesting verification
The bug has been resolved and is expecting extra validation by the community t
Current behavior
When loading a nodeset from a xml file, and the xml file contains a enum with negative values a error will be thrown, saying "Error: Invalid Extension Object". See attached project/zip for a example of the error.
Describe the bug
In part 6 of the OPC UA specification, section 5.2.4, enumrations are defined as Int32 values:
Enumerations are encoded as Int32 values.
As such it should be able to handle negative values up to -2147483648.
To Reproduce
Load a nodeset xml with a enum which has a value in the range [-2147483648,-1]. See attached project/zip for a running example.
Expected behavior
The nodeset should load successfully, as negative values in the range [-2147483648,-1] should be allowed according to the OPC UA specification.
Gist
node-opcua does not handle enumerations as Int32 values, but instead as UInt32, when the enum definition is loaded from a nodeset xml file
( ) my request is related to node-opcua acting as an OPCUA CLIENT
(X ) my request is related to node-opcua acting as an OPCUA SERVER
( ) I have installed node-opcua from source ( using git clone)
(X ) I have installed node-opcua as a package ( using npm install )
( ) I am using an application that uses node-opcua
Device: PC
OS version: Windows 10
node-opcua version: :
2.30.0
Node:
node --version
= v14.15.1NodeOpcuaError.zip
The text was updated successfully, but these errors were encountered: