diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2021-05-04 20:29:11 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2021-05-04 20:29:11 -0700 |
commit | 9ee31327f5eb7f5384345064b501eedecbb7f3b0 (patch) | |
tree | 61ed243868b6bd11cefec76afa172420aecf9ffb | |
parent | 7a4f3f22239cc9b3405387a29819654265e9b345 (diff) | |
download | trackermap-server-9ee31327f5eb7f5384345064b501eedecbb7f3b0.tar.gz trackermap-server-9ee31327f5eb7f5384345064b501eedecbb7f3b0.tar.bz2 trackermap-server-9ee31327f5eb7f5384345064b501eedecbb7f3b0.zip |
Fix speed decoding
-rw-r--r-- | src/main/java/org/traccar/protocol/Gs100ProtocolDecoder.java | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |