aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-04-06 07:38:08 -0700
committerAnton Tananaev <anton@traccar.org>2023-04-06 07:38:08 -0700
commit4ece72558c80038728fa67ec51238bac48fc4d64 (patch)
treeb8b448ef58c52e7ded4937a49dfb23033adc2464 /src/main/java/org/traccar/protocol
parent44d188ece3edfb2e3ff10094465d5a1d1ab03f6a (diff)
downloadtrackermap-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/protocol')
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java8
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)));