Open sbernard31 opened 2 months ago
@sbernard31 OMA's specification clarifies that a boolean is an unsigned 8 bit integer with 0 = false and 1 = true
@mkgillmore, I guess you refer to LWM2M-v1.2.1@core§Appendix C. Data Types (Normative)
I totally missed to look at this.
In the same time, when I read :
Boolean : An 8 bit unsigned integer with the value 0 for False and the value 1 for True.
It seems to me this is kind of mistake to define this here. I mean a boolean is just 2 state true/false. A 8 bit unsigned integer is either a way to store it (implementation concerns) OR a way encode it (content format concerns). For string or number it makes senses to clearly define the "kind" of string/numbers supported but for boolean this is just true false. By the way, we see in LWM2M-v1.2.1@core§Table: C.-2 Data Type Mapping, there is different way to encode boolean (which totally makes sense)
Anyway, I still think that documentation would be clearer with false:DISABLED
/ true:ENABLED
but I agree this is not a big deal too.
If you think my remarks makes sense feel free to take it into account. If you think this does not deserve to change it, I can understand. I reported it just in case :slightly_smiling_face:
Looking at resource 12 of object 9 :
The type is
Boolean
but the description says :0:DISABLED
/1:ENABLED
Maybe this is a bit confusing. (see https://github.com/eclipse-leshan/leshan/issues/1613)Should it be better to replace it with :
false:DISABLED
/true:ENABLED
? 🤔