Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

plc4j-driver-opcua: Fix incorrectly handled GUID tags #1099

Merged
merged 1 commit into from Sep 25, 2023

Conversation

takraj
Copy link
Contributor

@takraj takraj commented Sep 22, 2023

  1. The driver tried to arraycopy() a Long, which caused ArrayStoreException.
  2. GUIDs are structured objects, that matters when it comes to byte ordering. The OPC-UA protocol uses little (mixed) endian GUID encoding format, while Java uses the standard big endian one (RFC4122), so conversion is needed.

References:

 1. The driver tried to `arraycopy()` a `Long`, which caused `ArrayStoreException`.
 2. GUIDs are structured objects, that matters when it comes to byte ordering.
    The OPC-UA protocol uses little (mixed) endian GUID encoding format, while Java
    uses the standard big endian one (RFC4122), so conversion is needed.

References:
 * https://reference.opcfoundation.org/Core/Part6/v104/docs/5.2.2.6
 * https://en.wikipedia.org/wiki/Universally_unique_identifier#Encoding
 * https://devblogs.microsoft.com/oldnewthing/20220928-00/?p=107221
 * https://docs.oracle.com/javase/8/docs/api/java/util/UUID.html
 * https://www.ietf.org/rfc/rfc4122.txt
@sruehl
Copy link
Contributor

sruehl commented Sep 25, 2023

Thanks for the PR @takraj 🚀

@sruehl sruehl merged commit bd064a5 into apache:develop Sep 25, 2023
@takraj takraj deleted the fix/plc4j-driver-opcua-uuid-tags branch September 25, 2023 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants