diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-13 22:26:47 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-10-13 22:26:47 +1300 |
commit | 48f57acd31fc5b0ae3b9de85e72c58c7186f5475 (patch) | |
tree | c284dd6f9bbee036051bd0f347d5e0df7daf28b2 /src/org/traccar/protocol/OpenGtsProtocolDecoder.java | |
parent | 6611056f9fdf7c97e6e9e5429b21aba65f6c3561 (diff) | |
download | trackermap-server-48f57acd31fc5b0ae3b9de85e72c58c7186f5475.tar.gz trackermap-server-48f57acd31fc5b0ae3b9de85e72c58c7186f5475.tar.bz2 trackermap-server-48f57acd31fc5b0ae3b9de85e72c58c7186f5475.zip |
Make OpenGTS course optional (fix #4101)
Diffstat (limited to 'src/org/traccar/protocol/OpenGtsProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/OpenGtsProtocolDecoder.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/org/traccar/protocol/OpenGtsProtocolDecoder.java b/src/org/traccar/protocol/OpenGtsProtocolDecoder.java index c1967917f..c854ad491 100644 --- a/src/org/traccar/protocol/OpenGtsProtocolDecoder.java +++ b/src/org/traccar/protocol/OpenGtsProtocolDecoder.java @@ -42,7 +42,7 @@ public class OpenGtsProtocolDecoder extends BaseHttpProtocolDecoder { .number("(d+)(dd.d+),") // longitude .expression("([EW]),") .number("(d+.d+),") // speed - .number("(d+.d+),") // course + .number("(d+.d+)?,") // course .number("(dd)(dd)(dd),") // date (ddmmyy) .any() .compile(); @@ -80,15 +80,15 @@ public class OpenGtsProtocolDecoder extends BaseHttpProtocolDecoder { } DateBuilder dateBuilder = new DateBuilder() - .setTime(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); + .setTime(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setValid(parser.next().equals("A")); position.setLatitude(parser.nextCoordinate()); position.setLongitude(parser.nextCoordinate()); - position.setSpeed(parser.nextDouble(0)); + position.setSpeed(parser.nextDouble()); position.setCourse(parser.nextDouble(0)); - dateBuilder.setDateReverse(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0)); + dateBuilder.setDateReverse(parser.nextInt(), parser.nextInt(), parser.nextInt()); position.setTime(dateBuilder.getDate()); break; case "alt": |