diff options
author | Anton Tananaev <anton@traccar.org> | 2023-04-06 07:38:08 -0700 |
---|---|---|
committer | Anton Tananaev <anton@traccar.org> | 2023-04-06 07:38:08 -0700 |
commit | 4ece72558c80038728fa67ec51238bac48fc4d64 (patch) | |
tree | b8b448ef58c52e7ded4937a49dfb23033adc2464 /src/main/java/org/traccar | |
parent | 44d188ece3edfb2e3ff10094465d5a1d1ab03f6a (diff) | |
download | trackermap-server-4ece72558c80038728fa67ec51238bac48fc4d64.tar.gz trackermap-server-4ece72558c80038728fa67ec51238bac48fc4d64.tar.bz2 trackermap-server-4ece72558c80038728fa67ec51238bac48fc4d64.zip |
Support GS-404 driver id
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r-- | src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java index ead657893..4968ed05e 100644 --- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java +++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java @@ -610,8 +610,12 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder { int length = buf.readInt() - 4; getLastLocation(position, new Date(buf.readUnsignedInt() * 1000)); if (isPrintable(buf, length)) { - position.set(Position.KEY_RESULT, - buf.readCharSequence(length, StandardCharsets.US_ASCII).toString().trim()); + String data = buf.readCharSequence(length, StandardCharsets.US_ASCII).toString().trim(); + if (data.startsWith("GTSL")) { + position.set(Position.KEY_DRIVER_UNIQUE_ID, data.split("\\|")[4]); + } else { + position.set(Position.KEY_RESULT, data); + } } else { position.set(Position.KEY_RESULT, ByteBufUtil.hexDump(buf.readSlice(length))); |