aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-11-27 10:31:12 -0800
committerAnton Tananaev <anton@traccar.org>2022-11-27 10:31:12 -0800
commit146de22b51139edcc3132f403e86006ac1fc3419 (patch)
tree1d66c5a6b28507bc807049a81264d1907dbf0b64 /src
parent19d10da19db57b2119c295cb452a271c3de48f85 (diff)
downloadtrackermap-server-146de22b51139edcc3132f403e86006ac1fc3419.tar.gz
trackermap-server-146de22b51139edcc3132f403e86006ac1fc3419.tar.bz2
trackermap-server-146de22b51139edcc3132f403e86006ac1fc3419.zip
Support GL600 GPS lock
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java4
-rw-r--r--src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java3
2 files changed, 5 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
index 9fa550ded..9ed44f565 100644
--- a/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Jt600ProtocolDecoder.java
@@ -1,5 +1,5 @@
/*
- * Copyright 2012 - 2021 Anton Tananaev (anton@traccar.org)
+ * Copyright 2012 - 2022 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.
@@ -143,7 +143,7 @@ public class Jt600ProtocolDecoder extends BaseProtocolDecoder {
boolean responseRequired = false;
- while (buf.readableBytes() > 1) {
+ while (buf.readableBytes() >= 17) {
Position position = new Position(getProtocolName());
position.setDeviceId(deviceSession.getDeviceId());
diff --git a/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java
index 98c587a81..fc52e32e3 100644
--- a/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Jt600ProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class Jt600ProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new Jt600ProtocolDecoder(null));
+ verifyPositions(decoder, binary(
+ "2480433966040111002718031919195822424550114158888E15A40000F124080000000000F00F110A24991900000DF0C7"));
+
verifyPosition(decoder, buffer(
"(8000632862,P45,290322,132412,25.28217,S,57.54683,W,A,0,0,5,0,0000000000,0,0,9,0)"));