diff options
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/H02ProtocolDecoder.java | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/H02ProtocolDecoder.java b/src/org/traccar/protocol/H02ProtocolDecoder.java index c93d0c6dd..30193a648 100644 --- a/src/org/traccar/protocol/H02ProtocolDecoder.java +++ b/src/org/traccar/protocol/H02ProtocolDecoder.java @@ -112,7 +112,7 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { "V\\d," + // Version? ".*" + "(\\d{2})(\\d{2})(\\d{2})," + // Time (HHMMSS) - "([AV])," + // Validity + "([AV])?," + // Validity "-?(\\d+)-?(\\d{2}.\\d+)," + // Latitude (DDMM.MMMM) "([NS])," + "-?(\\d+)-?(\\d{2}.\\d+)," + // Longitude (DDMM.MMMM) @@ -151,7 +151,10 @@ public class H02ProtocolDecoder extends BaseProtocolDecoder { time.set(Calendar.SECOND, Integer.valueOf(parser.group(index++))); // Validity - position.setValid(parser.group(index++).compareTo("A") == 0); + String valid = parser.group(index++); + if (valid != null) { + position.setValid(valid.compareTo("A") == 0); + } // Latitude Double latitude = Double.valueOf(parser.group(index++)); |