From f01ebc2af707bccfd29049afad7d081c58e7f771 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 13 May 2015 16:21:04 +1200 Subject: Implement units conversion class --- src/org/traccar/protocol/UlbotechProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol/UlbotechProtocolDecoder.java') diff --git a/src/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/org/traccar/protocol/UlbotechProtocolDecoder.java index af61b0b6e..3ec50b3fc 100644 --- a/src/org/traccar/protocol/UlbotechProtocolDecoder.java +++ b/src/org/traccar/protocol/UlbotechProtocolDecoder.java @@ -20,6 +20,7 @@ import org.jboss.netty.channel.Channel; import org.jboss.netty.channel.ChannelHandlerContext; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.ChannelBufferTools; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; import org.traccar.model.Position; @@ -84,7 +85,7 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder { position.setValid(true); position.setLatitude(buf.readInt() / 1000000.0); position.setLongitude(buf.readInt() / 1000000.0); - position.setSpeed(buf.readUnsignedShort() * 0.539957); + position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort())); position.setCourse(buf.readUnsignedShort()); position.set(Event.KEY_HDOP, buf.readUnsignedShort()); break; -- cgit v1.2.3