aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-08-26 03:28:05 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-08-26 03:28:06 +1200
commit102b17df3abd6126404089384e214bda28b604fe (patch)
tree6e228237840ac6f049aad5610f5433374232228e
parentce60f22e4fde1cd0645371291b2bf7016856f78b (diff)
downloadtrackermap-server-102b17df3abd6126404089384e214bda28b604fe.tar.gz
trackermap-server-102b17df3abd6126404089384e214bda28b604fe.tar.bz2
trackermap-server-102b17df3abd6126404089384e214bda28b604fe.zip
Improve GpsGate decoder pattern
-rw-r--r--src/org/traccar/protocol/GpsGateProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/GpsGateProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/GpsGateProtocolDecoder.java b/src/org/traccar/protocol/GpsGateProtocolDecoder.java
index afc17a9f7..ac859b592 100644
--- a/src/org/traccar/protocol/GpsGateProtocolDecoder.java
+++ b/src/org/traccar/protocol/GpsGateProtocolDecoder.java
@@ -52,9 +52,9 @@ public class GpsGateProtocolDecoder extends BaseProtocolDecoder {
.number("(d+),") // imei
.expression("[^,]*,") // command
.expression("[^,]*,")
- .number("(dd)(dd.d+),") // latitude
+ .number("(d+)(dd.d+),") // latitude
.expression("([NS]),")
- .number("(ddd)(dd.d+),") // longitude
+ .number("(d+)(dd.d+),") // longitude
.expression("([EW]),")
.number("(d+.?d*),") // altitude
.number("(d+.?d*),") // speed
diff --git a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java
index 11cfb66f5..67c5ccf51 100644
--- a/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/GpsGateProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class GpsGateProtocolDecoderTest extends ProtocolTest {
GpsGateProtocolDecoder decoder = new GpsGateProtocolDecoder(new GpsGateProtocol());
verifyPosition(decoder, text(
+ "$FRCMD,0097,_SendMessage,,7618.51990,S,4002.26182,E,350.0,1.08,0.0,250816,183522.000,0*7F"));
+
+ verifyPosition(decoder, text(
"$FRCMD,356406061385182,_SendMessage,,5223.88542,N,11440.45866,W,951.2,0.027,,220716,153507.00,1*5F"));
verifyPosition(decoder, text(