aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-01-17 19:35:26 -0800
committerAnton Tananaev <anton@traccar.org>2023-01-17 19:35:26 -0800
commit9ff9bd75fff98cc46395bfa870ba0c1f7ab34d87 (patch)
tree84118bdbf1334a5327efb5427dbd8dd0fe3e9260 /src
parent85501f9cf4918d5eee345f83aed7a31eecb26b8d (diff)
downloadtrackermap-server-9ff9bd75fff98cc46395bfa870ba0c1f7ab34d87.tar.gz
trackermap-server-9ff9bd75fff98cc46395bfa870ba0c1f7ab34d87.tar.bz2
trackermap-server-9ff9bd75fff98cc46395bfa870ba0c1f7ab34d87.zip
Other JM-LL301 messages
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java5
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java12
2 files changed, 15 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
index ef09677bf..5b639ddfc 100644
--- a/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gt06ProtocolDecoder.java
@@ -99,7 +99,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
public static final int MSG_LBS_2 = 0xA1; // GK310
public static final int MSG_WIFI_3 = 0xA2; // GK310
public static final int MSG_FENCE_SINGLE = 0xA3; // GK310
- public static final int MSG_FENCE_MULTI = 0xA4; // GK310
+ public static final int MSG_FENCE_MULTI = 0xA4; // GK310 & JM-LL301
public static final int MSG_LBS_ALARM = 0xA5; // GK310 & JM-LL301
public static final int MSG_LBS_ADDRESS = 0xA7; // GK310
public static final int MSG_OBD = 0x8C; // FM08ABC
@@ -209,6 +209,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
case MSG_GPS_LBS_STATUS_2:
case MSG_GPS_LBS_STATUS_3:
case MSG_GPS_LBS_STATUS_4:
+ case MSG_FENCE_MULTI:
case MSG_LBS_ALARM:
return true;
default:
@@ -804,7 +805,7 @@ public class Gt06ProtocolDecoder extends BaseProtocolDecoder {
}
if (hasLbs(type) && buf.readableBytes() > 6) {
- decodeLbs(position, buf, type, hasStatus(type) && type != MSG_LBS_ALARM);
+ decodeLbs(position, buf, type, hasStatus(type) && type != MSG_LBS_ALARM && type != MSG_LBS_STATUS);
}
if (hasStatus(type)) {
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 23c29b0d3..697908a4c 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -17,6 +17,18 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"78780D01086471700328358100093F040D0A"));
+ verifyAttribute(decoder, binary(
+ "78781219012ed042cc00954d00040419000056fe290d0a"),
+ Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
+
+ verifyAttribute(decoder, binary(
+ "78782DA4150817073B10CF032EEA9C0B6CE0800015141001CC0100009A00000000000A6F24014605041900FF01908A640D0A"),
+ Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
+
+ verifyAttribute(decoder, binary(
+ "78782627100419092D07C5027AC91C0C4658000005370900000000000000008002001900FF00004DF60D0A"),
+ Position.KEY_ALARM, Position.ALARM_LOW_BATTERY);
+
verifyPosition(decoder, binary(
"78781511170103100e1f9904efe30400a97f88003410ffdd000d0a"));