aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-04-02 21:39:42 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-04-02 21:39:42 -0700
commitab4f951c53e4e6ee15637d78943d538d0c68be51 (patch)
tree46d6d7b71f715b09d3e1790ab92ff1c58e78d686 /src/main/java/org/traccar
parent5aa36f9454caf68eb5f37022ef40980cc982d661 (diff)
downloadtraccar-server-ab4f951c53e4e6ee15637d78943d538d0c68be51.tar.gz
traccar-server-ab4f951c53e4e6ee15637d78943d538d0c68be51.tar.bz2
traccar-server-ab4f951c53e4e6ee15637d78943d538d0c68be51.zip
Support Ruptela driver id
Diffstat (limited to 'src/main/java/org/traccar')
-rw-r--r--src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
index b043b6201..a9ab5f5fe 100644
--- a/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
+++ b/src/main/java/org/traccar/protocol/RuptelaProtocolDecoder.java
@@ -194,6 +194,14 @@ public class RuptelaProtocolDecoder extends BaseProtocolDecoder {
decodeParameter(position, id, buf, 8);
}
+ Long driverIdPart1 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 126);
+ Long driverIdPart2 = (Long) position.getAttributes().remove(Position.PREFIX_IO + 127);
+ if (driverIdPart1 != null && driverIdPart2 != null) {
+ ByteBuf driverId = Unpooled.copyLong(driverIdPart1, driverIdPart2);
+ position.set(Position.KEY_DRIVER_UNIQUE_ID, driverId.toString(StandardCharsets.US_ASCII));
+ driverId.release();
+ }
+
positions.add(position);
}