From 9ee31327f5eb7f5384345064b501eedecbb7f3b0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 4 May 2021 20:29:11 -0700 Subject: Fix speed decoding --- src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java b/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java index 69232dd55..2496aad48 100644 --- a/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java @@ -26,6 +26,7 @@ import org.traccar.Protocol; import org.traccar.helper.BcdUtil; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; import java.net.SocketAddress; @@ -107,7 +108,7 @@ public class Gs100ProtocolDecoder extends BaseProtocolDecoder { } String other = ByteBufUtil.hexDump(buf.readSlice(4)); - position.setSpeed(Integer.parseInt(other.substring(0, 5)) * 0.01); + position.setSpeed(UnitsConverter.knotsFromKph(Integer.parseInt(other.substring(0, 5)) * 0.01)); position.setCourse(Integer.parseInt(other.substring(5, 8))); } else { -- cgit v1.2.3