aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-07-22 13:26:45 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-07-22 13:27:07 +1200
commitc92f37404893cce14a25379bcd84bb081e94f1b8 (patch)
tree024a7e0fcb4c90fc07929b182cae0edbe4261e93
parentff600afeb4bce4b45e4cb8c11b668637ff6dea3a (diff)
downloadtrackermap-server-c92f37404893cce14a25379bcd84bb081e94f1b8.tar.gz
trackermap-server-c92f37404893cce14a25379bcd84bb081e94f1b8.tar.bz2
trackermap-server-c92f37404893cce14a25379bcd84bb081e94f1b8.zip
Workaround for incorrect hemisphere (fix #2139)
-rw-r--r--src/org/traccar/protocol/WatchProtocolDecoder.java6
-rw-r--r--test/org/traccar/protocol/WatchProtocolDecoderTest.java4
2 files changed, 7 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/WatchProtocolDecoder.java b/src/org/traccar/protocol/WatchProtocolDecoder.java
index ca63e701e..326552e7f 100644
--- a/src/org/traccar/protocol/WatchProtocolDecoder.java
+++ b/src/org/traccar/protocol/WatchProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
+ * Copyright 2015 - 2016 Anton Tananaev (anton.tananaev@gmail.com)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -47,9 +47,9 @@ public class WatchProtocolDecoder extends BaseProtocolDecoder {
.number("(dd)(dd)(dd),") // date (ddmmyy)
.number("(dd)(dd)(dd),") // time
.expression("([AV]),") // validity
- .number(" *-?(d+.d+),") // latitude
+ .number(" *(-?d+.d+),") // latitude
.expression("([NS]),")
- .number(" *-?(d+.d+),") // longitude
+ .number(" *(-?d+.d+),") // longitude
.expression("([EW])?,")
.number("(d+.d+),") // speed
.number("(d+.?d*),") // course
diff --git a/test/org/traccar/protocol/WatchProtocolDecoderTest.java b/test/org/traccar/protocol/WatchProtocolDecoderTest.java
index 89e9a7e77..a8f7b12bc 100644
--- a/test/org/traccar/protocol/WatchProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/WatchProtocolDecoderTest.java
@@ -11,6 +11,10 @@ public class WatchProtocolDecoderTest extends ProtocolTest {
WatchProtocolDecoder decoder = new WatchProtocolDecoder(new WatchProtocol());
verifyPosition(decoder, text(
+ "[3G*6105117105*008D*UD2,210716,231601,V,-33.480366,N,-70.7630692,E,0.00,0.0,0.0,0,100,34,0,0,00000000,3,255,730,2,29731,54315,167,29731,54316,162,29731,54317,145"),
+ position("2016-07-21 23:16:01.000", false, -33.48037, -70.76307));
+
+ verifyPosition(decoder, text(
"[3G*4700222306*0077*UD,120316,140610,V,48.779045,N, 9.1574736,E,0.00,0.0,0.0,0,25,83,0,0,00000000,2,255,262,1,21041,9067,121,21041,5981,116"));
verifyPosition(decoder, text(