diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-13 21:10:56 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2018-11-13 21:10:56 +1300 |
commit | bda7b8e833f86c7eba28cc5374161bb98090f64f (patch) | |
tree | e342828038ed45e382c57c2900dea6934b95034e | |
parent | 6da19dd5926bceec8d648072e48d828bdce30e8e (diff) | |
download | traccar-server-bda7b8e833f86c7eba28cc5374161bb98090f64f.tar.gz traccar-server-bda7b8e833f86c7eba28cc5374161bb98090f64f.tar.bz2 traccar-server-bda7b8e833f86c7eba28cc5374161bb98090f64f.zip |
Support VIN for Teltonika
-rw-r--r-- | src/org/traccar/protocol/TeltonikaProtocolDecoder.java | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java index d7c4bca60..f69059104 100644 --- a/src/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -426,7 +426,11 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { for (int j = 0; j < cnt; j++) { int id = buf.readUnsignedShort(); int length = buf.readUnsignedShort(); - position.set(Position.PREFIX_IO + id, ByteBufUtil.hexDump(buf.readSlice(length))); + if (id == 256) { + position.set(Position.KEY_VIN, buf.readSlice(length).toString(StandardCharsets.US_ASCII)); + } else { + position.set(Position.PREFIX_IO + id, ByteBufUtil.hexDump(buf.readSlice(length))); + } } } |