diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-12-07 12:53:30 -0800 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-12-07 12:53:30 -0800 |
commit | 3e402ffca4649a390d237c6aba8678022b23370a (patch) | |
tree | 19d4789a9932268d86cced60d6adfd0a3de920e2 /src/main/java/org/traccar/protocol | |
parent | 2361de692cb75944a661f8a57e7b8d9e281ef138 (diff) | |
download | trackermap-server-3e402ffca4649a390d237c6aba8678022b23370a.tar.gz trackermap-server-3e402ffca4649a390d237c6aba8678022b23370a.tar.bz2 trackermap-server-3e402ffca4649a390d237c6aba8678022b23370a.zip |
Fix IMEI and year decoding
Diffstat (limited to 'src/main/java/org/traccar/protocol')
-rw-r--r-- | src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java b/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java index 199348c54..5959a1de7 100644 --- a/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java @@ -73,7 +73,7 @@ public class PacificTrackProtocolDecoder extends BaseProtocolDecoder { position.setValid(BitUtil.check(buf.readUnsignedByte(), 4)); int date = buf.readUnsignedByte(); DateBuilder dateBuilder = new DateBuilder() - .setDate(2000 + BitUtil.from(date, 4), BitUtil.to(date, 4), buf.readUnsignedByte()) + .setDate(2010 + BitUtil.from(date, 4), BitUtil.to(date, 4), buf.readUnsignedByte()) .setTime(buf.readUnsignedByte(), buf.readUnsignedByte(), buf.readUnsignedByte()); position.setTime(dateBuilder.getDate()); position.setLatitude(buf.readUnsignedInt() / 1000000.0 - 90.0); @@ -84,7 +84,7 @@ public class PacificTrackProtocolDecoder extends BaseProtocolDecoder { position.set(Position.KEY_INDEX, buf.readUnsignedShort()); break; case 0x100: - String imei = ByteBufUtil.hexDump(buf.readSlice(8)).substring(1); + String imei = ByteBufUtil.hexDump(buf.readSlice(8)).substring(0, 15); deviceSession = getDeviceSession(channel, remoteAddress, imei); break; default: |