diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/org/traccar/protocol/YwtProtocolDecoder.java | 9 |
1 files 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(); |