aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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(