locka99 / opcua

A client and server implementation of the OPC UA specification written in Rust
Mozilla Public License 2.0
515 stars 140 forks source link

Swapped source and server timestamp in AddressSpace::set_variable_value_by_ref function #387

Closed cbusoft closed 1 month ago

cbusoft commented 1 month ago

I noticed that the server timestamp and the source timestamp of variables were switched when using the set_variable_value_by_ref function and set_variable_value on the AddressSpace. This error originates in the call to set_value_direct.

set_value_direct expects the server timestamp before the source timestamp https://github.com/locka99/opcua/blob/9a17f1f2b1ba67e6be724b7657e4b7e564ff93c3/lib/src/server/address_space/variable.rs#L569-L575

but set_variable_value_by_ref calls it with the source timestamp before the server timestamp https://github.com/locka99/opcua/blob/9a17f1f2b1ba67e6be724b7657e4b7e564ff93c3/lib/src/server/address_space/address_space.rs#L1034-L1039