From 2757798d95d3d9b9e81dcbf1dbeb5e3c009e0473 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 19 Mar 2016 14:43:50 +1300 Subject: Workaround for GL200 send time issue --- src/org/traccar/protocol/Gl200ProtocolDecoder.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src') diff --git a/src/org/traccar/protocol/Gl200ProtocolDecoder.java b/src/org/traccar/protocol/Gl200ProtocolDecoder.java index 7d0c58c57..1d77fb6cb 100644 --- a/src/org/traccar/protocol/Gl200ProtocolDecoder.java +++ b/src/org/traccar/protocol/Gl200ProtocolDecoder.java @@ -211,6 +211,9 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .number("(dd)(dd)(dd)") // time .text(",") .any() + .number("(dddd)(dd)(dd)") // date + .number("(dd)(dd)(dd)").optional(2) // time + .text(",") .number("(xxxx)") // count number .text("$").optional() .compile(); @@ -488,6 +491,15 @@ public class Gl200ProtocolDecoder extends BaseProtocolDecoder { .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); + if (parser.hasNext(6)) { + dateBuilder = new DateBuilder() + .setDate(parser.nextInt(), parser.nextInt(), parser.nextInt()) + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); + if (!position.getOutdated() && position.getFixTime().after(dateBuilder.getDate())) { + position.setTime(dateBuilder.getDate()); + } + } + return position; } -- cgit v1.2.3