diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-21 10:43:56 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-01-21 10:43:56 +1300 |
commit | f4e866ac1de424a8d962172645fccab22b111781 (patch) | |
tree | 78f47a1d258a1847edb89abe84c45df9af58e793 /src/org | |
parent | 67db57ba4114c7eb43ecadbd3cbf5ab9afb55833 (diff) | |
download | traccar-server-f4e866ac1de424a8d962172645fccab22b111781.tar.gz traccar-server-f4e866ac1de424a8d962172645fccab22b111781.tar.bz2 traccar-server-f4e866ac1de424a8d962172645fccab22b111781.zip |
Convert speed units in Noran decoder
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/NoranProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
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()); |