aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-02-22 07:17:51 -0800
committerAnton Tananaev <anton@traccar.org>2024-02-22 07:17:51 -0800
commit2ab6df0a53e299f5cd6ef880c70054547d07fe42 (patch)
tree8f1e88400e483b04a6e8b11c240b7fbae6b58e67
parent8cf3fcd643faebd9cb0937bc1e8454a22ad8b137 (diff)
downloadtrackermap-server-2ab6df0a53e299f5cd6ef880c70054547d07fe42.tar.gz
trackermap-server-2ab6df0a53e299f5cd6ef880c70054547d07fe42.tar.bz2
trackermap-server-2ab6df0a53e299f5cd6ef880c70054547d07fe42.zip
Fix SL44/SL48 alarms decoding
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java13
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java4
2 files changed, 13 insertions, 4 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 7ee47dd86..6c0380278 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2022 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2024 Anton Tananaev (anton@traccar.org)
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -344,7 +344,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
int mcc = buf.readUnsignedShort();
int mnc;
- if (BitUtil.check(mcc, 15) || type == MSG_GPS_LBS_6) {
+ if (BitUtil.check(mcc, 15) || type == MSG_GPS_LBS_6 || variant == Variant.SL4X) {
mnc = buf.readUnsignedShort();
} else {
mnc = buf.readUnsignedByte();
@@ -441,15 +441,18 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return Position.ALARM_REMOVING;
case 0x23:
return Position.ALARM_FALL_DOWN;
+ case 0x28:
+ return Position.ALARM_BRAKING;
case 0x29:
return Position.ALARM_ACCELERATION;
- case 0x30:
- return Position.ALARM_BRAKING;
case 0x2A:
case 0x2B:
+ case 0x2E:
return Position.ALARM_CORNERING;
case 0x2C:
return Position.ALARM_ACCIDENT;
+ case 0x30:
+ return Position.ALARM_JAMMING;
default:
return null;
}
@@ -1477,6 +1480,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
variant = Variant.JC400;
} else if (header == 0x7878 && type == MSG_LBS_3 && length == 0x37) {
variant = Variant.SL4X;
+ } else if (header == 0x7878 && type == MSG_GPS_LBS_STATUS_4 && length == 0x27) {
+ variant = Variant.SL4X;
} else if (header == 0x7878 && type == MSG_GPS_LBS_2 && length == 0x2f) {
variant = Variant.SEEWORLD;
} else if (header == 0x7878 && type == MSG_GPS_LBS_STATUS_1 && length == 0x26) {
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index be8f4f5ef..04d7fafb3 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -18,6 +18,10 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
"78780D01086471700328358100093F040D0A"));
verifyAttribute(decoder, binary(
+ "78782732180214123324ca0162bdf0041f45d900190b0a02d4000bc5270000ec025206040202005e07e10d0a"),
+ Position.KEY_ALARM, Position.ALARM_POWER_CUT);
+
+ verifyAttribute(decoder, binary(
"78782616170A080C0E24C0027C58AD0C2B8B0100454E0901CC0025030328E7A0005D4B13021EC373170D0A"),
Position.KEY_BATTERY_LEVEL, 93);