lwm2m-registry icon indicating copy to clipboard operation
lwm2m-registry copied to clipboard

RangeEnumeration are not consistent with the specification

Open jvermillard opened this issue 2 years ago • 0 comments

The specification (appendix D of the LWM2M 1.1 core spec):

Range or Enumeration: this field limits the possible values of a Resource. A range is defined using two numeric values separated by two dots ("..") to indicate the lower and upper limits (inclusive). Enumeration is defined using one or more comma separated values. For the opaque data type, the value in this field represents constraints on the length of the Resource expressed in octets. For example, 1..42 indicates that the Resource can be 1 to 42 octets long. A value of 5,10,15 in this field indicates that the Resource can be 5, 10, or 15 octets long. A value of 8 in this field indicates that the Resource is always 8 octets long. For the string data type, a numeric range or enumeration has the same meaning as the opaque data type. Additionally, a comma separated list of quoted strings indicates the enumerated string values. For example, "foo","bar" indicates that the string Resource can only have the value foo or bar.

But in practice in the repository we have a zoo of different format, example:

<RangeEnumeration>-30..-120</RangeEnumeration>
<RangeEnumeration>1-32 Bytes</RangeEnumeration>
<RangeEnumeration>64 Bytes</RangeEnumeration>
<RangeEnumeration>[1:4]</RangeEnumeration>
<RangeEnumeration>12 Bytes </RangeEnumeration>
<RangeEnumeration>8-Bits</RangeEnumeration>
<RangeEnumeration>ON;OFF</RangeEnumeration>
<RangeEnumeration>0..2^32-1</RangeEnumeration>

This is not machine readable as stated on the LWM2M Registry Guidelines: https://github.com/OpenMobileAlliance/lwm2m-registry/wiki/Guidelines

Machine-readable definition of valid values for the resource. Ranges of values are expressed with two dots, e.g.: '0..250'. List of valid values can be given as comma separated list. See Appendix D of LwM2M TS 1.1.1 for details.

jvermillard avatar Oct 28 '22 15:10 jvermillard