From 143a51790b613831e455d49299098d97aff34bfa Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 10 Mar 2022 19:42:51 -0800 Subject: Decode ORBCOMM event time --- src/main/java/org/traccar/protocol/OrbcommProtocolDecoder.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/OrbcommProtocolDecoder.java b/src/main/java/org/traccar/protocol/OrbcommProtocolDecoder.java index e7ea87428..7277b1e5f 100644 --- a/src/main/java/org/traccar/protocol/OrbcommProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/OrbcommProtocolDecoder.java @@ -33,6 +33,7 @@ import java.net.SocketAddress; import java.nio.charset.StandardCharsets; import java.text.DateFormat; import java.text.SimpleDateFormat; +import java.util.Date; import java.util.LinkedList; import java.util.TimeZone; @@ -85,6 +86,9 @@ public class OrbcommProtocolDecoder extends BaseProtocolDecoder { JsonObject field = fields.getJsonObject(j); String value = field.getString("Value"); switch (field.getString("Name").toLowerCase()) { + case "eventtime": + position.setDeviceTime(new Date(Long.parseLong(value) * 1000)); + break; case "latitude": position.setLatitude(Integer.parseInt(value) / 60000.0); break; -- cgit v1.2.3