From 85067159044c06bded8e64c8d832591c5e567ff2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 12 May 2014 22:32:36 +1200 Subject: Fix STL060 decoder --- src/org/traccar/protocol/Stl060ProtocolDecoder.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/org') diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java index b5a67dbab..211483aed 100644 --- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java +++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java @@ -40,8 +40,8 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder { "[^,]*," + // Vehicle "(\\d{2})/(\\d{2})/(\\d{2})," + // Date "(\\d{2}):(\\d{2}):(\\d{2})," + // Time - "(\\d{2})(\\d+)([NS])," + // Latitude - "(\\d{3})(\\d+)([EW])," + // Longitude + "(\\d{2})(\\d{2})\\.?(\\d+)([NS])," + // Latitude + "(\\d{3})(\\d{2})\\.?(\\d+)([EW])," + // Longitude "(\\d+\\.?\\d*)," + // Speed "(\\d+\\.?\\d*)," + // Course "(\\d+)," + // Milage @@ -95,13 +95,13 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder { // Latitude Double latitude = Double.valueOf(parser.group(index++)); - latitude += Double.valueOf(parser.group(index++)) / 600000; + latitude += Double.valueOf(parser.group(index++) + parser.group(index++)) / 600000; if (parser.group(index++).compareTo("S") == 0) latitude = -latitude; position.setLatitude(latitude); // Longitude Double longitude = Double.valueOf(parser.group(index++)); - longitude += Double.valueOf(parser.group(index++)) / 600000; + longitude += Double.valueOf(parser.group(index++) + parser.group(index++)) / 600000; if (parser.group(index++).compareTo("W") == 0) longitude = -longitude; position.setLongitude(longitude); -- cgit v1.2.3