diff options
Diffstat (limited to 'src/org/traccar/protocol/MeitrackProtocolDecoder.java')
-rw-r--r-- | src/org/traccar/protocol/MeitrackProtocolDecoder.java | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/org/traccar/protocol/MeitrackProtocolDecoder.java b/src/org/traccar/protocol/MeitrackProtocolDecoder.java index 8bfd21145..3d6eb2a78 100644 --- a/src/org/traccar/protocol/MeitrackProtocolDecoder.java +++ b/src/org/traccar/protocol/MeitrackProtocolDecoder.java @@ -30,6 +30,7 @@ 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; @@ -122,7 +123,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_GSM, parser.group(index++)); // Speed - position.setSpeed(Double.valueOf(parser.group(index++)) * 0.539957); + position.setSpeed(UnitsConverter.knotsFromKph(Double.valueOf(parser.group(index++)))); // Course position.setCourse(Double.valueOf(parser.group(index++))); @@ -215,7 +216,7 @@ public class MeitrackProtocolDecoder extends BaseProtocolDecoder { position.set(Event.KEY_GSM, buf.readUnsignedByte()); // Speed - position.setSpeed(buf.readUnsignedShort() * 0.539957); + position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort())); // Course position.setCourse(buf.readUnsignedShort()); |