diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-03-19 14:43:50 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-03-19 14:43:50 +1300 |
commit | 2757798d95d3d9b9e81dcbf1dbeb5e3c009e0473 (patch) | |
tree | d22eb1631902ab91e9d672cf54f69fa86767cb90 /src/org/traccar | |
parent | 4ba1c3d923b3687df93030125c5efd34d1de002d (diff) | |
download | traccar-server-2757798d95d3d9b9e81dcbf1dbeb5e3c009e0473.tar.gz traccar-server-2757798d95d3d9b9e81dcbf1dbeb5e3c009e0473.tar.bz2 traccar-server-2757798d95d3d9b9e81dcbf1dbeb5e3c009e0473.zip |
Workaround for GL200 send time issue
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/Gl200ProtocolDecoder.java | 12 |
1 files changed, 12 insertions, 0 deletions
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; } |