From 3ecbff1ae54759fdf212030d7721b7c66b0ea41b Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 14 Aug 2019 08:35:00 -0700 Subject: Fix batch decoding --- src/main/java/org/traccar/protocol/NavisetProtocolDecoder.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/org/traccar') diff --git a/src/main/java/org/traccar/protocol/NavisetProtocolDecoder.java b/src/main/java/org/traccar/protocol/NavisetProtocolDecoder.java index d67fae78c..10d71d76c 100644 --- a/src/main/java/org/traccar/protocol/NavisetProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/NavisetProtocolDecoder.java @@ -72,15 +72,15 @@ public class NavisetProtocolDecoder extends BaseProtocolDecoder { return null; } + int blockMask = buf.readUnsignedByte(); + while (buf.readableBytes() > 2) { Position position = new Position(getProtocolName()); position.setDeviceId(deviceSession.getDeviceId()); - int blockMask = buf.readUnsignedByte(); position.set(Position.KEY_INDEX, buf.readUnsignedShortLE()); position.set(Position.KEY_STATUS, buf.readUnsignedByte()); - position.setValid(true); position.setTime(new Date(buf.readUnsignedIntLE() * 1000)); position.setLatitude(buf.readUnsignedIntLE() * 0.000001); -- cgit v1.2.3