aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-03-27 21:19:54 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-03-27 21:19:54 +1300
commit2af34372442ae1ab15bb280c235b857977b6c1a3 (patch)
tree7c49c0c8962cfded5e90ba273de0b3f8ec71830d /src/org/traccar/protocol
parentbf35aec0e38a9c5b30a41a0d9dcf904320f244ca (diff)
downloadtrackermap-server-2af34372442ae1ab15bb280c235b857977b6c1a3.tar.gz
trackermap-server-2af34372442ae1ab15bb280c235b857977b6c1a3.tar.bz2
trackermap-server-2af34372442ae1ab15bb280c235b857977b6c1a3.zip
Fix EGTS speed decoding
Diffstat (limited to 'src/org/traccar/protocol')
-rw-r--r--src/org/traccar/protocol/EgtsProtocolDecoder.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/EgtsProtocolDecoder.java b/src/org/traccar/protocol/EgtsProtocolDecoder.java
index e13f18fed..420701e6c 100644
--- a/src/org/traccar/protocol/EgtsProtocolDecoder.java
+++ b/src/org/traccar/protocol/EgtsProtocolDecoder.java
@@ -22,6 +22,7 @@ import org.traccar.BaseProtocolDecoder;
import org.traccar.DeviceSession;
import org.traccar.helper.BitUtil;
import org.traccar.helper.Checksum;
+import org.traccar.helper.UnitsConverter;
import org.traccar.model.Position;
import java.net.SocketAddress;
@@ -203,7 +204,7 @@ public class EgtsProtocolDecoder extends BaseProtocolDecoder {
}
int speed = buf.readUnsignedShort();
- position.setSpeed(BitUtil.to(speed, 14));
+ position.setSpeed(UnitsConverter.knotsFromKph(BitUtil.to(speed, 14) * 0.1));
position.setCourse(buf.readUnsignedByte() + (BitUtil.check(speed, 15) ? 0x100 : 0));
position.set(Position.KEY_ODOMETER, buf.readUnsignedMedium() * 100);