From e4b3214b83606cb6a0aff71d9b2951910c14f4ed Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Thu, 7 Jul 2016 15:18:24 +0500 Subject: Increment time in archive points --- src/org/traccar/protocol/GranitProtocolDecoder.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/org/traccar/protocol/GranitProtocolDecoder.java b/src/org/traccar/protocol/GranitProtocolDecoder.java index 3e2553927..9e618efa9 100644 --- a/src/org/traccar/protocol/GranitProtocolDecoder.java +++ b/src/org/traccar/protocol/GranitProtocolDecoder.java @@ -192,12 +192,13 @@ public class GranitProtocolDecoder extends BaseProtocolDecoder { while (nblocks > 0) { nblocks--; long unixTime = buf.readUnsignedInt(); + int timeIncrement = buf.getUnsignedShort(buf.readerIndex() + 120); for (int i = 0; i < 6; i++) { if (buf.getUnsignedByte(buf.readerIndex()) != 0xFE) { Position position = new Position(); position.setProtocol(getProtocolName()); position.setDeviceId(getDeviceId()); - position.setTime(new Date(unixTime * 1000)); + position.setTime(new Date((unixTime + i * timeIncrement) * 1000)); decodeStructure(buf, position); positions.add(position); } else { -- cgit v1.2.3