Skip to content

Commit

Permalink
Allow LwM2mNodeSenMLEncoder to encode null-timestamped value.
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernard31 committed Jun 7, 2024
1 parent f0825b5 commit b230e82
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ public byte[] encodeTimestampedData(List<TimestampedLwM2mNode> timestampedNodes,
SenMLPack pack = new SenMLPack();
for (TimestampedLwM2mNode timestampedLwM2mNode : timestampedNodes) {

if (timestampedLwM2mNode.getTimestamp().getEpochSecond() < 268_435_456) {
if (timestampedLwM2mNode.isTimestamped()
&& timestampedLwM2mNode.getTimestamp().getEpochSecond() < 268_435_456) {
// The smallest absolute Time value that can be expressed (2**28) is 1978-07-04 21:24:16 UTC.
// see https://tools.ietf.org/html/rfc8428#section-4.5.3
throw new CodecException(
Expand Down

0 comments on commit b230e82

Please sign in to comment.