-
Notifications
You must be signed in to change notification settings - Fork 67
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
Path_MakePath should handle ResourceInstanceID #317
Comments
Hi @mkmk88 the example that you posted here does not make much sense since resource 5700 is not a collection. |
Be careful here. In the original design, the formal term "Path" does not refer to the Resource Instance, it is only for referring to a Resource (i.e. Object/ObjectInstance/Resource). There are many places within the API where this distinction is important. The only place (currently) where you'll see paths that include a ResourceInstance ID (like "/3303/0/5700/0") is with the tool command line. This is a convenience thing and is not reflected internally. There are many API functions that take a Path and a separate Resource Instance ID. This is intentional. |
Ok I don't insist that Path_MakePath should be changed, but still it is confusing while using awa-server-read tool. I've created one instance of Object 3303 and one instance of Resource 5700 within that object. Then, for the test, I want to use awa-server to read this particular instance. And if I go with awa-server-read <client_name> /3303/0/5700/0 (because this is the format I expect as a user) I'm getting my result, but there is double print of it (the same result is printed twice). Only if I omit the Resource ID then I'm getting correct single read. I didn't test what happen if I have two instances of given resource, yet. All in all I want to report the confusion while using awa-server-read tool. So, maybe the title of this issue is now wrong, but I hope the description is now clear. I can change the title if needed of course. I'll also have a look what happens if I have more instances of given resource (how the awa-server-read behaves). |
i now see the point about this resource not being a collection. Thank you for clarification. |
The api/src/path.c:Path_MakePath should handle ResourceInstanceID argument. The use case is for example when running awa-server-read. Currently, if you pass full URI (for example "/3303/0/5700/0") you'll get the result twice. Also, I guess you cannot read specific resource instance if you have many of them.
The text was updated successfully, but these errors were encountered: