-
Notifications
You must be signed in to change notification settings - Fork 409
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Negative values handling for Write Attribute #1451
Comments
I'm not sure to understand. If yes, when I look at LWM2M-v1.1.1@core§Table: 5.1.2.-2 class Attributes, I can not see attribute which supports negative value. (see CoRE Link param column) Did I miss something ? |
Yes, I am mostly using REST API. I agree, the specs seems to specify 1*DIGIT["." 1*DIGIT] for greater than for example, but being a float type I would have assumed a possibility of attributes being negative. Here's where this can be of use. For Radio signal strength, the value is usually represented as negative, so using the greater than or less than should be, in general, a negative threshold. Maybe I'm looking at this the wrong way but it does seem to be that the specs are quite vague on this. |
🤔 you maybe find a specification issue ? At least, this seems NOT fixed in LwM2m-v1.2.1 ... Let's open an issue at OMA to try to get an answer : OpenMobileAlliance/OMA_LwM2M_for_Developers#563 Please do not hesitate to add a comment to OMA issue above with your real use case ☝️. |
Thanks for that, I'll keep an eye on the answer! |
I hope we will get an answer 🤞 |
We can some news from OMA :
So I think I will adapt the code and this should be available for next milestone release 2.0.0-M14. |
I created a PR about that : #1535 |
This is now integrated in For pmin, pmax, epmin and epmax let's wait for OMA answer : OpenMobileAlliance/OMA_LwM2M_for_Developers#563 (comment) |
That's a very nice change, thanks, I will try and test that locally! |
Some more question about attribute type : #1583 |
Question
Hello everyone,
I am trying to have a HTTP PUT method that will handle negative values for Attributes. Does leshan not handle negative values for them?
I have checked the code for DoubleAttributeModel and LongAttributeModel here but it seems to be checking for a DIGIT as the first char:
This seems to throw an exception as the "-" sign (or % in the case of %2D) is not handled. So I have not found a way to use either curl or python requests library to write a negative attribute to my resource without altering the java code. Am I missing something?
Thanks in advance
The text was updated successfully, but these errors were encountered: