aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-07-09 10:26:44 -0700
committerAnton Tananaev <anton@traccar.org>2022-07-09 10:26:44 -0700
commiteec839e7f47843629b4c730c765bb7605f50532e (patch)
treebc1065245d52364e48953d811b79d1cf047f3e8b
parent54d7f988b449fabbbd10fb123d63502d2427b43b (diff)
downloadtrackermap-server-eec839e7f47843629b4c730c765bb7605f50532e.tar.gz
trackermap-server-eec839e7f47843629b4c730c765bb7605f50532e.tar.bz2
trackermap-server-eec839e7f47843629b4c730c765bb7605f50532e.zip
Support SR411 mini variant
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java15
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java3
2 files changed, 18 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index 63210b2fa..b65e4a4b8 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -112,6 +112,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
private enum Variant {
VXT01,
WANWAY_S20,
+ SR411_MINI,
GT06E_CARD,
BENWAY,
S5,
@@ -646,6 +647,18 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
return position;
+ } else if (type == MSG_LBS_MULTIPLE_3 && variant == Variant.SR411_MINI) {
+
+ decodeGps(position, buf, false, deviceSession.get(DeviceSession.KEY_TIMEZONE));
+
+ decodeLbs(position, buf, type, false);
+
+ position.set(Position.KEY_IGNITION, buf.readUnsignedByte() > 0);
+ position.set(Position.KEY_POWER, buf.readUnsignedShort() * 0.01);
+ position.set(Position.KEY_BATTERY, buf.readUnsignedShort() * 0.01);
+
+ return position;
+
} else if (type == MSG_LBS_MULTIPLE_1 || type == MSG_LBS_MULTIPLE_2 || type == MSG_LBS_MULTIPLE_3
|| type == MSG_LBS_EXTEND || type == MSG_LBS_WIFI || type == MSG_LBS_2
|| type == MSG_WIFI_3 || type == MSG_WIFI_5) {
@@ -1323,6 +1336,8 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
variant = Variant.VXT01;
} else if (header == 0x7878 && type == MSG_LBS_MULTIPLE_3 && length == 0x31) {
variant = Variant.WANWAY_S20;
+ } else if (header == 0x7878 && type == MSG_LBS_MULTIPLE_3 && length == 0x2e) {
+ variant = Variant.SR411_MINI;
} else if (header == 0x7878 && type == MSG_GPS_LBS_1 && length >= 0x71) {
variant = Variant.GT06E_CARD;
} else if (header == 0x7878 && type == MSG_GPS_LBS_1 && length == 0x21) {
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 8c54fe3e4..f3f47a104 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"));
+ verifyPosition(decoder, binary(
+ "78782e2416061a103600c80275298404a0a24000184602d4023a49006f060104ed01940000086508004139765000be7d640d0a"));
+
verifyAttribute(decoder, binary(
"79790019941b524649443a3030384642324245424133390d0a000c14930d0a"),
"serial", "RFID:008FB2BEBA39");