From e9202415e19353f3513f42426e32783e05939048 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 27 Oct 2020 22:53:54 -0700 Subject: Fix speed decoding --- src/main/java/org/traccar/protocol/NetProtocolDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main') diff --git a/src/main/java/org/traccar/protocol/NetProtocolDecoder.java b/src/main/java/org/traccar/protocol/NetProtocolDecoder.java index 2117a2cc6..61cb29b6b 100644 --- a/src/main/java/org/traccar/protocol/NetProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/NetProtocolDecoder.java @@ -43,7 +43,7 @@ public class NetProtocolDecoder extends BaseProtocolDecoder { .number("(x)") // flags .number("(dd)(dd)(dddd)") // latitude .number("(ddd)(dd)(dddd)") // longitude - .number("(xx)") // status + .number("(x{8})") // status .number("(x{4})") // speed .number("(x{6})") // odometer .number("(xxx)") // course @@ -79,7 +79,7 @@ public class NetProtocolDecoder extends BaseProtocolDecoder { position.setLatitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN) * hemisphereLatitude); position.setLongitude(parser.nextCoordinate(Parser.CoordinateFormat.DEG_MIN_MIN) * hemisphereLongitude); - position.set(Position.KEY_STATUS, parser.nextHexInt()); + position.set(Position.KEY_STATUS, parser.nextHexLong()); position.setSpeed(parser.nextHexInt() * 0.01); position.set(Position.KEY_ODOMETER, parser.nextHexInt()); position.setCourse(parser.nextHexInt()); -- cgit v1.2.3