diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2011-02-22 11:03:54 +0000 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2011-02-22 11:03:54 +0000 |
commit | 52c26cb593201a74443329221722cc33c142b476 (patch) | |
tree | c5ecf20cbc265a9147bf7bfcc856913565149dd6 /src | |
parent | cdd6d038c5adca06db989a3b6fe8bd3fd36fe9ed (diff) | |
download | trackermap-server-52c26cb593201a74443329221722cc33c142b476.tar.gz trackermap-server-52c26cb593201a74443329221722cc33c142b476.tar.bz2 trackermap-server-52c26cb593201a74443329221722cc33c142b476.zip |
Diffstat (limited to 'src')
-rw-r--r-- | src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java b/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java index 39161f45b..15cb99f55 100644 --- a/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java +++ b/src/net/sourceforge/opentracking/protocol/xexun/XexunProtocolDecoder.java @@ -58,7 +58,7 @@ public class XexunProtocolDecoder extends OneToOneDecoder { "([\\d]{3})([\\d]{2}.[\\d]{4})," + // Longitude (DDDMM.MMMM) "([EW])," + "([\\d]+.[\\d]{2})," + // Speed - "([\\d]+.[\\d]{2})," + // Course + "([\\d]+.[\\d]{2})?," + // Course "([\\d]{2})([\\d]{2})([\\d]{2})," + // Date (DDMMYY) ".*imei:" + "([\\d]+),"); // IMEI @@ -105,9 +105,14 @@ public class XexunProtocolDecoder extends OneToOneDecoder { if (parser.group(index++).compareTo("W") == 0) lonlitude = -lonlitude; position.setLongitude(lonlitude); - // Speed and course + // Speed position.setSpeed(Double.valueOf(parser.group(index++))); - position.setCourse(Double.valueOf(parser.group(index++))); + + // Course + String course = parser.group(index++); + if (course != null) { + position.setCourse(Double.valueOf(course)); + } // Date time.set(Calendar.DAY_OF_MONTH, Integer.valueOf(parser.group(index++))); |