aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-01-08 19:30:23 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2017-01-08 19:30:23 +1300
commit030abec1d657065990fa6e1dc7f22fd56a316b35 (patch)
tree7623b41570b517208f47a88aef21a344be276904
parent75225f028ce835346013f835ab66c439ad80f499 (diff)
downloadtraccar-server-030abec1d657065990fa6e1dc7f22fd56a316b35.tar.gz
traccar-server-030abec1d657065990fa6e1dc7f22fd56a316b35.tar.bz2
traccar-server-030abec1d657065990fa6e1dc7f22fd56a316b35.zip
Improve regex patter to handle ET800E
-rw-r--r--src/org/traccar/protocol/ExtremTracProtocolDecoder.java6
-rw-r--r--test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java3
2 files changed, 6 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/ExtremTracProtocolDecoder.java b/src/org/traccar/protocol/ExtremTracProtocolDecoder.java
index c2f420d1c..43fae1e19 100644
--- a/src/org/traccar/protocol/ExtremTracProtocolDecoder.java
+++ b/src/org/traccar/protocol/ExtremTracProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2016 Anton Tananaev (anton@traccar.org)
+ * Copyright 2016 - 2017 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -41,8 +41,8 @@ public class ExtremTracProtocolDecoder extends BaseProtocolDecoder {
.expression("([NS]),")
.number("(d+)(dd.d+),") // longitude
.expression("([EW]),")
- .number("(d+.d+),") // speed
- .number("(d+.d+),") // course
+ .number("(d+.?d*),") // speed
+ .number("(d+.?d*),") // course
.number("(dd)(dd)(dd),") // date
.any()
.compile();
diff --git a/test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java b/test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java
index 82e461fc7..afcefb843 100644
--- a/test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/ExtremTracProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class ExtremTracProtocolDecoderTest extends ProtocolTest {
ExtremTracProtocolDecoder decoder = new ExtremTracProtocolDecoder(new ExtremTracProtocol());
verifyPosition(decoder, text(
+ "$GPRMC,862106020628733,050859.000,A,1404.8573,N,08710.9967,W,0.00,0,080117,0,,00C8,00218,99,,,,,,0.00"));
+
+ verifyPosition(decoder, text(
"$GPRMC,10000000001,092313.299,A,2238.8947,N,11355.2253,E,0.00,311.19,010307,0,,"));
verifyPosition(decoder, text(