From f4e866ac1de424a8d962172645fccab22b111781 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 21 Jan 2016 10:43:56 +1300 Subject: Convert speed units in Noran decoder --- src/org/traccar/protocol/NoranProtocolDecoder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/org/traccar/protocol') diff --git a/src/org/traccar/protocol/NoranProtocolDecoder.java b/src/org/traccar/protocol/NoranProtocolDecoder.java index 04c4d8112..2140317e7 100644 --- a/src/org/traccar/protocol/NoranProtocolDecoder.java +++ b/src/org/traccar/protocol/NoranProtocolDecoder.java @@ -26,6 +26,7 @@ import org.jboss.netty.channel.Channel; import org.traccar.BaseProtocolDecoder; import org.traccar.helper.BitUtil; import org.traccar.helper.DateBuilder; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Event; import org.traccar.model.Position; @@ -90,10 +91,10 @@ public class NoranProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_ALARM, buf.readUnsignedByte()); if (newFormat) { - position.setSpeed(buf.readUnsignedInt()); + position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedInt())); position.setCourse(buf.readFloat()); } else { - position.setSpeed(buf.readUnsignedByte()); + position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedByte())); position.setCourse(buf.readUnsignedShort()); } position.setLongitude(buf.readFloat()); -- cgit v1.2.3