Skip to content

Commit

Permalink
Support VIN for Teltonika
Browse files Browse the repository at this point in the history
  • Loading branch information
tananaev committed Nov 13, 2018
1 parent 6da19dd commit bda7b8e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/org/traccar/protocol/TeltonikaProtocolDecoder.java
Expand Up @@ -426,7 +426,11 @@ private void decodeLocation(Position position, ByteBuf buf, int codec) {
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)));
}
}
}

Expand Down

0 comments on commit bda7b8e

Please sign in to comment.