From bda7b8e833f86c7eba28cc5374161bb98090f64f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Tue, 13 Nov 2018 21:10:56 +1300 Subject: Support VIN for Teltonika --- src/org/traccar/protocol/TeltonikaProtocolDecoder.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/org/traccar/protocol/TeltonikaProtocolDecoder.java') 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))); + } } } -- cgit v1.2.3