aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2023-12-02 14:23:39 -0800
committerAnton Tananaev <anton@traccar.org>2023-12-02 14:23:39 -0800
commitf93d28f8677e646eea0ac319e9aa3dcc47194bac (patch)
treeaa558a1339549c30bf3ca155d12def228cf11767 /src
parent8f1c0e94ebe29c08ff94a98e2ea53c22732768ad (diff)
downloadtrackermap-server-f93d28f8677e646eea0ac319e9aa3dcc47194bac.tar.gz
trackermap-server-f93d28f8677e646eea0ac319e9aa3dcc47194bac.tar.bz2
trackermap-server-f93d28f8677e646eea0ac319e9aa3dcc47194bac.zip
Add FMX6XX driver id
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(