aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-06-09 23:22:52 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-06-09 23:22:52 +1200
commitee4c07115d3bc3e58b92310f54bee7bd616ec669 (patch)
treeb5a96052b9d32eb19924047eac434058a5812ad3
parent1a91db44d43fe0aac0dbd56818f0b779900fa70a (diff)
downloadtraccar-server-ee4c07115d3bc3e58b92310f54bee7bd616ec669.tar.gz
traccar-server-ee4c07115d3bc3e58b92310f54bee7bd616ec669.tar.bz2
traccar-server-ee4c07115d3bc3e58b92310f54bee7bd616ec669.zip
Fix new STL060 regex pattern
-rw-r--r--src/org/traccar/protocol/Stl060ProtocolDecoder.java7
-rw-r--r--test/org/traccar/protocol/Stl060ProtocolDecoderTest.java7
2 files changed, 7 insertions, 7 deletions
diff --git a/src/org/traccar/protocol/Stl060ProtocolDecoder.java b/src/org/traccar/protocol/Stl060ProtocolDecoder.java
index f23b7be73..30dc4ab5c 100644
--- a/src/org/traccar/protocol/Stl060ProtocolDecoder.java
+++ b/src/org/traccar/protocol/Stl060ProtocolDecoder.java
@@ -19,10 +19,8 @@ import java.util.Calendar;
import java.util.TimeZone;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
-
import org.jboss.netty.channel.Channel;
import org.jboss.netty.channel.ChannelHandlerContext;
-
import org.traccar.BaseProtocolDecoder;
import org.traccar.model.Event;
import org.traccar.model.Position;
@@ -33,6 +31,9 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder {
super(protocol);
}
+ //$1,357804047969310,D001,AP29AW0963,01/01/13,13:24:47,1723.9582N,07834.0945E
+ //,00100,010,0,0,0,0,
+ //0,0008478660,1450,40,34,0,0,0,A
private static final Pattern pattern = Pattern.compile(
".*\\$1," +
"(\\d+)," + // IMEI
@@ -55,7 +56,7 @@ public class Stl060ProtocolDecoder extends BaseProtocolDecoder {
"([01])," + // Ignition
"0,0," + // Reserved
"(\\d+)," + // DI
- "([^,])," + // RFID
+ "([^,]+)," + // RFID
"(\\d+)," + // Odometer
"(\\d+)," + // Temperature
"(\\d+)," + // Fuel
diff --git a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java
index 7766e104e..4b3ec36fb 100644
--- a/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Stl060ProtocolDecoderTest.java
@@ -1,8 +1,7 @@
package org.traccar.protocol;
-import org.traccar.helper.TestDataManager;
-import static org.traccar.helper.DecoderVerifier.verify;
import org.junit.Test;
+import static org.traccar.helper.DecoderVerifier.verify;
public class Stl060ProtocolDecoderTest extends ProtocolDecoderTest {
@@ -20,8 +19,8 @@ public class Stl060ProtocolDecoderTest extends ProtocolDecoderTest {
verify(decoder.decode(null, null,
"$1,357804047969310,D001,AP29AW0963,01/01/13,13:24:47,1723.9582N,07834.0945E,00100,010,0,0,0,0,0,A,"));
- //verify(decoder.decode(null, null,
- // "$1,357804047969310,D001,AP29AW0963,01/01/13,13:24:47,1723.9582N,07834.0945E,00100,010,0,0,0,0,0,0008478660,1450,40,34,0,0,0,A"));
+ verify(decoder.decode(null, null,
+ "$1,357804047969310,D001,AP29AW0963,01/01/13,13:24:47,1723.9582N,07834.0945E,00100,010,0,0,0,0,0,0008478660,1450,40,34,0,0,0,A"));
}