aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/protocol/XexunProtocolDecoder.java11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/XexunProtocolDecoder.java b/src/org/traccar/protocol/XexunProtocolDecoder.java
index 4d44c2326..303864c3f 100644
--- a/src/org/traccar/protocol/XexunProtocolDecoder.java
+++ b/src/org/traccar/protocol/XexunProtocolDecoder.java
@@ -109,7 +109,16 @@ public class XexunProtocolDecoder extends BaseProtocolDecoder {
position.setValid(parser.next().equals("A"));
position.setLatitude(parser.nextCoordinate());
position.setLongitude(parser.nextCoordinate());
- position.setSpeed(parser.nextDouble(0));
+
+ switch (Context.getConfig().getString(getProtocolName() + ".speed", "kn")) {
+ case "kmh":
+ position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble(0)));
+ break;
+ default:
+ position.setSpeed(parser.nextDouble(0));
+ break;
+ }
+
position.setCourse(parser.nextDouble(0));
dateBuilder.setDateReverse(parser.nextInt(0), parser.nextInt(0), parser.nextInt(0));