From fa99ec021a056dfb953b29a23e8b02c13fa1267e Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 28 Sep 2019 10:17:47 -0700 Subject: Decode validity flag --- src/main/java/org/traccar/protocol/UlbotechProtocolDecoder.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/UlbotechProtocolDecoder.java b/src/main/java/org/traccar/protocol/UlbotechProtocolDecoder.java index 0a2a59e23..7fec0bf8b 100644 --- a/src/main/java/org/traccar/protocol/UlbotechProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/UlbotechProtocolDecoder.java @@ -237,12 +237,13 @@ public class UlbotechProtocolDecoder extends BaseProtocolDecoder { case DATA_GPS: hasLocation = true; - position.setValid(true); position.setLatitude(buf.readInt() / 1000000.0); position.setLongitude(buf.readInt() / 1000000.0); position.setSpeed(UnitsConverter.knotsFromKph(buf.readUnsignedShort())); position.setCourse(buf.readUnsignedShort()); - position.set(Position.KEY_HDOP, buf.readUnsignedShort()); + int hdop = buf.readUnsignedShort(); + position.setValid(hdop < 9999); + position.set(Position.KEY_HDOP, hdop * 0.01); break; case DATA_LBS: -- cgit v1.2.3