-
Notifications
You must be signed in to change notification settings - Fork 90
Parse nodeId from href #1368
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
Parse nodeId from href #1368
Conversation
keep *old* form as fallback
|
|
||
| export interface FormPartialNodeDescription { | ||
| "opcua:nodeId": NodeIdLike | NodeByBrowsePath; | ||
| "opcua:nodeId"?: NodeIdLike | NodeByBrowsePath; |
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.
General question/comment:
Why do we have interface FormPartialNodeDescription and OPCUAFormInvoke.
It is somewhat similar without extending (OPCUA)Form.
Moreover, OPCUAForm extends FormPartialNodeDescription again !?
Some dependencies I don't understand, and I wonder whether we can simplify it.
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.
I simplified it, and we do not see any problems when testing via unit tests nor when testing with real devices
|
|
||
| export interface OPCUAFormInvoke extends OPCUAForm { | ||
| "opcua:method": NodeIdLike | NodeByBrowsePath; | ||
| "opcua:method"?: NodeIdLike | NodeByBrowsePath; |
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.
I don't think this line addition is needed. OPCUAForm has already the same?
OPCUAForm extends FormPartialNodeDescription which contains it...
|
Are there any blockers here? |
Not really from my side. Unfortunately, I cannot really test the changes myself since on my windows box OPCUA is blocked. Need to find another machine. @egekorkan you mentioned you can (want) to test it. Would be great if you can provide feedback! |
|
Can't we add some additional tests alongside the existing ones (eg. remove the old opcua:method and use the url instead) to test this properly? |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1368 +/- ##
==========================================
+ Coverage 77.63% 78.14% +0.51%
==========================================
Files 83 79 -4
Lines 16603 15270 -1333
Branches 1611 1445 -166
==========================================
- Hits 12890 11933 -957
+ Misses 3682 3320 -362
+ Partials 31 17 -14 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
I added some counter tests next to the existing ones ... some tests require special syntax w.r.t. to the server which the href approach doesn't offer |
|
Note: the ECA check seems to be broken |
I can try with some real OPC UA device on Thursday morning :) |
|
|
Happy to confirm that the PR works with real devices. I have tried a TD with base and without base and both worked, meaning the URL arithmetic from the core package cause no issue. Of course, and as expected, one cannot split the query parameter and put a part of it into the base as we are not doing simple string concat. |
relu91
left a comment
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.
I think we can improve the doc a little bit, other than that it's good to go.
|
I will update the readme before integrating the PR. |
|
The PR seems to be ready to merge. README has been updated. |
relu91
left a comment
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.
LGTM
Daniel, If you don't have a PLC OPCUA server at hand, you can still start in a standalone mode, the small test server that we use in the unit tests. >cd packages\binding-opcua
packages\binding-opcua> DEBUG=node-wot* npx tsx test\fixture\basic-opcua-server.ts
node-wot:binding-opcua:basic-opcua-server:info Server started: opc.tcp://yourmachine:7890 +0ms |
|
The problem was/is that the protocol is blocked on my company device, but meanwhile I found a detour to make it work.. |
I started to look into. Unfortunately, OPC UA protocol is blocked on my machine at the moment and I need to fix that issue first. I just coded what I think should work...
TODO: Update readme, see https://github.com/eclipse-thingweb/node-wot/tree/master/packages/binding-opcua#form-extensionsb912d32fixes #1367