diff options
author | Anton Tananaev <anton@traccar.org> | 2022-03-10 19:42:51 -0800 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2022-03-10 19:42:51 -0800 |
commit | 143a51790b613831e455d49299098d97aff34bfa (patch) | |
tree | 5c4ccaf6d98739bf62b8ceb4210b2ebaa3c7f31f /src/main/java/org | |
parent | 35c2316a12113b29f00fa5ad735e59a88494c8bb (diff) | |
download | trackermap-server-143a51790b613831e455d49299098d97aff34bfa.tar.gz trackermap-server-143a51790b613831e455d49299098d97aff34bfa.tar.bz2 trackermap-server-143a51790b613831e455d49299098d97aff34bfa.zip |
Decode ORBCOMM event time
Diffstat (limited to 'src/main/java/org')
-rw-r--r-- | src/main/java/org/traccar/protocol/OrbcommProtocolDecoder.java | 4 |
1 files changed, 4 insertions, 0 deletions
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; |