aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-12-07 12:53:30 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2019-12-07 12:53:30 -0800
commit3e402ffca4649a390d237c6aba8678022b23370a (patch)
tree19d4789a9932268d86cced60d6adfd0a3de920e2 /src/main
parent2361de692cb75944a661f8a57e7b8d9e281ef138 (diff)
downloadtrackermap-server-3e402ffca4649a390d237c6aba8678022b23370a.tar.gz
trackermap-server-3e402ffca4649a390d237c6aba8678022b23370a.tar.bz2
trackermap-server-3e402ffca4649a390d237c6aba8678022b23370a.zip
Fix IMEI and year decoding
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/org/traccar/protocol/PacificTrackProtocolDecoder.java4
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: