Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SenML-CBOR Time reprentation description error ? #537

Open
sbernard31 opened this issue Dec 21, 2021 · 0 comments
Open

SenML-CBOR Time reprentation description error ? #537

sbernard31 opened this issue Dec 21, 2021 · 0 comments
Assignees

Comments

@sbernard31
Copy link

sbernard31 commented Dec 21, 2021

When reading the LWM2M specification about SenML-CBOR representation of TIME datatype, I see :

Data Type Text Format TLV Format JSON SenML Format CBOR SenML Format
Time Represented as an ASCII integer. For example, 1476186613 seconds since Jan 01 1970, which represents Tuesday, 11-Oct-16 11:50:13 UTC, are represented as the ASCII string "1476186613", which has 10 characters/bytes. Same representation as Integer. Represented as a number. 👉 Represented as date/time strings, as defined in Section 2.4.1 of [RFC7049].

(from : LWM2M-v1.1.1@core§C.2-Data Type Mapping)

Data Type Text Format TLV Format SenML JSON Format CBOR, LwM2M CBOR, and SenML CBOR Formats
Time Represented as an ASCII integer. For example, 1476186613 seconds since Jan 01 1970, which represents Tuesday, 11-Oct-16 11:50:13 UTC, are represented as the ASCII string "1476186613", which has 10 characters/bytes. Same representation as Integer. Represented as a number. 👉 Represented as an unsigned integer or a date/time string, as defined in Section 2.4.1 of [RFC7049].

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

Tag value 1 is for numerical representation of seconds relative to
1970-01-01T00:00Z in UTC time. (For the non-negative values that the
Portable Operating System Interface (POSIX) defines, the number of
seconds is counted in the same way as for POSIX "seconds since the
epoch" [TIME_T].) The tagged item can be a positive or negative
integer
(major types 0 and 1), or a floating-point number (major type
7 with additional information 25, 26, or 27). Note that the number
can be negative (time before 1970-01-01T00:00Z) and, if a floating-
point number, indicate fractional seconds.

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-description

That 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants