From 5ac7a4595d6b9f56cf2f43c2a623ee5ffeee2228 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 16 Feb 2015 10:16:00 +1300 Subject: Improve GoSafe decoder (fix #1079) --- src/org/traccar/protocol/GoSafeProtocolDecoder.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/org/traccar/protocol/GoSafeProtocolDecoder.java b/src/org/traccar/protocol/GoSafeProtocolDecoder.java index 7d43fd4e7..65f058bb6 100644 --- a/src/org/traccar/protocol/GoSafeProtocolDecoder.java +++ b/src/org/traccar/protocol/GoSafeProtocolDecoder.java @@ -47,6 +47,10 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { "\\d+;" + "([NS])(\\d+\\.\\d+);" + // Latitude "([EW])(\\d+\\.\\d+);" + // Longitude + "(\\d+);" + // Speed + "(\\d+);" + // Course + "(\\d+);" + // Altitude + "(\\d+\\.\\d+)" + // HDOP ".*"); @Override @@ -104,9 +108,10 @@ public class GoSafeProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(longitude); // Other - position.setSpeed(0.0); - position.setCourse(0.0); - position.setAltitude(0.0); + position.setSpeed(Double.valueOf(parser.group(index++))); + position.setCourse(Double.valueOf(parser.group(index++))); + position.setAltitude(Double.valueOf(parser.group(index++))); + extendedInfo.set("hdop", parser.group(index++)); // Extended info position.setExtendedInfo(extendedInfo.toString()); -- cgit v1.2.3