diff options
author | Vitaly Litvak <vitavaque@gmail.com> | 2015-10-29 00:44:36 +0300 |
---|---|---|
committer | Vitaly Litvak <vitavaque@gmail.com> | 2015-10-29 00:44:36 +0300 |
commit | 4293e68b893098a34317e8c6adfd4027130a3796 (patch) | |
tree | 20ad6f7fd35c77b7360d32d03b6b710008b0eaf5 /src/org/traccar | |
parent | 2401fd1ea14803be84f4478de690f553dae3afb9 (diff) | |
download | trackermap-server-4293e68b893098a34317e8c6adfd4027130a3796.tar.gz trackermap-server-4293e68b893098a34317e8c6adfd4027130a3796.tar.bz2 trackermap-server-4293e68b893098a34317e8c6adfd4027130a3796.zip |
Updated pattern per pull request comments
Diffstat (limited to 'src/org/traccar')
-rw-r--r-- | src/org/traccar/protocol/GlobalSatProtocolDecoder.java | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java index 918f17348..3bc626838 100644 --- a/src/org/traccar/protocol/GlobalSatProtocolDecoder.java +++ b/src/org/traccar/protocol/GlobalSatProtocolDecoder.java @@ -180,7 +180,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { .text("$") .number("(d+),") // imei .number("d+,") // mode - .number("(d+),") // fix + .number("(d+),") // fix .number("(dd)(dd)(dd),") // date (ddmmyy) .number("(dd)(dd)(dd),") // time (hhmmss) .expression("([EW])") @@ -189,8 +189,8 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { .number("(dd)(dd.d+),") // latitude (ddmm.mmmm) .number("(d+.?d*),") // altitude .number("(d+.?d*),") // speed - .number("(d*.?d*),") // course - .number("(d+)[,\\\\*]") // satellites + .number("(d+.?d*)?,") // course + .number("(d+)[,\\*]") // satellites .number("(d+.?d*)") // hdop .compile(); @@ -220,8 +220,7 @@ public class GlobalSatProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG_MIN)); position.setAltitude(parser.nextDouble()); position.setSpeed(parser.nextDouble()); - String course = parser.next(); - position.setCourse(course.isEmpty() ? 0d : Double.parseDouble(course)); + position.setCourse(parser.nextDouble()); position.set(Event.KEY_SATELLITES, parser.nextInt()); position.set(Event.KEY_HDOP, parser.next()); |