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

No support for reusable resources #329

Open
scop opened this issue Apr 19, 2017 · 4 comments
Open

No support for reusable resources #329

scop opened this issue Apr 19, 2017 · 4 comments
Labels
client Impact LWM2M client new feature New feature from LWM2M specification server Impact LWM2M server

Comments

@scop
Copy link
Contributor

scop commented Apr 19, 2017

Leshan/LwM2mModel appears to have no support for reusable resources. See section 6.3.2 in the specification and http://www.openmobilealliance.org/wp/OMNA/LwM2M/LwM2MRegistry.html#resources and http://www.openmobilealliance.org/wp/OMNA/LwM2M/Common.xml

I suppose a starting point of an approach could be to use a special purpose DDF loader or mechanism for these files (special purpose because at least the above Common.xml has ObjectID 0 which would cause a clash with/overwrite of the Security object if just dumped into the LwM2mModel). Reusable resources could be represented as an object with null id in LwM2mModel.objects and Integer vs current int in ObjectModel.id, although this would cause quite a bit of changes needed for the code in the tree here and there. Or it could be put as a separate field in LwM2mModel, e.g. Map<Integer,ResourceModel> reusableResources.

Anyway, no matter where it is, it could be used for example so that when a resource is looked up for an object with id, if not found from within that specific object, the reusable resources Map could be used as a fallback to search from, with just the resource id used for the lookup.

@sbernard31
Copy link
Contributor

sbernard31 commented Apr 25, 2017

I prefer the second solution : a separate field in LwM2mModel, e.g. Map<Integer,ResourceModel> reusableResources.

@sbernard31 sbernard31 added client Impact LWM2M client new feature New feature from LWM2M specification server Impact LWM2M server labels Apr 25, 2017
@boaks
Copy link

boaks commented Apr 26, 2017

I'm not sure, if there is really a common specification/understanding, how such reusable resources should be handled.

https://github.com/IPSO-Alliance/pub/issues/6

makes me belief, that the IPSO idea is, that "all object" can have such "optional resources" without explicitly declaring that at the object definition. So I will also rise an issue for that on the OMA page.

@boaks
Copy link

boaks commented Oct 17, 2017

According the OMA:

OpenMobileAlliance/OMA_LwM2M_for_Developers#205 (comment)

In LwM2M 1.0 (1.0.1) there is no concept of "implicite" or "explicite" resource : the Resource of an Object can be either Mandatory or Optional; that's all
So when an Object is defined any included Resource (whatever it is reusable or not) must be specified if it is Mandatory or not, multi-Instance or not ..
The re-usable resource has an ID which is publicly registered at OMNA, and a set predefined characteristics (datatype, capability...), but otherwise it has to be handled as any other Resource when it is part of an Object definition.
Thierry

So there is nothing to change in the implementation ...

@sbernard31
Copy link
Contributor

I suppose the benefits to "know" reusable resources in Leshan could be to help to handle unknown object. (as @scop explainedin this last paragraph)

This has some impact in the implementation but I don't know if this is really valuable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client Impact LWM2M client new feature New feature from LWM2M specification server Impact LWM2M server
Projects
None yet
Development

No branches or pull requests

3 participants