aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/protocol/YwtProtocolDecoder.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-07-26 05:24:42 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2018-07-26 05:24:42 +1200
commite4ec06498f63ca31d8fd7332523bd997f3fe44a0 (patch)
tree103b8ab6e06c60825a600120ec59ce7882e963e6 /src/org/traccar/protocol/YwtProtocolDecoder.java
parentc51a5b70169860c9032420381dd327c6b4b380ba (diff)
downloadtrackermap-server-e4ec06498f63ca31d8fd7332523bd997f3fe44a0.tar.gz
trackermap-server-e4ec06498f63ca31d8fd7332523bd997f3fe44a0.tar.bz2
trackermap-server-e4ec06498f63ca31d8fd7332523bd997f3fe44a0.zip
Fix YWT speed decoding
Diffstat (limited to 'src/org/traccar/protocol/YwtProtocolDecoder.java')
-rw-r--r--src/org/traccar/protocol/YwtProtocolDecoder.java9
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();