aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-06-25 07:22:12 -0700
committerAnton Tananaev <anton@traccar.org>2024-06-25 07:22:12 -0700
commitb13e4dafc64f4531370ffd73121f4d769d161311 (patch)
treee2af122edc477a4929d5a7c3a61011a104407270
parent4e66d2b8dfbf362493905451cd8f6ca5655dddaa (diff)
downloadtrackermap-server-b13e4dafc64f4531370ffd73121f4d769d161311.tar.gz
trackermap-server-b13e4dafc64f4531370ffd73121f4d769d161311.tar.bz2
trackermap-server-b13e4dafc64f4531370ffd73121f4d769d161311.zip
Fix GTINF decoding (fix #5355)
-rw-r--r--src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java2
-rw-r--r--src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java3
2 files changed, 5 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
index cfed351f2..3afea3b1b 100644
--- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
@@ -278,6 +278,8 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
position.set(Position.PREFIX_ADC + 2, parser.next());
if (model.equals("GV310LAU")) {
position.set(Position.PREFIX_ADC + 3, parser.next());
+ } else {
+ parser.next(); // skip for other devices
}
position.set(Position.KEY_INPUT, parser.next());
diff --git a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
index 406a447ab..04980117b 100644
--- a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class Gl200TextProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new Gl200TextProtocolDecoder(null));
+ verifyAttributes(decoder, buffer(
+ "+RESP:GTINF,423036,866884046104139,,41,89103000000064820042,22,99,0,,,3.82,0,0,1,0,0,20240622183159,57,,,,,20240623011548,005C$"));
+
verifyAttribute(decoder, buffer(
"+RESP:GTERI,8020050704,867488060246195,,00000004,28823,10,1,1,0.0,33,10.1,10.606120,43.656780,20240408084402,0222,0010,7D53,00DD120D,02,0,0.0,,,,,100,210100,0,1,FFFFF,YS2R4X20009288827,2,H1910197,58234.30,500,1,90,H1.5,P84.00,,0,4616.20,2.28,2.16,5.64,5358,1038,0010,00,00,20240408084403,1809$"),
Position.KEY_BATTERY_LEVEL, 100);