From e4ec06498f63ca31d8fd7332523bd997f3fe44a0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 26 Jul 2018 05:24:42 +1200 Subject: Fix YWT speed decoding --- src/org/traccar/protocol/YwtProtocolDecoder.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/org/traccar/protocol/YwtProtocolDecoder.java b/src/org/traccar/protocol/YwtProtocolDecoder.java index 4c71b0aea..4e86f14c9 100644 --- a/src/org/traccar/protocol/YwtProtocolDecoder.java +++ b/src/org/traccar/protocol/YwtProtocolDecoder.java @@ -21,6 +21,7 @@ import org.traccar.DeviceSession; import org.traccar.NetworkMessage; import org.traccar.helper.Parser; import org.traccar.helper.PatternBuilder; +import org.traccar.helper.UnitsConverter; import org.traccar.model.Position; import java.net.SocketAddress; @@ -92,11 +93,11 @@ public class YwtProtocolDecoder extends BaseProtocolDecoder { position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG)); position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.HEM_DEG)); position.setAltitude(parser.nextDouble(0)); - position.setSpeed(parser.nextDouble(0)); - position.setCourse(parser.nextDouble(0)); + position.setSpeed(UnitsConverter.knotsFromKph(parser.nextDouble())); + position.setCourse(parser.nextDouble()); - int satellites = parser.nextInt(0); - position.setValid(satellites >= 3); + int satellites = parser.nextInt(); + position.setValid(satellites != 0); position.set(Position.KEY_SATELLITES, satellites); String reportId = parser.next(); -- cgit v1.2.3