aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2024-04-09 18:29:35 -0700
committerAnton Tananaev <anton@traccar.org>2024-04-09 18:29:35 -0700
commit53f1be38dc55032e73e1aae659bb94dda6414d31 (patch)
treec8ec2afbba7616bb0f457a9df31d2f3dc6d7608f /src
parentb017ab22e2f612aa19d0bd62581b6e889a142dfa (diff)
downloadtrackermap-server-53f1be38dc55032e73e1aae659bb94dda6414d31.tar.gz
trackermap-server-53f1be38dc55032e73e1aae659bb94dda6414d31.tar.bz2
trackermap-server-53f1be38dc55032e73e1aae659bb94dda6414d31.zip
Fix GV355CEU battery decoding
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java3
-rw-r--r--src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
index 775e98401..8edce9346 100644
--- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java
@@ -974,6 +974,9 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder {
if (model.startsWith("GV") && !model.startsWith("GV6")) {
position.set(Position.PREFIX_ADC + 2, v[index++].isEmpty() ? null : Integer.parseInt(v[index - 1]) * 0.001);
}
+ if (model.startsWith("GV355CEU")) {
+ index += 1; // reserved
+ }
position.set(Position.KEY_BATTERY_LEVEL, v[index++].isEmpty() ? null : Integer.parseInt(v[index - 1]));
if (model.startsWith("GL5")) {
diff --git a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
index 4cccf8fa2..925a0da1c 100644
--- a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
@@ -12,6 +12,10 @@ public class Gl200TextProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new Gl200TextProtocolDecoder(null));
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);
+
+ verifyAttribute(decoder, buffer(
"+RESP:GTVGN,C2010D,869653060009939,GV600M,453966,0,0.0,0,163.9,10.239379,45.931389,20231210233723,0222,0010,2F31,006D7621,,,0.0,20240107182623,143F$"),
Position.KEY_IGNITION, true);