aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-12-03 14:43:50 +0800
committerAnton Tananaev <anton.tananaev@gmail.com>2017-12-03 14:43:50 +0800
commitaa4a01126f9724dece194c9543927d60934ec2a6 (patch)
tree30d6fcfb3f7edb7646e64da7edc2deced83c62a3
parent56e496c728faede7a6b26a382e87081dec569f78 (diff)
downloadtraccar-server-aa4a01126f9724dece194c9543927d60934ec2a6.tar.gz
traccar-server-aa4a01126f9724dece194c9543927d60934ec2a6.tar.bz2
traccar-server-aa4a01126f9724dece194c9543927d60934ec2a6.zip
Handle alternative eelink format (fix #3661)
-rw-r--r--src/org/traccar/protocol/EelinkProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/EelinkProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/EelinkProtocolDecoder.java b/src/org/traccar/protocol/EelinkProtocolDecoder.java
index 30e94026c..159a93d9b 100644
--- a/src/org/traccar/protocol/EelinkProtocolDecoder.java
+++ b/src/org/traccar/protocol/EelinkProtocolDecoder.java
@@ -271,9 +271,9 @@ public class EelinkProtocolDecoder extends BaseProtocolDecoder {
.number("(d+.d+)") // course
.any()
.text("Speed:")
- .number("(d+.d+)KM/H") // speed
+ .number("(d+.d+)") // speed
.any()
- .text("Date Time:")
+ .expression("Date ?Time:")
.number("(dddd)-(dd)-(dd) ") // date
.number("(dd):(dd):(dd)") // time
.compile();
diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java
index a7477c823..ca70343bd 100644
--- a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java
@@ -14,6 +14,9 @@ public class EelinkProtocolDecoderTest extends ProtocolTest {
"454C0027E753035254407167747167670100180002035254407167747100200205020500010432000086BD"));
verifyPosition(decoder, binary(
+ "676780005a000001000000004c61743a4e33312e38333935352c4c6f6e3a5738322e36313334362c436f757273653a302e30302c53706565643a302e30306b6d2f682c4461746554696d653a323031372d31322d30322031313a32393a3433"));
+
+ verifyPosition(decoder, binary(
"676780005E5788014C754C754C61743A4E32332E3131313734330A4C6F6E3A453131342E3430393233380A436F757273653A302E30300A53706565643A302E31374B4D2F480A446174652054696D653A323031352D30392D31332032303A32313A3230"));
verifyPosition(decoder, binary(