Repository navigation
Avoid external contentType processing for OPC UA - #1402
danielpeintner wants to merge 3 commits into
Conversation
| 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.
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! |
|
assigning to me, an other library is required to convert node-opcua internal objects to OPCUA+JSON compliant one |
|
Following up on the question I left on #1400 last week. #1574 is now open and CI is green. It supersedes this draft, and it settles the two things left hanging in this thread:
The extra library I mentioned when I took this over in August also exists now, which is what unblocked the 1.04/1.05 JSON encodings. OK to close this one in favour of #1574? |
provides a workaround for #1400, but does not really fix the issue.