Skip to content

Commit

Permalink
Timestamps in seconds instead of milliseconds in ManualDataSender.
Browse files Browse the repository at this point in the history
  • Loading branch information
JaroslawLegierski committed Sep 2, 2022
1 parent b14a740 commit 5eb946b
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

import java.util.List;
import java.util.Map;
import java.util.concurrent.TimeUnit;

import org.eclipse.leshan.client.servers.ServerIdentity;
import org.eclipse.leshan.core.node.LwM2mNode;
Expand Down Expand Up @@ -44,7 +45,7 @@ public ManualDataSender(String name) {
}

public synchronized void collectData(List<LwM2mPath> paths) {
long currentTimestamp = System.currentTimeMillis();
long currentTimestamp = TimeUnit.MILLISECONDS.toSeconds(System.currentTimeMillis());
Map<LwM2mPath, LwM2mNode> currentValues = dataSenderManager.getCurrentValues(ServerIdentity.SYSTEM, paths);
synchronized (this) {
builder.addNodes(currentTimestamp, currentValues);
Expand Down

0 comments on commit 5eb946b

Please sign in to comment.