Open sbernard31 opened 2 years ago
@sbernard31 Is this an issue that has been clarified in the IETF?
@mkgillmore I'm not sure to see which IETF clarification is needed.
At least from my point of view, the 2 RFC (RFC7049 and RFC8428) are clear.
I think "issue" comes with LWM2M specification.
For CBOR,
LWM2M add some limitation for date compare to RFC. (maybe it's OK but I just ask why ? to be sure this is not an unintentional issue?)
RFCt allows Floating point number and negative one, so is there any reason to limit it to unsigned integer in LWM2M ?
For SenML-CBOR
LWM2M seems to add some contradiction with the RFC.
RFC says that v
value should be encoded as number.
LWM2M says v
should be encoded"as a JSON float if the Resource data type is Integer, Float, or Time" but also says Time should be "Represented as date/time strings, as defined in Section 2.4.1 of [RFC7049]".
I think for SenML-CBOR, this should rather be "integers, floating-point numbers, or decimal fractions (CBOR Tag 4) as defined in in Section 6 of RFC8428"
?
Well spotted @sbernard31
I also think that the spec is too vague here. The description for TEXT actually makes it clear that LWM2M 1.2 doesn't allow TIME values before Jan 01 1970. The unsigned integer type for the CBOR formats is inline with this restriction, while TLV and SenML JSON allow negative numbers and hence bypass the restriction.
At DMSO, we actually need to decide if we want to enforce TIME always to be newer than Jan 01 1970. In this case, we'd need to put a restriction into the spec for TLV and SENML_JSON. In the contrary case of allowing prior dates, we'd need to turn SENML_JSON to Integer (less range...) and need to discuss what to do with TEXT (for example allow a - prefix)
@eliasweingaertner, you raise the point about consistency between all format regarding "allowing TIME values before Jan 01 1970", this is a good point that I missed.
And that point :point_up: should be addressed to correctly answer to my CBOR question, but my question was more why LWM2M limit to string where RFC support String and different kind of number.
For SenML question, this is not too much related. My point was more that "LWM2M say to encode time with string" where "RFC say to use number". (so here LWM2M goes againts RFC)
To be crystal clear, I think the most important point about SenML is that : "Represented as an unsigned integer or a date/time string, as defined in Section 2.4.1 of [RFC7049]." should be replaced by : "Represented as integers, floating-point numbers, or decimal fractions (CBOR Tag 4) as defined in in Section 6 of RFC8428"
Group agrees to remove "unsigned" to the description
@mkgillmore, thanks for letting me know that, I really appreciate it. :pray:
I guess your are talking about SenML description, right ?
IF I'm right AND as I understand the specification THEN keeping "a date/time string" is :
In my opinion, for all CBOR formats we should for each data type simply say that they use the corresponding CBOR data type in RFC7049, as specified in the Table 3, just above paragraph 2.4.1
@eliasweingaertner I agree for CBOR. For LWM2M CBOR I didn't know that format so maybe(probably?) this makes sense too.
For SenML-CBOR, I think this is not a good idea because RFC8428 should be followed.
When reading the LWM2M specification about SenML-CBOR representation of TIME datatype, I see :
(from : LWM2M-v1.1.1@core§C.2-Data Type Mapping)
(from : LWM2M-v1.2@core§C.2-Data Type Mapping)
I saw some contradiction with CBOR and SenML RFC but maybe I just missed the point.
About CBOR RFC7049, the specification says about Date and Time:
So it allows Floating point number and negative one, so is there any reason to limit it to unsigned integer ?
About SenML-CBOR RFC8428, there is no value of type date/time, see
And LWM2M specification says that TIME value should be encoded using
v
which should be a number, see LWM2M-v1.2@core§SenML-JSON-format-and-descriptionThat sounds contradictory with "Represented as date/time strings, as defined in Section 2.4.1 of [RFC7049]." from C.2-Data Type Mapping of LWM2M specification.