diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-13 16:21:04 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-13 16:21:04 +1200 |
commit | f01ebc2af707bccfd29049afad7d081c58e7f771 (patch) | |
tree | f0ccb599554be8e29c141da64df19b65969d4abb /src/org/traccar/protocol/KhdProtocolDecoder.java | |
parent | 84d99d15e6048eb87ad4547273c5c9e6f69488b5 (diff) | |
download | trackermap-server-f01ebc2af707bccfd29049afad7d081c58e7f771.tar.gz trackermap-server-f01ebc2af707bccfd29049afad7d081c58e7f771.tar.bz2 trackermap-server-f01ebc2af707bccfd29049afad7d081c58e7f771.zip |
Implement units conversion class
Diffstat (limited to 'src/org/traccar/protocol/KhdProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/KhdProtocolDecoder.java | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/KhdProtocolDecoder.java b/src/org/traccar/protocol/KhdProtocolDecoder.java index bf1f5deea..e9d43798c 100644 --- a/src/org/traccar/protocol/KhdProtocolDecoder.java +++ b/src/org/traccar/protocol/KhdProtocolDecoder.java @@ -26,6 +26,7 @@ import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.Crc; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; import org.traccar.model.Position; @@ -95,7 +96,7 @@ public class KhdProtocolDecoder extends BaseProtocolDecoder { // Location position.setLatitude(ChannelBufferTools.readCoordinate(buf)); position.setLongitude(ChannelBufferTools.readCoordinate(buf)); - position.setSpeed(ChannelBufferTools.readHexInteger(buf, 4) * 0.539957); + position.setSpeed(UnitsConverter.knotsFromKph(ChannelBufferTools.readHexInteger(buf, 4))); position.setCourse(ChannelBufferTools.readHexInteger(buf, 4)); // Flags |