diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-07 23:01:44 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-07-07 23:01:44 +1200 |
commit | 4007613e2d420cb8b74eb49740683e940d17578c (patch) | |
tree | 9c3dc7c57bfbb9d8774d65a64af6b9218e465529 /src/org | |
parent | f51fc87269a3fe83de3399ec5031ad9a2d0a88bd (diff) | |
parent | e4b3214b83606cb6a0aff71d9b2951910c14f4ed (diff) | |
download | traccar-server-4007613e2d420cb8b74eb49740683e940d17578c.tar.gz traccar-server-4007613e2d420cb8b74eb49740683e940d17578c.tar.bz2 traccar-server-4007613e2d420cb8b74eb49740683e940d17578c.zip |
Merge pull request #2086 from Abyss777/master
Increment time for archive in Granit protocol
Diffstat (limited to 'src/org')
-rw-r--r-- | src/org/traccar/protocol/GranitProtocolDecoder.java | 3 |
1 files changed, 2 insertions, 1 deletions
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 { |