diff options
author | Anton Tananaev <anton@traccar.org> | 2023-05-03 13:59:35 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-05-03 13:59:35 -0700 |
commit | e73f36db83b9dc00a5dfe0a9625f40bd2698c3fa (patch) | |
tree | 1114db48161c7f98c10d2f1b22e90576925f59de /src | |
parent | bb6964f03867d039a547c103cd16390f78688022 (diff) | |
download | trackermap-server-e73f36db83b9dc00a5dfe0a9625f40bd2698c3fa.tar.gz trackermap-server-e73f36db83b9dc00a5dfe0a9625f40bd2698c3fa.tar.bz2 trackermap-server-e73f36db83b9dc00a5dfe0a9625f40bd2698c3fa.zip |
Decode Escort fuel sensor
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java | 2 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java index c7713bdc2..0135e78b7 100644 --- a/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gl200TextProtocolDecoder.java @@ -978,7 +978,7 @@ public class Gl200TextProtocolDecoder extends BaseProtocolDecoder { index += 1; // device type if (BitUtil.check(mask, 0)) { - index += 1; // digital fuel sensor data + position.set(Position.KEY_FUEL_LEVEL, Integer.parseInt(data[index++], 16)); } if (BitUtil.check(mask, 1)) { diff --git a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java index 515c14921..4b0edfd81 100644 --- a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java @@ -11,6 +11,10 @@ public class Gl200TextProtocolDecoderTest extends ProtocolTest { var decoder = inject(new Gl200TextProtocolDecoder(null)); + verifyAttribute(decoder, buffer( + "+BUFF:GTERI,410502,864802030794634,,00000001,,10,1,1,0.0,0,3027.8,-78.706612,-0.955699,20230418170736,0740,0002,A08C,2AB72D,00,0.0,,,,100,110000,1,0099,20230418171004,8B98$"), + Position.KEY_FUEL_LEVEL, 153); + verifyPositions(decoder, false, buffer( "+BUFF:GTFRI,2E0503,861106050005423,,,0,1,,,,,,,,,,,,0,0,,98,1,0,,,20200101000001,0083$")); |