aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-06-30 23:38:36 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2021-06-30 23:38:36 -0700
commit9a070e77b5c459781a9cdf1e143b2034a19e86b7 (patch)
tree791d8f3870e7e340fcdf12042fb85e98affe45b3 /src
parent94d95ebeb1168ff235aa49a24c0ba0ed62b1125b (diff)
downloadtrackermap-server-9a070e77b5c459781a9cdf1e143b2034a19e86b7.tar.gz
trackermap-server-9a070e77b5c459781a9cdf1e143b2034a19e86b7.tar.bz2
trackermap-server-9a070e77b5c459781a9cdf1e143b2034a19e86b7.zip
Fix Space10X decoding exception
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java6
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java3
2 files changed, 8 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 3f3a96109..281234ebb 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -685,7 +685,11 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
- if (type == MSG_LBS_MULTIPLE_1 || type == MSG_LBS_MULTIPLE_2 || type == MSG_LBS_EXTEND
+ if (type == MSG_LBS_STATUS && dataLength >= 18) {
+
+ return null; // space10x multi-lbs message
+
+ } else if (type == MSG_LBS_MULTIPLE_1 || type == MSG_LBS_MULTIPLE_2 || type == MSG_LBS_EXTEND
|| type == MSG_LBS_WIFI || type == MSG_LBS_2 || type == MSG_WIFI_3) {
boolean longFormat = type == MSG_LBS_2 || type == MSG_WIFI_3;
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index f3e5779e8..fd1eb3040 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -17,6 +17,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"78780D01086471700328358100093F040D0A"));
+ verifyNull(decoder, binary(
+ "7878171915061810051a01f90101700d08c8f50c0000065494ae0d0a"));
+
verifyNotNull(decoder, binary(
"78783B2E10010D02020201CC00287D001F713E287D001F7231287D001E232D287D001F4018000000000000000000000000000000000000FF00020005B14B0D0A"));