OpenMobileAlliance / lwm2m-registry

This is a public repository dedicated to store and register new LwM2M Objects
http://www.openmobilealliance.org/wp/OMNA/LwM2M/LwM2MRegistry.html
48 stars 67 forks source link

Possible little documentation improvement in LWM2M Software Management (object 9) #754

Open sbernard31 opened 2 months ago

sbernard31 commented 2 months ago

Looking at resource 12 of object 9 :

    <Item ID="12">
        <Name>Activation State</Name>
        <Operations>R</Operations>
        <MultipleInstances>Single</MultipleInstances>
        <Mandatory>Mandatory</Mandatory>
        <Type>Boolean</Type>
        <RangeEnumeration></RangeEnumeration>
        <Units></Units>
        <Description><![CDATA[Indicates the current activation state of this software:
0: DISABLED
Activation State is DISABLED if the Software Activation State Machine is in the INACTIVE state or not alive.
1: ENABLED
Activation State is ENABLED only if the Software Activation State Machine is in the ACTIVE state
]]>             </Description>
    </Item>

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 ? 🤔

mkgillmore commented 2 months ago

@sbernard31 OMA's specification clarifies that a boolean is an unsigned 8 bit integer with 0 = false and 1 = true

sbernard31 commented 2 months ago

@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: