aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-02-12 08:42:16 +1100
committerAnton Tananaev <anton.tananaev@gmail.com>2016-02-12 08:42:16 +1100
commit538b2eca6dd2e317376e5161efa7ff0f1fbf9662 (patch)
treec524a8379896ce56d1854b225b2dd093073dfd82
parente2a40de5021419222bcfa224e3543881235be7db (diff)
downloadtrackermap-server-538b2eca6dd2e317376e5161efa7ff0f1fbf9662.tar.gz
trackermap-server-538b2eca6dd2e317376e5161efa7ff0f1fbf9662.tar.bz2
trackermap-server-538b2eca6dd2e317376e5161efa7ff0f1fbf9662.zip
Make TRV course format more flexible
-rw-r--r--src/org/traccar/protocol/TrvProtocolDecoder.java2
-rw-r--r--test/org/traccar/protocol/TrvProtocolDecoderTest.java3
2 files changed, 4 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TrvProtocolDecoder.java b/src/org/traccar/protocol/TrvProtocolDecoder.java
index c81dd08b9..94796fa5e 100644
--- a/src/org/traccar/protocol/TrvProtocolDecoder.java
+++ b/src/org/traccar/protocol/TrvProtocolDecoder.java
@@ -44,7 +44,7 @@ public class TrvProtocolDecoder extends BaseProtocolDecoder {
.expression("([EW])")
.number("(ddd.d)") // speed
.number("(dd)(dd)(dd)") // time
- .number("(ddd.dd)") // course
+ .number("([d.]{6})") // course
.number("(ddd)") // gsm
.number("(ddd)") // satellites
.number("(ddd)") // battery
diff --git a/test/org/traccar/protocol/TrvProtocolDecoderTest.java b/test/org/traccar/protocol/TrvProtocolDecoderTest.java
index b77c848a6..13ff61792 100644
--- a/test/org/traccar/protocol/TrvProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/TrvProtocolDecoderTest.java
@@ -20,6 +20,9 @@ public class TrvProtocolDecoderTest extends ProtocolTest {
"TRVCP01,100007100000001020151060011"));
verifyPosition(decoder, text(
+ "TRVAP01160211A2544.5118N05553.7586E105.711185941.52010001010010000,424,030,3011,27003"));
+
+ verifyPosition(decoder, text(
"TRVAP01160209A2540.8863N05546.6125E005.6075734123.7910000810010000,424,030,3012,27323"));
verifyPosition(decoder, text(