aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
index 45afbd0f7..537990265 100644
--- a/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/TeltonikaProtocolDecoder.java
@@ -34,6 +34,7 @@ import org.traccar.model.Network;
import org.traccar.model.Position;
import java.net.SocketAddress;
+import java.nio.ByteBuffer;
import java.nio.charset.StandardCharsets;
import java.util.Date;
import java.util.HashMap;
@@ -628,6 +629,14 @@ public class TeltonikaProtocolDecoder extends BaseProtocolDecoder {
decodeNetwork(position, model);
+ if (model != null && model.matches("FM.6..")) {
+ Long driverMsb = (Long) position.getAttributes().get("io195");
+ Long driverLsb = (Long) position.getAttributes().get("io196");
+ if (driverMsb != null && driverLsb != null) {
+ String driver = new String(ByteBuffer.allocate(16).putLong(driverMsb).putLong(driverLsb).array());
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, driver);
+ }
+ }
}
private List<Position> parseData(