eclipse-leshan / leshan

Java Library for LWM2M
https://www.eclipse.org/leshan/
BSD 3-Clause "New" or "Revised" License
653 stars 408 forks source link

Read Composite support for timestamped data. #1637

Closed JaroslawLegierski closed 2 months ago

JaroslawLegierski commented 3 months ago

Question

Would it be possible for Leshan to support timestamps in Read Composite operation? Currently the presence of timestamp in the response causes an exception:

"Unable to decode node [node] : value should not be timestamped"

We would like to support to be able to have 1 timestamp like for Simple (not composite) Read and Observe e.g.

[
    { "n":"3/0/1","v":11234, "bt":1706888656 },
    { "bn":"/6/0/","n":"0","v":-21.0 }, 
    { "n":"1","v":141.0 }, 
    { "n":"5","v":1706888656 }
]

I preparred following: PoC supporting described above feature. However, I don't know if my idea of impelementing this is correct.

sbernard31 commented 3 months ago

I looked at this quickly, I think this is the idea. When you think your code is ready for review, create a PR and let me know.

JaroslawLegierski commented 3 months ago

I looked at this quickly, I think this is the idea. When you think your code is ready for review, create a PR and let me know.

PR (#1639) created.

sbernard31 commented 2 months ago

1639 is now integrated in master so I close this issue.

(will be available in 2.0.0-M17)