-
Notifications
You must be signed in to change notification settings - Fork 408
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
Discover on instance level not implemented? #369
Comments
Hi, Currently the Leshan Client discover implementation is only based on model description. As far as I know nobody is working on that. If you want to provide a PR for Leshan you're welcome :).
JFYI :
HTH |
@sbernard31 Thx for the detailed feedback! We are using the LeshanClient for a simulator at the moment, and it is in our interest that it can discover on instance level so it behaves according to spec. |
Ok good to know :) is it an open source simulator ? |
Unfortunately not, it's proprietary. It's designed to simulate Lwm2m clients that comply with a messaging protocol that we're building on top of Lwm2m. |
I'm ready to have a new go at this now, it doesn't seem like anybody else is working on it? What you wrote above still applies, as far as I can see, e.g. Discover is currently just based on the ObjectModel and would need to be extended all the way down to |
After looking into the specification a little more, I will also need to take a look at the handling of attributes on object and instance level, since they should be in Discover on all levels. |
Sry for delayed response. Yep, nobody is currently working on that, so you can go on it. |
You're right, and since the attributes must be reported in the Discover response along with the links, I will also have a look at any improvements that can be made to the attribute handling. What exists is basically the ObserveSpec class, that represents the NOTIFICATION class attributes in the Lwm2m spec. But it's more optimized for serving the CoAP layer, e.g. through the toQueryParams() method. ObserveSpec is also used in the WriteAttributesRequest constructors. It serves as a wrapper around some rules that are mentioned in the spec, e.g. throw an error if pmin > pmax. I will open a pull request as soon as I have something worth looking at and then work on from there. |
Do you need support of attributes too ? I mean we can envisage a better support of Discover at instance level without support of attributes in a first time. If you need both and those 2 features are not too interwoven. It will be easier to review if we make this step by step. |
You might be right that it would be better to split these features up, but then I suppose we should reverse the order and start with attribute support, which is perhaps what you mean as well? I'm just a little afraid that it will be hard to understand the attribute requirements fully without looking into the Discover functionality requirements at the same time. For instance, if you perform Discover on a resource, the attributes on both the object level and instance level should be inherited and included in the DiscoverResponse. This means that a first implementation of only Discover on instance level may be hard to pull off too. But I will try to find a way to split it up into separate units of work. |
I don't know. To be honest I'm not sure to see the real interest about attributes. Especially as we don't support But I let you investigate that :) |
I've looked into it a little further now. We rely heavily on observe in our solution, and to be able to control the data volumes that are generated it's imperative for us to be able to set the pmin and pmax attributes. And because of that it's also very important for us to be able to simulate both WriteAttributes and full Discover. Please consider the following interface and implementations to handle attributes in a consistent way:
Abstract base implementation
And then one implementation for each supported attribute:
My idea then is that when you create a WriteAttributesRequest, you inject a group of parameters in the constructor, and a rule engine makes sure that they're writable and that they're consistent, e.g. pmin < pmax etc. |
So you want to define a kind of model for Attributes (I means objects containing metadata about attributes) A bit like we do for LwM2mModel ? FMPOV if we go in those way the model should not contains the value (or this instance should not contains the metadata). I mean we need only 1 instance in memory which describes what is the MinimumPeriodAttribute metadata and several instance of MinimumPeriodAttribute with theirs value. |
OK, I see your point about duplicated metadata. I'll take that into consideration moving forward. |
Pull request for this... #478 |
+1 |
If my Lwm2m server implementation needs to check if the connected device supports the Factory Reset resource on the Device object, my understanding is that I should perform a Discover on the Device Instance, e.g. /3/0. Then I need to examine the returned resource links to see if /3/0/5 is present. Is this correct?
If the answer is Yes, Discover doesn't seem to be implemented on the Instance level, e.g. in the LwM2mInstanceEnabler interface. Is this correct, or am I looking in the wrong place?
If it isn't implemented yet, is anybody working on it? If not, I might have a look at it myself and then some pointers on where to call the LwM2mInstanceEnabler.discover method would be much appreciated!
The text was updated successfully, but these errors were encountered: