aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-21 10:43:56 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-21 10:43:56 +1300
commitf4e866ac1de424a8d962172645fccab22b111781 (patch)
tree78f47a1d258a1847edb89abe84c45df9af58e793 /src/org/traccar/protocol
parent67db57ba4114c7eb43ecadbd3cbf5ab9afb55833 (diff)
downloadtraccar-server-f4e866ac1de424a8d962172645fccab22b111781.tar.gz
traccar-server-f4e866ac1de424a8d962172645fccab22b111781.tar.bz2
traccar-server-f4e866ac1de424a8d962172645fccab22b111781.zip
Convert speed units in Noran decoder
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/NoranProtocolDecoder.java5
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());