From 2af34372442ae1ab15bb280c235b857977b6c1a3 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Mar 2018 21:19:54 +1300 Subject: Fix EGTS speed decoding --- src/org/traccar/protocol/EgtsProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/org/traccar/protocol/EgtsProtocolDecoder.java b/src/org/traccar/protocol/EgtsProtocolDecoder.java index e13f18fed..420701e6c 100644 --- a/src/org/traccar/protocol/EgtsProtocolDecoder.java +++ b/src/org/traccar/protocol/EgtsProtocolDecoder.java @@ -22,6 +22,7 @@ import org.traccar.BaseProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.helper.BitUtil; import org.traccar.helper.Checksum; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; import java.net.SocketAddress; @@ -203,7 +204,7 @@ public class EgtsProtocolDecoder extends BaseProtocolDecoder { } int speed = buf.readUnsignedShort(); - position.setSpeed(BitUtil.to(speed, 14)); + position.setSpeed(UnitsConverter.knotsFromKph(BitUtil.to(speed, 14) * 0.1)); position.setCourse(buf.readUnsignedByte() + (BitUtil.check(speed, 15) ? 0x100 : 0)); position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium() * 100); -- cgit v1.2.3