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

Using negative value in write attributes ? #563

Open
sbernard31 opened this issue Jun 1, 2023 · 4 comments
Open

Using negative value in write attributes ? #563

sbernard31 opened this issue Jun 1, 2023 · 4 comments

Comments

@sbernard31
Copy link

Is it possible to use negative value in write attribute, especially for Greater Than and Less Than ?

The specification LWM2M-v1.2.1@core§Table: 7.3.2.-1 class Attributes says this is not possible :

Attribute Name CoRE Link param Attachment Access Mode Value Type Default Value Applicability
Greater Than "gt" "=" 1DIGIT ["." 1DIGIT] ResourceResource Instance RW Float - Numerical & Readable Resource
Less Than "lt" "=" 1DIGIT ["." 1DIGIT] ResourceResource Instance RW Float - Numerical & Readable Resource

Is it intended or is it a bug ?

@sbernard31
Copy link
Author

Note that LWM2M-v1.2.1@core§Table: 7.3.2.-1 class Attributes also says :

The behaviour of Notification class attributes MUST follow [Cond_Attr] unless stated otherwise in this specification.

And [Cond_Attr§ 3.1. Conditional Notification Attributes ] says :

Attribute Name Value
Greater Than c.gt xs:decimal
Less Than c.lt xs:decimal
Change Step c.st xs:decimal (>0)

So it seems there is a contradiction between both specification.

@sbernard31
Copy link
Author

Note there also a difference with pmin, pmax, epmin and epmax.
In LWM2M they are considered as Integer and in Cond_attr there are decimal.

@mojanm
Copy link

mojanm commented Oct 26, 2023

As "c.gt" and "c.lt" IETF core conditional attributes that are supposed to be aligned with LWM2M attributes can be less than 0, can assume Table 7.3.2.1 in LwM2M spec needs to be updated to reflect this.

@sbernard31
Copy link
Author

@mojanm thx for the answer, this really helps. 🙏
I will be able to update Leshan behavior.

What about pmin, pmax, epmin and epmax ?

Attribute Name CoRE Link param
Minimum Period "pmin" "=" 1*DIGIT
Maximum Period "pmax" "=" 1*DIGIT
Minimum Evaluation Period "epmin" "=" 1*DIGIT
Maximum Evaluation Period "epmax" "=" 1*DIGIT

(from LWM2M-v1.2.1@core§Table: 7.3.2.-1 class Attributes)

I guess it should be adapted too? Replacing 1*DIGIT by 1*DIGIT ["." 1*DIGIT] ?

because :

Attribute Name Value
Minimum Period (s) c.pmin xs:decimal (>0)
Maximum Period (s) c.pmax xs:decimal (>0)
Minimum Evaluation Period (s) c.epmin xs:decimal (>0)
Maximum Evaluation Period (s) c.epmax xs:decimal (>0)

(from [Cond_Attr§ 3.2. Conditional Control Attributes ])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants