diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-24 23:41:30 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2017-10-24 23:41:30 +1300 |
commit | 96e15853b9c28bd31295ca2c014e226e4a50aaa1 (patch) | |
tree | ac7358a31d2f08c7e125eb2065795475114d4ea0 | |
parent | 496f6a612eb02396946db2715225f55cc7003a0d (diff) | |
download | trackermap-server-96e15853b9c28bd31295ca2c014e226e4a50aaa1.tar.gz trackermap-server-96e15853b9c28bd31295ca2c014e226e4a50aaa1.tar.bz2 trackermap-server-96e15853b9c28bd31295ca2c014e226e4a50aaa1.zip |
Improve TAIP validity handling
-rw-r--r-- | src/org/traccar/protocol/TaipProtocolDecoder.java | 3 | ||||
-rw-r--r-- | test/org/traccar/protocol/TaipProtocolDecoderTest.java | 6 |
2 files changed, 7 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/TaipProtocolDecoder.java b/src/org/traccar/protocol/TaipProtocolDecoder.java index c6220ab1d..e7117a5c9 100644 --- a/src/org/traccar/protocol/TaipProtocolDecoder.java +++ b/src/org/traccar/protocol/TaipProtocolDecoder.java @@ -68,7 +68,6 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { .number("(x{8})") // odometer .number("[01]") // gps power .groupEnd("?") - .number("(d)") // fix mode .any() .compile(); @@ -162,7 +161,7 @@ public class TaipProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_ODOMETER, parser.nextLong(16, 0)); } - position.setValid(parser.nextInt(0) != 0); + position.setValid(true); String[] attributes = null; beginIndex = sentence.indexOf(';'); diff --git a/test/org/traccar/protocol/TaipProtocolDecoderTest.java b/test/org/traccar/protocol/TaipProtocolDecoderTest.java index e2de26ec0..beba54d74 100644 --- a/test/org/traccar/protocol/TaipProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TaipProtocolDecoderTest.java @@ -11,6 +11,12 @@ public class TaipProtocolDecoderTest extends ProtocolTest { TaipProtocolDecoder decoder = new TaipProtocolDecoder(new TaipProtocol()); verifyPosition(decoder, text( + ">RPV46640+4197412-0752857900015802;ID=5102;*71<")); + + verifyNull(decoder, text( + ">RCP46640+419741-075285802;ID=5102;*6C<")); + + verifyPosition(decoder, text( ">REV001958003965+0307178+1016144900031532;IO=300;SV=8;BL=4159;CF=8161,C,13;AD=14145;IX=10233040;FF=0,0,0,0;VO=338578;ID=357042063052352<")); verifyPosition(decoder, text( |