diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-06-18 22:28:13 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-06-18 22:28:13 +1200 |
commit | 2f3c5cac45601f54fa0dd46a23cbd593b5779cc1 (patch) | |
tree | e4775c720bb03e8be5e26e8dd5766e9ccac0b2cb /src/org/traccar/protocol | |
parent | 62379352b9f8f76ea4d72124af89d64c2e809a1c (diff) | |
download | trackermap-server-2f3c5cac45601f54fa0dd46a23cbd593b5779cc1.tar.gz trackermap-server-2f3c5cac45601f54fa0dd46a23cbd593b5779cc1.tar.bz2 trackermap-server-2f3c5cac45601f54fa0dd46a23cbd593b5779cc1.zip |
Fix V680 decoder (fix #311)
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r-- | src/org/traccar/protocol/V680ProtocolDecoder.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/V680ProtocolDecoder.java b/src/org/traccar/protocol/V680ProtocolDecoder.java index e3388576e..53843c23d 100644 --- a/src/org/traccar/protocol/V680ProtocolDecoder.java +++ b/src/org/traccar/protocol/V680ProtocolDecoder.java @@ -49,7 +49,7 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { "(\\d{2})(\\d{2}\\.\\d+)," + // Latitude (DDMM.MMMM) "([NS])," + "(\\d+\\.\\d+)," + // Speed - "(\\d+\\.?\\d*)#" + // Course + "(\\d+\\.?\\d*)?#" + // Course "(\\d{2})(\\d{2})(\\d{2})#" + // Date (DDMMYY) "(\\d{2})(\\d{2})(\\d{2})" + // Time (HHMMSS) ".*"); @@ -129,7 +129,12 @@ public class V680ProtocolDecoder extends BaseProtocolDecoder { // Speed and Course position.setSpeed(Double.valueOf(parser.group(index++))); - position.setCourse(Double.valueOf(parser.group(index++))); + String course = parser.group(index++); + if (course != null) { + position.setCourse(Double.valueOf(course)); + } else { + position.setCourse(0.0); + } // Date Calendar time = Calendar.getInstance(TimeZone.getTimeZone("UTC")); |