From eedf41bb641a8429d3bfe624d9dcbbd543eec494 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 25 May 2019 17:01:43 -0700 Subject: Correctly decode speed units --- src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java b/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java index 86da3943e..7405fb6ef 100644 --- a/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/FlespiProtocolDecoder.java @@ -21,6 +21,7 @@ import io.netty.handler.codec.http.HttpResponseStatus; import org.traccar.BaseHttpProtocolDecoder; import org.traccar.DeviceSession; import org.traccar.Protocol; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; import javax.json.Json; @@ -102,7 +103,7 @@ public class FlespiProtocolDecoder extends BaseHttpProtocolDecoder { position.setLongitude(((JsonNumber) value).doubleValue()); return true; case "position.speed": - position.setSpeed(((JsonNumber) value).doubleValue()); + position.setSpeed(UnitsConverter.knotsFromKph(((JsonNumber) value).doubleValue())); return true; case "position.direction": position.setCourse(((JsonNumber) value).doubleValue()); -- cgit v1.2.3