aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2018-11-13 21:10:56 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2018-11-13 21:10:56 +1300
commitbda7b8e833f86c7eba28cc5374161bb98090f64f (patch)
treee342828038ed45e382c57c2900dea6934b95034e /src
parent6da19dd5926bceec8d648072e48d828bdce30e8e (diff)
downloadtrackermap-server-bda7b8e833f86c7eba28cc5374161bb98090f64f.tar.gz
trackermap-server-bda7b8e833f86c7eba28cc5374161bb98090f64f.tar.bz2
trackermap-server-bda7b8e833f86c7eba28cc5374161bb98090f64f.zip
Support VIN for Teltonika
Diffstat (limited to 'src')
-rw-r--r--src/org/traccar/protocol/TeltonikaProtocolDecoder.java6
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)));
+ }
}
}