diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-26 09:55:28 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-09-26 09:55:28 +1200 |
commit | 6148a3c2d873f5490cc4a55bc7e326c7d293405b (patch) | |
tree | e8513bab933acfa1ea506e0457617d363990126a | |
parent | 803e4bb722560054055d989b05f86c76fabfbd2c (diff) | |
download | trackermap-server-6148a3c2d873f5490cc4a55bc7e326c7d293405b.tar.gz trackermap-server-6148a3c2d873f5490cc4a55bc7e326c7d293405b.tar.bz2 trackermap-server-6148a3c2d873f5490cc4a55bc7e326c7d293405b.zip |
Fix Aquila protocol decoder
-rw-r--r-- | src/org/traccar/protocol/AquilaProtocolDecoder.java | 5 | ||||
-rw-r--r-- | test/org/traccar/protocol/AquilaProtocolDecoderTest.java | 4 |
2 files changed, 4 insertions, 5 deletions
diff --git a/src/org/traccar/protocol/AquilaProtocolDecoder.java b/src/org/traccar/protocol/AquilaProtocolDecoder.java index 67ada82b2..8430165ff 100644 --- a/src/org/traccar/protocol/AquilaProtocolDecoder.java +++ b/src/org/traccar/protocol/AquilaProtocolDecoder.java @@ -22,7 +22,6 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; -import org.traccar.helper.PatternUtil; import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; import org.traccar.model.Position; @@ -35,7 +34,7 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { private static final Pattern pattern = Pattern.compile( "\\$\\$" + - "CLIENT_[^,]+," + // IMEI + "[^,]+," + // Client "(\\d+)," + // Device serial number "(\\d+)," + // Event "(-?\\d+\\.\\d+)," + // Latitude @@ -66,8 +65,6 @@ public class AquilaProtocolDecoder extends BaseProtocolDecoder { throws Exception { String sentence = (String) msg; - - String r = PatternUtil.checkPattern(pattern.pattern(), sentence); Matcher parser = pattern.matcher(sentence); if (!parser.matches()) { diff --git a/test/org/traccar/protocol/AquilaProtocolDecoderTest.java b/test/org/traccar/protocol/AquilaProtocolDecoderTest.java index 5ecd80dae..8a0d8bdfd 100644 --- a/test/org/traccar/protocol/AquilaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/AquilaProtocolDecoderTest.java @@ -1,7 +1,6 @@ package org.traccar.protocol; import org.junit.Test; - import static org.traccar.helper.DecoderVerifier.verify; public class AquilaProtocolDecoderTest extends ProtocolDecoderTest { @@ -10,6 +9,9 @@ public class AquilaProtocolDecoderTest extends ProtocolDecoderTest { public void testDecode() throws Exception { AquilaProtocolDecoder decoder = new AquilaProtocolDecoder(new AquilaProtocol()); + + verify(decoder.decode(null, null, + "$$SRINI_1MS,141214807,1,12.963515,77.533844,150925161628,A,27,0,8,0,68,0,0,0,0,0,0,0,0,1,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,*43")); verify(decoder.decode(null, null, "$$CLIENT_1ZF,130329214,1,12.962985,77.576484,140127165433,A,22,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,*26")); |