aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/BceProtocolDecoder.java5
-rw-r--r--test/org/traccar/protocol/BceProtocolDecoderTest.java3
2 files changed, 8 insertions, 0 deletions
diff --git a/src/org/traccar/protocol/BceProtocolDecoder.java b/src/org/traccar/protocol/BceProtocolDecoder.java
index 22877a29b..ed810bebb 100644
--- a/src/org/traccar/protocol/BceProtocolDecoder.java
+++ b/src/org/traccar/protocol/BceProtocolDecoder.java
@@ -65,6 +65,11 @@ public class BceProtocolDecoder extends BaseProtocolDecoder {
int dataEnd = buf.readUnsignedShortLE() + buf.readerIndex();
int type = buf.readUnsignedByte();
+
+ if (type != MSG_ASYNC_STACK && type != MSG_TIME_TRIGGERED) {
+ return null;
+ }
+
int confirmKey = buf.readUnsignedByte() & 0x7F;
while (buf.readerIndex() < dataEnd) {
diff --git a/test/org/traccar/protocol/BceProtocolDecoderTest.java b/test/org/traccar/protocol/BceProtocolDecoderTest.java
index 28340baf2..400ba7e12 100644
--- a/test/org/traccar/protocol/BceProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/BceProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class BceProtocolDecoderTest extends ProtocolTest {
BceProtocolDecoder decoder = new BceProtocolDecoder(null);
+ verifyNull(decoder, binary(
+ "3ab90b71bc1503000300c10bff11"));
+
verifyPositions(decoder, binary(
"789622d1cb1303003401a53365b70f4a9babc0ffd700c04400f0b6c741e63933428f1c431c015468de43f18221341b007e0ae20001430a698f003f008d000000000031f85900000000f0831c018400000000000000000000000000000000000209000000000000000000000000000000030065f70f4a9babc0ffd700c0440069bcc741e73733427f1c431a01a9378343f1829c391b00a80be2000170056da7003e007c000000000031c04e00000000f0831c01810000000000000000000000000000000000060100000000000000000000000000000003006537104a9babc0ffd700c0440051c1c74129363342721c421801e4809543f18210341b00710ae2000170056da7003e0072000000000031c04800000000b8841c017e00000000000000000000000000000000000306000000000000000000000000000000030069"));