diff options
Diffstat (limited to 'src/org/traccar/protocol/Xt7ProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/Xt7ProtocolDecoder.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/Xt7ProtocolDecoder.java b/src/org/traccar/protocol/Xt7ProtocolDecoder.java index cee9d18a7..42013cb9a 100644 --- a/src/org/traccar/protocol/Xt7ProtocolDecoder.java +++ b/src/org/traccar/protocol/Xt7ProtocolDecoder.java @@ -35,7 +35,7 @@ public class Xt7ProtocolDecoder extends BaseProtocolDecoder { super(serverManager); } - static private Pattern pattern = Pattern.compile( + private static final Pattern pattern = Pattern.compile( "\\$GPRMC," + "(\\d{2})(\\d{2})(\\d{2})\\.(\\d+)," + // Time (HHMMSS.SSS) "([AV])," + // Validity @@ -99,7 +99,7 @@ public class Xt7ProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.MILLISECOND, Integer.valueOf(parser.group(index++))); // Validity - position.setValid(parser.group(index++).compareTo("A") == 0 ? true : false); + position.setValid(parser.group(index++).compareTo("A") == 0); // Latitude Double latitude = Double.valueOf(parser.group(index++)); @@ -123,6 +123,9 @@ public class Xt7ProtocolDecoder extends BaseProtocolDecoder { } else { position.setCourse(0.0); } + + // Altitude + position.setAltitude(0.0); // Date time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); |