aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/UlbotechProtocolDecoder.java6
-rw-r--r--test/org/traccar/protocol/UlbotechProtocolDecoderTest.java3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/org/traccar/protocol/UlbotechProtocolDecoder.java
index 48122a8f3..9ad590ad4 100644
--- a/src/org/traccar/protocol/UlbotechProtocolDecoder.java
+++ b/src/org/traccar/protocol/UlbotechProtocolDecoder.java
@@ -97,7 +97,11 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder {
}
position.setExtendedInfo(extendedInfo.toString());
- return position;
+
+ if (position.getValid() != null) {
+ return position;
+ }
+ return null;
}
}
diff --git a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java
index e680ec6af..5e5433925 100644
--- a/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/UlbotechProtocolDecoderTest.java
@@ -14,6 +14,9 @@ public class UlbotechProtocolDecoderTest extends ProtocolDecoderTest {
public void testDecode() throws Exception {
UlbotechProtocolDecoder decoder = new UlbotechProtocolDecoder(null);
+
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "f8010103545500500179009ccb4b62010e00144db906310d3f0000000000cb0304000000000404000a8123050603211860221006080000000100000000ef97f8"))));
verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
"F80101035785203457289495D60235010E016175A506C2C838000000000064"))));