OpenMobileAlliance / OMA_LwM2M_for_Developers

OMA LightweightM2M public resources.
http://openmobilealliance.github.io/OMA_LwM2M_for_Developers/
Other
240 stars 52 forks source link

Inconsistent TLV specification #551

Open tuve opened 1 year ago

tuve commented 1 year ago

In table 7.4.5-1, the Type field, bits 7-6 states:

10= multiple Resource, in which case the Value contains one or more Resource Instance TLVs

further down on the page you find:

When a Multiple Resource has to be returned to the LwM2M Server, the Multiple Resource TLV MUST be used whatever the number of Instances (0, 1 or more) of that resource.

The conflicting part is 'one or more' vs '(0, 1 or more)'. To me it seems clear that the 'one or more' is at fault since it is quite possible to have a multiple resource with no instances e.g., a error codes. Neither can I see any reason why a writable multiple instance shouldn't be writable as no instances, i.e., clearing a multiple instance resource.

Could someone clarify if a multiple resource type must have instances?

sbernard31 commented 1 year ago

I agree this is probably an error in specification :

10= multiple Resource, in which case the Value contains one or more Resource Instance TLVs

Should be

10= multiple Resource, in which case the Value contains 0, one or more Resource Instance TLVs

sbernard31 commented 1 year ago

And probably also :

00= Object Instance in which case the Value contains one or more Resource TLVs

Should also be :

00= Object Instance in which case the Value contains 0, one or more Resource TLVs

(From : http://www.openmobilealliance.org/release/LightweightM2M/V1_1_1-20190617-A/HTML-Version/OMA-TS-LightweightM2M_Core-V1_1_1-20190617-A.html#Table-744-1-TLV-format-and-description)

Even if the use case is less obvious, I guess maybe you can have some Object Instance with no resource at all (if they are all optional) :shrug: