-
Notifications
You must be signed in to change notification settings - Fork 89
Avoid external contentType processing for OPC UA #1402
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
base: master
Are you sure you want to change the base?
Conversation
@@ -258,7 +258,7 @@ export const theOpcuaJSONCodec = new OpcuaJSONCodec(); | |||
|
|||
export class OpcuaBinaryCodec implements ContentCodec { | |||
getMediaType(): string { | |||
return "application/opcua+octet-stream"; // see Ege | |||
return "application/opcua+octet-stream"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just a left-over I would like to remove
I found this workaround quite sneaky... I'm wondering if you have looked here? It seems that the library is not following our architectural pattern. Instead of defining a |
We quickly discussed some possible solutions in the committer call and we were wondering whether the
are actually right. Should it be with or without |
I have been looking into the code more closely and it seems the node-opcua library call of i.e., node-wot/packages/binding-opcua/src/opcua-protocol-client.ts Lines 310 to 313 in 699e6b6
returns already a JSON structure (see e.g., for dataValue the JSON may look like this {
"value": {
"dataType": "Double",
"arrayType": "Scalar",
"value": 1500
},
"statusCode": {
"value": 0
},
"sourceTimestamp": "2025-07-01T11:59:50.620Z",
"sourcePicoseconds": 824200000,
"serverTimestamp": "2025-07-01T11:59:50.620Z",
"serverPicoseconds": 824200000
} The actual value is the double The call one line after (on line 314) extracts this value.
FYI: By default, the two codecs The whole workflow seems to conflict with what we do in other bindings were we get the raw data and the ContentSerdes converts it if needed (later). Hence, I see the following options to move on:
Comments are welcome! |
provides a workaround for #1400, but does not really fix the issue.