aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-09-30 11:54:25 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-09-30 11:54:25 +1300
commitc3d71d9b2d49ef70a5a02c7b26bdc0cae9fde77b (patch)
treef9ed373a53f8fc1c6171b31afbff76aa1788cad4
parent933f990cefb03d141508abd60681f5615e3db9e2 (diff)
downloadtrackermap-server-c3d71d9b2d49ef70a5a02c7b26bdc0cae9fde77b.tar.gz
trackermap-server-c3d71d9b2d49ef70a5a02c7b26bdc0cae9fde77b.tar.bz2
trackermap-server-c3d71d9b2d49ef70a5a02c7b26bdc0cae9fde77b.zip
Fix FlexTrack logon decoding
-rw-r--r--src/org/traccar/protocol/FlextrackProtocolDecoder.java4
-rw-r--r--test/org/traccar/protocol/FlextrackProtocolDecoderTest.java3
2 files changed, 4 insertions, 3 deletions
diff --git a/src/org/traccar/protocol/FlextrackProtocolDecoder.java b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
index e55324db4..0622cbc3a 100644
--- a/src/org/traccar/protocol/FlextrackProtocolDecoder.java
+++ b/src/org/traccar/protocol/FlextrackProtocolDecoder.java
@@ -77,12 +77,10 @@ public class FlextrackProtocolDecoder extends BaseProtocolDecoder {
String sentence = (String) msg;
- String x = PatternUtil.checkPattern(pattern.pattern(), sentence);
-
if (sentence.contains("LOGON")) {
Matcher parser = patternLogon.matcher(sentence);
- if (parser.matches()) {
+ if (!parser.matches()) {
return null;
}
diff --git a/test/org/traccar/protocol/FlextrackProtocolDecoderTest.java b/test/org/traccar/protocol/FlextrackProtocolDecoderTest.java
index 126e8799d..435dacf9a 100644
--- a/test/org/traccar/protocol/FlextrackProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/FlextrackProtocolDecoderTest.java
@@ -15,6 +15,9 @@ public class FlextrackProtocolDecoderTest extends ProtocolDecoderTest {
assertNull(decoder.decode(null, null,
"-1,LOGON,7000000123,8945000000"));
+ assertNull(decoder.decode(null, null,
+ "-1,LOGON,1080424008,8945020110126633198"));
+
verify(decoder.decode(null, null,
"-2,UNITSTAT,20050205,181923,7000004634,N55.46.0812,E009.21.1665,122,198,6,3934,-81,01A8,23802,213,55,37FD,45,0055,12878"));